//UPDATE: Added laughing ghost variant in zip file and extra battery pack
I wanted to make several small concealed audio boxes to put in the front garden to scare people for Halloween as the approached the front door. This one describes the most complicated one I wanted to build and was also my first test case, it has audio with a scary sound track, and 2 different visual lighting effects to catch peoples attention.
Before I get started I would like to credit Kristian Blåsol with the original concept for using a relay to control an MP3 amplifier module.
The concept behind this build is to make a self contained battery (or externally supplied 12v) motion activated speak with two outputs to supply 12v LEDs for effects if desired. It needed be cheap (total costs here less than £20/$25), customisable and able to take a bit of weather for one day during halloween.
Here I have opted for a 12v external supply as I have a nearby outdoor plug, and wanted to use some quite bright power hungry LED light drawing 2A. It would work with virtually no modifications with a 5v/12v battery powered unit though AA Battery holders or a small 5000mah USB powered phone charger, and could be quickly modified to power 5v external lights too off the same supply, just swap over the 12v incoming supply for your 5v supply.
(Note: post prolonged use I noticed that the Arduino struggled to supply enough juice to the mp3 module at higher volumes and caused the Arduino reset during playback, so I cut in a dedicated 5v battery supply)
Part 1 - BuildThe principle behind this build is to use an Arduino UNO to control the MP3 player and lighting. To do this we are going to use a 4 way relay module, two of which will be used to control the play and previous track buttons by simulating a PRESS on the buttons, and the remaining two to power the LEDs by opening and closing the circuit.
I used stranded 30AWG for all the control wiring all at 100mm long and 18AWG for the 12v circuit, also left long inside the box. It looks a mess but there is plenty of space inside the box and it makes it easy to take the lid off and components out without pulling off anything as I have wanted to solder it all together for reliability. In order to allow me to get the lid off however, I used female plugs for the PIR sensor connection and the speaker cables into the MP3 module are screwed in place, this allows future disconnection and removal off the lid.
I wired up the circuit as shown in the wiring diagram, with the 12v supply coming into the waterproof connector. To switch the external LEDs I connected the -v side of the incoming supply to the other -v side of the output connectors, and the routed the +v side through the relays to enable the switching.
To make the case I drilled a 32mill hole centrally for the speaker and a 16mm hole at the top to one side for the PIR sensor. I then sprayed the whole thing black to keep the LEDs on the circuit boards from giving the speaker away and keeping it concealed.
(Not shown, to waterproof the speaker I use a bicycle inner tube and repair kit to glue a square patch on the outside to allow the sound out but keep the water from getting in. Then bolted through it.)
The speaker was then screwed in place and the PIR sensor was glued in place with the glue gun (a later change meant that I ended up using an epoxy resin to fix the PIR in place as the glue gun glue let water in).
All the components were arrange as per the photo, this allowed access to the USB ports on the MP3 module and the Arduino.
(If you wanted to power the unit via 5v, you can use the USB connector on the Arduino or the micro USB connector on the MP3 player.)
Once the build was done and code uploaded I tested the unit to make sure it was working fully, and then to ensure that the soldered connections had a bit of extra support I applied some glue gun glue to the key areas that were vulnerable, such as the speaker connections,
Note, the MP3 module used requires a USB/SD card formatted for FAT32, other formats didn't work for me.
Part 2 - soundThe sound file was edited with Audacity and source files/credits are
Part 3 - SetupThe audio file and the switching on the relays by the Arduino programme are timed. If you choose to use a different audio file then manipulate the timings as test as you go, I have noted the code that needs changing.
Part 4 - Real World TestPart 5 - Final Build
Comments