The core part of the project is twelve backlight white LED modules ( I bought them from the adafruit). LEDs are controlled by Atmega328 micro controller. The schematic of the project is fairly simple:
Adm here you can see project assembly with some internals visible:
Program to control the device is short enough to be present entirely in this blog:
To compile and load program into the controller memory I used Atmel Studio 6.1. Code includes three header files.
- File "io.h" contains definitions to work with input/output (comes with Studio installation)
- File "interrupt.h" is defining interrupt vectors (comes with Studio installation)
- File "pt.h" is Adam Dunkels implementation of protothread library.
Protothred library deserves some additional notes. I included it to my programming tool box recently and nowadays use it any time I need to program embedded devices in "C ". It provides multitasking framework and allows to code device states efficiently and conveniently. I highly recommend to try it for any programmer who works with micro-controllers in "C".
As you can see device is simple to made and program. Some additional details you can find in my "Instructables" project.
The only problem I see is relatively high project price. Mostly it is the price of LED modules ($2.50 for each). Nothing could be done here. To gain some additional benefits I decided to substitute Bat with Reindeer so the device is quite usable as winter decor: