Pages

Thursday, November 5, 2015

Talking Pumpkins 2015

This is an update to the talking pumpkins rig I made back in 2013. The new project uses an arduino and an MP3 module instead of a PI for audio playack. I also made a 3D enclosure for the electronics. For the candles it is a repeat of the old build and I tried to keep the pins the same in the move from an arduino Uno to a Pro Mini. For audio I went with the DF Player Mini. I choose this sound board due to price and that unlike several other options in the same price range this module was not as picky about SD cards and supports larger than 2GB cards. A Video of it can be found on my youtube channel at https://www.youtube.com/watch?v=nb4y2U_qz3o

The Hardware:
1 - PIR sensor -  http://www.adafruit.com/products/189
1 - 15ft phone wire
6 - LED flicker candles
5 - red flicker LEDs -
http://shop.evilmadscientist.com/productsmenu/partsmenu/576
10 - 220Ω resistors - from that compartment in my tool box
5 - random proto boards the ones I used for this are no longer in production sadly
1 - small mint tin proto - https://www.adafruit.com/products/1214
1 - Micro usb breakout - http://www.adafruit.com/products/1833
1 - Arduino Pro Mini - https://www.sparkfun.com/products/11113
1 - smallish speaker - had one around
1 - DF Player Mini - http://www.dfrobot.com/index.php?route=product/product&product_id=1121#.VigOOvmrSUk
1 - 4GB Micro SD card
1 - 2600 MAh power bank

The Build:
This is all the same as my old project. I took apart some flicker LED tea lights and drilled a few holes as well as made room for the boards for the 2 LEDs.




















The PIR sensor is just a standard pir from adafruit. I connected the jst cables to some phone line and run that back to the arduino. To get it mounted I cut a pass through for the connector where I wanted the sensor and used toothpicks through the mounting holes to hold it in place.

Now for the assembly. Each candle will need one yellow and one red flicker led and some 220Ω resistors. The diagram will look something like what is seen in the diagram. You have a resistor to vcc a resistor to ground the diodes connected in series and the pin connection for the arduino between the LEDs. The way this circuit works is when the pin is high no voltage can pass through the yellow diode since the diode is being reverse biased. When the pin goes low the red diode will be reverse biased.
For this project I decided to use phone line since it would keep my wires nicely bound and give me the 3 leads I needed. To keep things clean I just cut back the fourth wire. For the arduino side I built a harness for the lights. The main board has a ground and 5v bus and connector pins for providing ground and 5v to the harness as well as a pin for the PIR sensor input.



The Pro Mini does the selection of the audio and the DF Player Mini does the heavy lifting. I apologize that the fritzing diagram is missing a part but the player mini was not anywhere I could find. To help I have included pictures as well as the fritzing diagram.


above is the back of the enclosure you can see the micro USB connector and the df player mounted to the mini tin proto-board.

Here you see the completed circuit all that is missing is the front of the case. 

Here is the fritzing diagram to help show how things were connected a bit better than the pictures above.






The Code:
The code was like the old pumpkins when the PIR is triggered it picks a random script to play thorough and after it completes it waits 3 minutes before re-trigger. THe change was moving the logic that played back the audio out of the python script I had written for the Pi and into the arduino script using the DF player library. Information on getting the required librasry and all audio files are in the github repo. 



The full repo can be found at: https://github.com/igetio/TalkingPumpkins