If you’re a DIY enthusiast and have dreamed of making your own music box controlled by NFC cards, be it for your kids, as a present to a friend, or just to have something cool to show off, you can easily do so with some technical know-how.
Indeed, Luca Dentella recently encountered a toy programmed to read different stories aloud based on the figurine placed on top, which gave him an idea – creating an audio device using the same concept, only with music instead of children stories, sharing the process in a video streamed on March 29.
To do this, you’ll need an SD card reader, battery powered with a built-in USB-C charger, web based configuration (to map NFC tags to songs), Arduino based firmware, and a 3D printed enclosure (with .stl files provided by Dentella). You’ll also need a few other bits and pieces, all of which you can find listed on his Github page.
It all starts with downloading the .stl files from Thingiverse and printing the different elements of the case. This will take a few hours, during which time you can solder the electronic board and other elements – after preparing all the necessary components and the printed circuit board. Ideally, you’ll want to start with the ESP WROOM and the other modules, and then move on to passive components, such as resistors and capacitors.
Making the music box controlled by NFC tags
After soldering the wires that will connect the potentiometer and the switch, you can insert the lithium battery into its housing and start programming the firmware. To do this, you will need a USB serial adapter that operates at 3.3 volts to avoid damaging the ESP-32 chip. This model in particular has a jumper to choose the working voltage.
Then, it’s time to connect the adapter to the four pins on the board, remembering to invert the TX and RX signals. That is, the RX pin of the adapter must be connected to the TX pin of the board and vice versa.
To start the ESP-32 chip in programming mode, you’ll need to hold down the boot button and press reset. In Arduino ID, load the firmware available on Github. Choose the ‘ESP-32 Dev Module’ as your board and the serial port your adapter is connected to. You can leave the other parameters as default except for the partition scheme where it is important to choose up to 2 MB. Now it’s time to upload the firmware to the board.
You’ll now have to prepare the SD card after formatting it in FAT32, copy the mappings.txt file, and the web and music folders. You can find everything on Github, in the SD card section. This can also be the right time to transfer some music tracks into the ‘music’ folder.
Once the 3D printer parts are available, you can start assembling the project. Heat up the M3 inserts using the soldering iron and, once hot, place them in the appropriate holes on the base and on the lid. Use them to secure the printed circuit board and the NFC Reader module with four screws.
Assembling the parts
Add the side walls and the back one, and screw the PCB on the base. Place the switch and the potentiometer on the back side. Then, connect them with the previously prepared wires to the PCB. You can complete the potentiometer with the knob you printed previously.
Working on the front wall, solder two wires to the speaker, which will then connect to the amplifier module. Cut a circle of the appropriate dimension from a speaker fabric. With four screws and four nuts, join together the plastic support, the fabric, the speaker, and the wall.
You can screw the two speaker wires to the amplifier terminal block and position the wall. Last step – connect the NFC Reader to the PCB with jumpers, taking into account the names of the different signals.
Finally, the NFC music player is ready – all you have to do is close it and connect it to a power supply to charge the battery. When you turn it on, you will see the fixed LED and will be able to connect to the Wi-Fi network.
By bringing an NFC tag close to the player, the MP3 associated with it is played. As soon as the tag is removed, playback stops. The NFC player works by associating audio tracks on the micro SD card and NFC tags, creating the association via a web interface and Arduino Sketch.
All things considered, this NFC music box is a fun thing to make if you have the patience and willingness. If you’re up for some more serious projects, then you can also try making a GPS receiver from scratch, your very own portable Mac Mini, or turn light into sound with this very cool laser harp.