I hosted a Halloween party last Saturday and I placed this simple prank in the bathroom. I used stuff I had at home, I mean at home we have boards, wires, tools, it is more like a small maker space.
I wanted the prank to involve sound and lights but I wasn't sure what would be a good trigger, I thought a PIR sensor would work but I didn't want it to be activated that often, so Abraham had one of those magnetic sensors used for alarms and then I thought the bathroom door would be a good placement for the prank.
I used a small USB speaker and a 3.5mm plug cable to connect the Circuit Playground Express to the speaker.
Since I had so little time, I decided to make it simple and use a Digispark board with a generic audio sensor to switch on/off the light bulb using a relay.
I used crocodile clips and Dupont cables so I didn't have to solder anything. The small breadboard was used to connect power and ground signals.
I put everything in a box and drilled holes (a lot). The microphone had to be placed really close to the speaker.
Circuit Playground Express and Digispark boards are powered with a 10, 000mAh power bank with 2 ports, except for the speaker which had full charge at the moment.
And the final setup
I used the following tutorials to play wav files with the Circuit Playground Express.
- How to run circuitpython on CPX
- Installing MU Editor
- How to play wav files in CPX
- How to process your audio files with Audacity
The Arduino code is fair simple whenever a level sound is detected it will toggle the light ON/OFF for a predefined period of time.
Whenever the door is opened some seconds after the CPX plays the psycho theme and some more seconds later another creepy wav file and the lights go ON/OFF.
I would recommend using SCR instead of the relay module to avoid the "clicking" sound. I only had the relay module at that moment :/
And of course, optimize the wiring if you want a more permanent solution :D
Comments
Please log in or sign up to comment.