10 Second Story/ Music Box - Original
by NeilBuilds in Circuits > Assistive Tech
291 Views, 4 Favorites, 0 Comments
10 Second Story/ Music Box - Original
I regularly work with a local school for children with complex or additional needs. This project came out of a conversation with some of the school teachers about allowing students to interact with their environment through the use of a standard 3.5mm button. This enabled the higher functioning students to have an impact on their surroundings in a positive way and can be used to allow them to progress through a story at their own pace (as shown) or to play music at a pace that suits them but requires continued interaction. Through discussion with the teachers - 10 seconds was discussed as a reasonable length of time for audio to be played.
This is the original flavour of the music box and the use of a micro SD card allows for user read stories to be recorded in MP3 format and played back or for MP3 files to be transferred to the card. The DFPlayer Mini allows for multiple audio file formats but this worked well for me. The tactile toggle switch on this system provides a way of silencing the speaker if the student prefers headphones only.
A friend suggested making one of these and recording him reading stories to his as yet unborn grandchildren but I don't know what the memory life of the SD card would be. Perhaps something to consider.
I have created multiple 'remixes' of this project which I shall add over the coming weeks, to date these include:
Automatic speaker disconnection when headphones are added and a third version with on box volume control buttons.
Supplies
Plastic industrial box (121 x 87 x 192mm) - https://www.screwfix.com/p/schneider-electric-ip66-weatherproof-outdoor-enclosure-121-x-87-x-192mm/355hv - these are generic industrial electrical enclosures.
5V Power bank - Amazon link - chosen as these are on special offer, but any 5V USB powerbank will do.
Arduino controllers - Nano - https://uk.rs-online.com/web/p/arduino/1927590
Arduino controllers - Nano - AliExpress link - generic (cheaper and came with a shield to reduce soldering shown here, I also got the cable here too as the ones supplied are data capable)
Dfplayer mini MP3 codec, amp & SD card mount - Pi Hut link
4 Ohm 3W Speakers - Pi Hut link
3x 3.5mm mono ports - Bitsbox link
Micro SD card (or SD card of choice) - Amazon link - 4Gb selected but anything up to 32Gb should be acceptable.
Toggle switch (optional) - Bitsbox link - I added this between the speaker connections to effectively switch off the speaker when not required
Signal wire - as you see fit (I used multiple lengths about 10cm long here which seemed to fit in well) I've used white here but feel free to use whatever colour you prefer - here
Male to female jumper wires - Bitsbox link - these are always useful when building something so you can test as you go.
1x 1k Ohm resistor
1x 47 Ohm resistor
Tools to build this:
Good soldering iron starter kit - available here
or a more advanced soldering station with holder that I'm using here
Lead free solder (smaller packs are available) here
Drill - here
6mm drill bit - here
12mm drill bit - here for the speaker on/ off switch.
Wire strippers (I use these as they take the work out of wire sizing) - here
Wire cutters - here
Hot glue gun - Amazon link
Flat head screw driver - hardware shop of choice
Pencil/ permanent marker - makers choice
The Amazon links which I have set here I receive a commission on here which I use to continue developing and making assistive technology items. Alternative shops for all of these parts/ tools do exist.
Mark & Drill Holes in the Box
First of all I marked out the hole positions for the USB lead and headphone socket on the left side and for the two 3.5mm sockets on the right side. As this version includes the speaker switch - I marked the position there on the front along with 6 speaker holes to let the sound out.
Using a 6mm drill bit - I drilled these holes out with a piece of scrap wood behind the hole, this allowed me to put some pressure onto the box without risking damaging it. I then removed any cutting debris from the inside of the hole. To make fitting the 3.5mm sockets easier I did add a small countersink on the inside of the box. This gave me more room to fit the nut on the outside of the 3.5 socket.
For the speaker on/ off switch hole I drilled it first with the 6mm bit then opened it out to 12mm diameter.
For the USB hole on the left - I measured the smallest end of the connector and expanded the hole so I could fit the smallest end of the USB cable using a small file but you can use the wire cutters if more material needs to be removed.
Prepare the Electronic Connections
Everything in this box fits from the inside out so as long as you leave yourself enough wire (I found about 10 cm was plenty) you'll be fine. It also means you can connect everything on a bench first before fitting into the box.
The wiring diagram shown can be completed with wires soldered in place however I used male to female jumper wires between the Dfplayer mini mp3 card and the screw shield to limit the amount of soldering necessary.
Eager to get going I mounted the Arduino Nano into the screw shield. That satisfying feeling of getting something done so quickly.
I prepared the speakers by removing the connector from the end - we are only going to be using one speaker so stereo is not needed. Then I stripped 3mm off the positive and negative wires from one of the speakers and tinned the ends with solder.
For the 3.5mm switch jacks I checked with a continuity meter which connections would be closed when the button was pressed (normally open) and soldered around 15cm of signal wire onto the two tabs. I used a permanent marker to make one of the wires a 'negative'.
For the 3.5mm headphone jack I checked with a continuity meter which connections would be permanently on with or without a headphone plugged in and soldered around 15cm of signal wire onto the two tabs as above.
I then soldered a 1k Ohm resistor to the male end of a jumper cable and soldered a 47 Ohm resistor to a 10cm length of signal wire.
Now I added the jumper wires as shown to the Dfplayer mini card as shown on the diagram. You know you're doing it right when all of the jumper wires are on the same side - if not, take a look at the wiring diagram again.
At this point we can start connecting the wires to the correct points to test what we've done (final photo)
Box Build
A reminder of the wiring diagram.
The connections are:
Arduino Pin D3 - 1K Ohm resistor jumper to Rx on DFPlayer Mini
Arduino Pin D4 - jumper wire to Tx on DFPlayer Mini
Arduino Pin D6 - to one side of a 3.5mm switch jack - this will become the 'Next track' button.
Arduino Pin D8 - to one side of a 3.5mm switch jack - this will become the 'Play' button.
Arduino Pin D10 - 47 Ohm resistor wire to ground - this is needed to keep most battery banks active due to the low power draw.
The 5V connection on the Arduino to VCC on DFPlayer Mini
The grounds from the DFPlayer Mini and the two switch buttons need to be combined and fed into the Arduino ground. I combined them away from other connections and used some heatshrink to cover the connection to ensure it didn't contact anything else.
The speaker connections are wired from the DFPlayer through the headphone 3.5mm jack so this is always active, with the speaker negative passing through the toggle switch on the front.
At this point - I fitted the electrical parts into the box to get the positions correct (photo shows the speaker off to the top right). Once you're happy with this you can set this in place with some hot glue. I found that the DFPlayer Mini was best placed so you can push onto the SD card from the top with the speaker glued to the side opposite the speaker holes.
I then used pliers to ensure all external nut fittings were snug tight.
Lastly I glued the powerbank to the free side making sure the USB cable would reach between it and the Arduino before filling the last of the hole with hot glue to prevent debris from getting inside.
The Code
I have placed the code below and as a file. You'll need the latest DFPlayer library available here.
It's worth playing with the initial speaker volume to get that right. Once you've uploaded the code and some music or audio content to the SD card, you're ready to give it a go with switches through the 3.5mm jack.
For a low cost 3.5mm connected switch build - please see one of my other projects here.
As the USB A connection for the power bank is data capable - any changes you need to make to the volume, timing etc can be done wiithout having to open the box.
Downloads
Various Labels
As this is a project for use in schools I added too many labels. These were printed on a generic label printer and once the box was in use - the need for them was reduced as shown on the main project photo.
Now get reading stories and adding them to music boxes.