Blink'n'Man
Fun with RGB diodes
Strange, funny and interesting customs are all around us. A good friend
recently invited me to celebrate the winter solstice at his home. The winter
nights are long at 56° latitude, so we're all happy when the longest night
is gone for a year.The condition for being allowed to enter is the requirement of bringing a light; anything that lights. A candle would be fine, so would a flashlight or something in that trend. However, while pondering the invitation, it got to me again that overengineering for a good time party is more rewarding than the drinks being served (wink, wink). What lights and is fun to look at? We need LEDs and a mounting rig. We need blinkenlights and buttons. I had already bought some plcc6 RGB LEDs with very high brightness some time ago and I remembered seeing some simple Atmel micro-controller at the local hackerspace OSAA. Something must be possible to make from that. After spotting a 3xAA battery-holder and some half-empty vero board I decided to make a happy dude. The lights are the eyes and the buttons as the hands. So it became Blink'n'Man. The vero board is glued onto the battery-holder with a fair amount of hot-glue. And, before I'll be getting a lot of mails, the capacitor at the top could have been mounted at a lower level, but the aesthetics of that would have been debatable. With some cotton on the top it looks like a head that lights. The schematic diagram is a basic micro-controller design without much thought: You can also get a PDF and the gschem source. The software for the micro-controller is a gathering of quick hacks to get the LEDs blinking and the buttons do some work. You can get the C-source, the Makefile and the pre-compiled hex-file. The LEDs are run in 256 step PWM mode in a timer-interrupt where also the buttons are debounced. The PWM cycle-time is about 61Hz. The program uses the HSV color-space with an integer HSV-to-RGB conversion written for 8-bit CPUs (this bit I took from another project I was working on). The right button switches between four modes: blinking, cycling, random and flashing. Holding the left button flashes a Morse warning message. The colors are moving all over the place by adding some number to the hue for the various modes.
Posted: 2011-12-14 |
Overengineering @ request | Prutsen & Pielen since 1982 |