Propeller powered Nyan Cat Pumpkin Halloween display - Completed in one evening!
RobotWorkshop
Posts: 2,307
Every year my kids have a pumpkin decorating contest at their school. There are usually some pretty cool displays setup and here is an entry that I helped with last night. My daughter wanted to do a Nyan Cat themed pumpkin. She asked if I could have a motion sensor trigger a sound module to play the Nyan Cat theme music. She also wanted to have the background light up. The only trouble is that I only had one evening to work on all that since it was due the next day! Just having a couple lights on the background didn't seem to be enough so I used a Propeller board to control the whole thing.
Wiring up the motion detector was the easy part. Just used a 1K resistor inline on the signal pin tied to P16 on the Propeller. For the sound module we had one of the 20 second modules from Radio Shack. That worked well when using the push buttons on the module but there isn't an easy way to use a remote switch or trigger it by a microcontroller. I traced out the board and found that the switch leads just went to C3 and R3 to the pads closest to the switch. I ran a pair of wired from those pads to a small 5V relay I installed on the Propeller board. That relay is controlled by P23 which goes to a recycled opto-isolator, PN2222 transistor, then the relay coil. With that wired up I can toggle P23 high for half a second and it plays the theme music.
For the lights we used a variety of T1 and T 1 3/4 white LEDs. I have to say I am impressed with these since I could use larger 2.2K resistors and the are still bright enough when directly driven from the Prop pins. There are 11 uniquely controlled LEDs and 5 clusters of 2 LEDs connected on P0 through P15. Since I had plenty of I/O I just used a Propeller pin for each LED or LED pair. It took a while to wire it all up (a very late night) but it turned out great.
When the display is powered up the lights will randomly blink on the background while it looks for motion. When it detects motion it will trigger the sound module and then update the background for about 25 seconds before falling back into the main loop that will look for motion again. That gives the motion detector time to reset and also ensure that it doesn't try to trigger the sound module again until after it completes playing.
The Propeller is overkill for this application and I think it is a bit funny that my daughters Halloween pumpkin display probably has more computing power than the first computers I ever had a chance to use. With time so short I had to use what was on hand and the Propeller made it easy to knock this out in an evening.
Robert
Wiring up the motion detector was the easy part. Just used a 1K resistor inline on the signal pin tied to P16 on the Propeller. For the sound module we had one of the 20 second modules from Radio Shack. That worked well when using the push buttons on the module but there isn't an easy way to use a remote switch or trigger it by a microcontroller. I traced out the board and found that the switch leads just went to C3 and R3 to the pads closest to the switch. I ran a pair of wired from those pads to a small 5V relay I installed on the Propeller board. That relay is controlled by P23 which goes to a recycled opto-isolator, PN2222 transistor, then the relay coil. With that wired up I can toggle P23 high for half a second and it plays the theme music.
For the lights we used a variety of T1 and T 1 3/4 white LEDs. I have to say I am impressed with these since I could use larger 2.2K resistors and the are still bright enough when directly driven from the Prop pins. There are 11 uniquely controlled LEDs and 5 clusters of 2 LEDs connected on P0 through P15. Since I had plenty of I/O I just used a Propeller pin for each LED or LED pair. It took a while to wire it all up (a very late night) but it turned out great.
When the display is powered up the lights will randomly blink on the background while it looks for motion. When it detects motion it will trigger the sound module and then update the background for about 25 seconds before falling back into the main loop that will look for motion again. That gives the motion detector time to reset and also ensure that it doesn't try to trigger the sound module again until after it completes playing.
The Propeller is overkill for this application and I think it is a bit funny that my daughters Halloween pumpkin display probably has more computing power than the first computers I ever had a chance to use. With time so short I had to use what was on hand and the Propeller made it easy to knock this out in an evening.
Robert
Comments
That's one of the big advantages of the propeller-chip. RFP (real fast prototyping)
As it is for halloween. How about adding a cat-fighting sound "miauweeeeeeeee whooooo-ch!!"
if somebody comes close to it?
best regards
Stefan