Monday, October 29, 2012

Robot Halloween Costume

I decided it might be time to revive my old electronics blog.

My wife and I built this robot costume for our four year old son this year.

The main part is made from a diaper box spray-painted silver with a detachable front 'control panel'. The hat is made from a wipes box with a plastic fire hat modified to allow visibility out of the hand hole in the box. With 18mo old twins, we have lots of nice cardboard boxes from baby products around our house that make fantastic building and storage products. Leftover foil tape from some duct work helps complete the look and holds everything together.

All of the electronics are driven by an Arduino Diecemila. I salvaged a slick little VFD from some scrap equipment - it's a Noritake GU112X16G-7000 (details) and is driven via the serial interface at 38400 baud. Since the Arduino serial levels are inverted from RS232, I had to build an inverting board based on a design I found online. The LEDs at the bottom are 10mm RGB and are driven by a pair of daisy-chained 74HC595 shift registers to save i/o pins on the Arduino. This makes it very easy to add lots of LEDs to a project without a lot of hassle and are quite expandable without a lot of effort. Normally the LEDs cycle through a shifting spectrum with a narrow 'window' to show a nice range of colors at all times. The buttons are arcade style buttons sourced from Sparkfun; they temporarily switch all the LEDs to whatever color is pressed, singularly or mixed to match whatever buttons are pressed (red, green, blue, yellow, cyan, magenta, or white). A small piezo speaker beeps out random 'robot noises' to add another dimension to the costume. I have an ultra bright 10mm red LED in the ball on top (hollowed out Styrofoam) that blinks out 'HALLOWEEN' in morse code. I outlined the front in green EL wire with a commercial EL driver that lets it stay solid, blink slowly or blink quickly; quickly looks the best in my opinion.

On the software side of things, the 'loop' portion of the Arduino code checks the current millis() and performs a modulo to see if it's time to run the various portions of the code (changing the image on the display, checking the buttons, cycling the colors on the LEDs, blinking the red LED, and pushing sound to the speaker). This allows for all of the components to update without blocking so everything runs smoothly. I'm sure there's a better way to accomplish this, but for a quick (ha!) Halloween hack, this seems to be working pretty well. Once I get the code cleaned up a little bit, I'll post it and link it here.


(I apologize for the vertical orientation - it worked well for the vertical orientation of the costume and I originally shot them to share on my phone)

Early test - no sound - closeups on the VFD to show the images.
Further along - this time with the sound effects working (still no paint).