When looking for some new DIY projects around arduino I found some nice ideas on RFID based MP3 players for Kids. And there is one great professional toy box on the market â these guys rule. They made a great business out of their smart idea. Check out â youâll find their page!
As my two kids are getting into listening to audiobooks and music, more and more, and still are using good old compact discs with all the handling hassle, I decided to build such an MP3 player box with some nice features to make it a great individual toy for them. After I recently bought my first 3D printer this project seemed to be some good playground to also dive into 3D printing.
So I started into concept phase â which features would I want to implement â RFID, MP3 Player, WLAN (cancelled later), IMU control, LCD display, Alarmclock, wireless charging ⊠Needed to do some research, what components I would need. Which components could I reuse? I still had an IMU, LCD module, some Arduino nanos.
With some experience in soldering and measuring the assembly is doable within 1-2 after work sessions.
The printing of the Box, consisting of a base, a cover plate and a charging station, takes some time (12+ hours depending on the printer and slicer settings), but I did that that during soldering.
Step 1: Components
The components are really mainstream meanwhile. Here is a list of components I used for this project.
1. LCD Display 1602 2Ă16 Big Characters 5 V 122*44 MM blue
2. RFID reader- NFC RFID-RC522 RF IC
3. MP3 Player â DFPlayer Mini MP3 Player Module MP3 Voice Decode Board For Arduino Supporting TF Card U- Disk IO/Serial Port/AD
4. Loudspeaker- 4 ohm 3Watts 53MM Square Speaker 36MM External Magnetic Foam Edge Silvery Cap
5. Micro SD Card 8GB
6. MPU6050 3 Axis Analog Gyroscope Sensor
7. MINI USB NANO V3.0 CH340 5 V 16 Mt Atmega328 Micro Controller Board (nearly all pins used!)
8. DS3231 Precision RTC â Alarmclock module
9. Powerbank JETech 3400 mAh
10. Universal DIY PCBA Qi Wireless Charger Receiver Module â Blue + Black
11. Prototype PCB Board Protoboard Tinned Universal Breadboard Prototyping Solderless FR4 PCB Double-Sided 5Ă7 cm 50x70mm FR4
12. 1x 2N 3904: Transistor NPN TO-92 40V 0,2A 0,5W
13. 1x1kOhm resistor to limit base current, 3x220Ohms 0,5 w (parallel! to cater for wattage â one can use a higher spec resistor, I had these) for current load between emitter and collector. 2x1kOhms for TX and RX line between Arduino and DFplayer to kill noise â I did not have an issue here.
14. Some standard DIY electronics stuff â soldering iron, solder, clipper, connectors, cablesâŠ
14. A lot of energy and a couple of hours to assemble đ
Total price for above components ~30-35⏠â mostly from aliexpress.com and dx.com. Shipping takes some time, but price is great.
Step 2: Electronics Connectivity
I did not draw a layout, nor did I use any handy tool like Fritzing or similar. Probably at a later point in time. Description below shows the connectivity. All pins that are not mentioned are not connected.
During soldering I kept measuring connectivity of the lines, end check with components mounted was also done. Nothing more annoying than having to look for one bad connection after all is assembled. Most care on GND and voltage +.
The pin layout of any component is available through google.
LC Display
LEDâ-GND
LED+âVia 220Ohm to 5V powerbank
DB7âArduino D2
DB6âArduino D3
DB5âArduino D7
DB4âArduino D8
EâArduino A1/Pin 15
R/WâGND
RSâArduino A0/Pin 14
V0â 10Kohm potentiometer Rx (to adjust contrast)
VDDâPowerbank +5V
VSSâGND
DFPlayer MP3 player
VCCâ+5V Powerbank
RXâ software serial Arduino D5 (potentially via 1kOhm resistor in case of noise problems)
TXâ software serial Arduino D9 (potentially via 1kOhm resistor in case of noise problems)
SPK1âSpeaker +
GNDâPowerbank GND
SPK2âSpeaker â
BusyâArduino A7
GNDâGND
NFC522 RFID reader
3.3VâArduino 3.3V
GNDâGND
MISOâArduino D12
MOSIâArduino D11
SCKâArduino D13
SDAâArduino D10
IMU 6050 gyro sensor
VCCâArduino 3.3V
GNDâGND Powerbank
SCLâArduino A5/SCL
SDAâArduino A4/SDA
ADOâ+3.3V (High signal) for I2C address 0x69
DS3231 Real time clock
3,3VâArduino 3.3V
SDAâArduino A4/SDA
SCLâArduino A5/SCL
GNDâGND
Current load Trigger
2N3904 emitter â GND
2N3904 base â via 1kOhm to Arduino D6
2N3904 collector â via 3x220Ohms (parallel! â one can use a higher spec resistor, I had these) to +5V
Powerbank
V+ and GND lines of Powerbank connected through a female USB connector to power connector on board and connect to Vin/GND of Arduino). The powerbank is switched on via microswitch in the cover plate. I soldered a microswitch to V+ through a load resistor to GND to simulate a load state and switch it on. Thereafter the current load keeps it from switching off.
+5V â Power connector on board +5V
GND âPower connector on board GND
+5V of powerbank â load resistor â microswitch Pin A
GND â microswitch pin B
Step 3: Electronics Assembly
The board components â MP3 player, RTC, IMU, Arduino are mounted in sockets. Select and up/down keys, RFID, LCD and power are connected via self soldered âband cablesâ long enough to fit into box later.
Microswitch to switch on powerbank is fixed coverplate â not shown in the pcitures.
I used a fixed power supply to test the setup.
While assembling I tested each component individually -> example Arduino sketches for the components are very helpful here.
As the powerbank had an auto-switch-off running with low current I included a transistor controlled load peak every 15 seconds for 100 ms via a 70 Ohm resistor (actually 3 parallel 220 Ohms to cater for sufficient wattage, itâs only a short peak but the three resistors will share the current and hence not be operated above specs).
Later it turned out that the Mini DFPlayer is pulling > 70mA continuously. As I used the powerbank auto-switch-off also for switching off of the box (by not triggering the current load anymore) I now need to re-think this.
Still having trouble with sleep mode of Arduino and DFplayer to drive down current â current does not drop below threshold to enable switch off. Feedback welcome.
Note: for the second Box I had to reorder another powerbank because I killed the electronics of my initial one. And look herer â this powerbank switches off 10 seconds after I stop triggering the load current -> switch off is working now.
The wireless charging receiver is plugged into the powerbank charging usb. The charger base is build into a charger box, printed with my 3D printer.
Step 4: Software
Software available on github
Programming is fun, I like to start with a quick nucleus of examples and to develop further. As I do not really do consequent specs, features planning and structured program plans I end up with some working but not really elegant code. This is always a todo -> go more into objects, separate in .h and .cpp âŠ
However I do want to get the thing working quickly so in many cases I get there not on the most efficient path.
But the great thing is â as soon as the HW is working one can start doing all sorts of things.
I used the arduino IDE, a couple of libraries required â simply done with the arduino IDE library manager.
So my current version of the software supports:
Welcome message
Volume (duh)
Left/right tilt of box to switch to previous/next song and if RFID deactivated to next folder through back and forth.
Pause/Play (duh)
Initialize, learn new RFID â folder is assigned based on next RFID next SD card folder. Data is stored in Arduino EEPROM
Play folder assigned to RFID â assignment RFID-to-folder through learn function
Load and save parameters to enable settings saved. Factory reset đ
Clock and date setting.
Switch on/off alarm, setting alarm hour and minute, playing a fixed song for alarm.
Switch off RFID â play mp3 without it.
Some more ideas on my list â still to be implemented
Show temperature (the RTC can do that â it measures the temp to compensate impact to the quartz )
Start laughing when shaken,
Set song for alarm
Chose which folder is assigned to RFID in learn mode
Store folder assignment and last song played on RFID chip â reusability between boxes (Iâm building another â two kids rememberâŠ.?)
enable switch-off â this not working as of now without being connected to USB -> current load through Powerbank is reduced in this setting.
Info on folder structure on SD card
I had some mp3 audiobooks and music for my children stored. So I used some linux scripts to transform the songs to the right naming. Folders are to be named in sequence two-digit numbers (i.e. â00â, â01â, â02ââŠ). Songs in there need to be named in sequence three digit numbers (i.e. â001.mp3â, â002.mp3â,âŠ).
My switch-on-welcome mp3 (âHello, Iâm your toy boxâŠâ) is stored in folder â99â as â001.mp3â.
Script is not idiot proof and should be used only in a âcopyâ directory and not on originals.
#!/bin/bash<br>let i=1 for file in *.mp3 do if (($i < 10)); then mv "$file" "00${i}.mp3" elif (($i < 100)); then mv "$file" "0${i}.mp3" else mv "$file" "${i}.mp3" fi let i++ done
Source: Kids MP3 Music Box