Sep 28, 2011

Halloween Preparations

Now that we are rolling into October it’s time to kick off the holiday projects. I really enjoy these types of projects because it gives me a chance to come up with ideas that wouldn’t make sense at any other time of the year. Plus the holidays give me a fixed deadline for getting stuff done, which make me actually put in effort. Granted, this isn’t the coolest or most complex project on the planet, but it does give me a chance to get back into microcontrollers and work with some different enclosures (e.g. pumpkins).

There are a few elements to this undertaking that, implemented individually, are not hard do, but it can be tricky to make them all work well together. I made an attempt to illustrate how the system should operate in the graphic below. Follow along if you can.

First, I am going to use a Passive Infrared (PIR) sensor to detect motion outside my door on Halloween. When kids come to the door for candy, the sensor will detect their motion via infrared radiation and output a voltage. If the sensor doesn’t detect motion it pulls the voltage down to zero. I am planning on using these triggers to enable microcontrollers in four pumpkins. At this point, I am still trying to come up with ideas on how I can relay the trigger from the sensor to the four micros in the pumpkins. My first instinct was to use RF transmission, but I am also considering Zigbee and additional IR channels. Either way I want to go wireless to clean up the presentation and avoid kids tripping over excessively long lines of hook-up wire.

Once the PIR sensor sends out the “enable” signal to the four microcontrollers they will start an LED animation. By animation I mean that the pumpkins will flash at different times and in different patterns to create a small light show. The key to making this all work will be the timing between all four microcontrollers. In the worst case, I can hardcode the timing into all four controllers by basically guessing and checking until everything works correctly. However, to make things more dynamic and harder on myself I want to find a way to set the timing using the analog-to-digital converters (ADC) in the micros. By using a potentiometer to vary the voltage I feed into the ADC, I can control the delay used in executing the code. If I do it correctly, I think I should be able to let the code run and adjust the timing on the fly without having to reprogram the chips constantly.

So far all that I have managed to do is gather up some fake foam pumpkins from Oriental Trading for the aesthetics (see the picture). I found similar items in Michaels for slightly more money ($1/pumpkin) if anyone out there is interested but doesn’t feel like waiting for shipping. I also picked up a pair of artificial pumpkin carving tools from Michaels for about $3, which I have already found very useful.

I will be using the PIC16F690 microcontroller from Microchip because I happen to have four of them in my parts bin, but given the simplicity of this project just about any micro will do – PIC, AVR, MSP430, etc. I have also started looking at LED diffusers to spread the light across the inside of the pumpkin evenly. I tried something like this last year and the LEDs created hotspots with poor light dispersion.

My goal is to get some audience participation on this one. I am looking for any feedback on how best to put this all together. Give me your opinions on faces to carve in the pumpkins (leave links if you can), LED colors to use, animations to try out (no fire, please), ways to communicate between the various pieces, extra features to tack on, and anything else you want to share.

I will of course post more on this project as Halloween approaches. Those entries will likely be short update posts to discuss any issues I am having or to show my progress.


Joel Ryan said...

It would be sick if you used LEDs that changed color, and were synchronized somehow. If I were doing this I would probably go pretty simple on the pumpkin carving. Mostly because I'm not good at carving pumpkins, but also because the focus of the piece is to do a cool light thing.

As far as extra features, it would be funny to have some straw and stuff-- to have a contrast between the rustic setting and the LEDs. Juxtaposition, dude. Also, you should have the LEDs be dimly on all the time-- I think it would be more of a surprise than having unlit pumpkins.

Post a Comment