This is a tiny device to display animations and short messages. It consists of three components only and is really easy to build. And fun to watch.
Prototyping on a breadboard
I used a breadboard to test the circuit and to try out new messages or animations. The controller on the breadboard is powered by the programmer with 5 Volts. That’s the reason for the 100 Ohm resistors. These are only needed on the breadboard.
Parts and Tools
Only four parts needed:
- ATTINY2313V-10PU, microcontroller, 2 k flash RAM, Digikey
- LEDMS88R, 8 * 8 LED matrix, Futurlec
- Battery holder with switch for two AA batteries, Digikey
- 2 AA batteries or rechargeables
The ATtiny2313V is a microcontroller, that runs from 5.5 down to 1.8 Volt. So it’s easy to power it from two AA cells.
And as you see, there are no resistors. Normally you would need a resisor to limit the current through the LEDs. We are a bit adventurous here and attach the LED matrix the Evil-Mad-Scientist-way directly to the controller. The controller enables only one row at a time and cycles thru all rows that fast, that a steady image emerges.
With two AA batteries the display ran over two weeks non-stop. Battery life depends a bit on how much pixels are lit at the same time.
To build it, you need:
- Soldering iron and solder
- Wire stripper or knife
- Alligator clips
- Third hand (optional)
If you want to program your own animations and messages, you will need an AVR programmer as well.
Take the pliers and carefully bend all pins flat. Note that the pins may break off if you bend them too often forth and back.
Check if all pins are aligned.
Now we have to bend the matrix pins. Use a small flat piece to bend the pins over it. I used a piece of a PCB. Note the inscription at the bottom of the matrix.
Bend the pins. They don’t have to be really flat.
Check if all pins are somewhat aligned.
Now take the cable of the battery case and wrap them around one of the middle pins. Insert the cable on the top side of the matrix. The bottom is marked with an inscription (NFM-12883AS-11), in this picture on the right side of the matrix. Make a simple knot around the pin. That serves as strain relief. Strip the black wire a bit.
Fix the the controller in place with alligator clips. Place it on the matrix so that there are two pins on the top and on the bottom, that are not attached to the matrix. This can be a bit tricky. Maybe you have to realign some of the pins. There is a small notch on the microcontroller. That notch has to point to the left.
Now solder two pins, one on each side.
Take off the alligator clips and check the alignment of all pins again.
Solder the remaining pins. Be careful not to burn the battery cables.
Last job is to hook up the battery cables. Form tiny hooks on the end of each cable. The red one connects to pin 20, the top right pin. The black cable connects to pin 10 at bottom left side.
Now solder both wires to the microcontroller.
Note: If you experience that the animation or the messages get stuck, try connecting pin 11 (PD6), that’s the unconnected one to the right on the picture above, to VCC. If you connect it to GND, it makes the animation to stop. That’s useful if you want to make pictures of it. Most of the time it should work if you just let the pin unconnected.
And that’s it. Insert two AA batteries or rechargeables and switch it on. Every time you switch it on, it displays another one of the preprogrammed animation or text messages.
Now make someone jealous.
If you have problems, compiling and flashing the code, e.g.
[...] avrdude: reading input file â€œmatrix.hexâ€ avrdude: ERROR: address 0Ã—0810 out of range at line 129 of matrix.hex avrdude: write to file â€˜matrix.hexâ€™ failed [...]
then please try the avr-gcc 3.4.6. That version is known to generate very compact code. avr-gcc 4 will compile the source into a binary that is too large for the 2 kB memory of the controller and that will result in the error message above.