I love Blinkenlights. And all kinds of other blinking and flashing LED stuff. I think, it’s already a form of addiction. When I ran across an LED matrix with square pixels, I thought it would be cool to build a small animated display with it. To keep things simple, the display is attached directly to the microcontroller the “Evil-Mad-Scientist-way”.
The display performs really well, the pixels are bright and the batteries last for over two weeks running non-stop. The microcontroller has 2 k flash RAM. That’s enough for three simple animations and a couple of messages.
If you want to see the guts, then follow me to the 64pixels howto.
And grab a 64pixels kit from the Tinker Store, if you want to build your very own.

28 responses so far ↓
1 64pixels are enough - Hack a Day // Mar 21, 2009 at 21:55
[...] put together this lovely minimal LED project. The square pixel matrix is soldered directly to the microcontroller in the same style as [...]
2 Marcus // Mar 21, 2009 at 23:09
This is marvelous! Clean build. Great idea and just simple!
Want one!
And big respect
3 joe bleau // Mar 22, 2009 at 18:21
Seems like a bad idea to rely on the micro’s output pin drivers to limit the LED current. I understand it’s a hobby project so you should do what you want, but it wouldn’t pass a design review in the real world.
4 Alex // Mar 23, 2009 at 09:10
I know, but sometimes you have to break the rules.
5 Nick // Mar 23, 2009 at 16:09
Anyone care to elaborate on why the current limiting in the microcontroller is a bad idea?
As much as I love smug nay-sayers, I’d much rather learn something from this “bad idea” than accept unsubstantiated criticism into what I “know.”
6 Alex // Mar 23, 2009 at 20:22
Okay, this may give you some background, why it’s supposed to be a bad idea, to drive an LED without an limiting resistor.
The matrix datasheet only states:
Forward Voltage matrix: 1.8V-2.2V and a maximum rating of
Forward Current: 25 mA. No curves.
To calculate how much current goes thru the LED (and so thru a source and a sink pin) we assume, that the LED runs with 4 mA at 1.8 V. That’s somewhat reasonable when you look at other LED datasheets. One thing to remember is, that forward current vs. forward voltage is not a straight line.
Now we take a look at the I/O pins of the microcontroller. The datesheet can be found at: http://www.atmel.com/dyn/resources/prod_documents/doc2543.pdf
It states: DC current per I/O pin: 40 mA. That should be the maximum current.
Then we take a look at the figures 106 and 107, which show the ability of an I/O pin to source and sink current.
If we insert our 4 mA from above, we get:
I/O Source current (Fig. 106): 4 mA at 2.5 V and 2.7 V Vcc
I/O Sink current (Fig. 109): 4 mA at 0.2 V and 2.7 V Vcc
== 2.5V – 0.2V = 2.3V
That means, the I/O pin sources 2.5 V, then comes the LED and at least another I/O pin sinks the current at 0.2 V. That leaves 2.3 V for the LED. More than we assumed (1.8V).
Okay, now lets use the same figures with new values. We assume a current of 15 mA thru the LED (more current, because of more voltage).
I/O Source current (Fig. 106): 15 mA at 2.1 V and 2.7 V Vcc
I/O Sink current (Fig. 109): 15 mA at 0.5 V and 2.7 V Vcc
== 2.1 V – 0.5 V = 1.7V
That look quite ok to me. Ok for the LED and ok for the micro.
As you see, the voltage, that the microcontroller delivers is tied to the current, that it sinks or sources. That means, the more current you demand, the lower the voltage. The current goes up from 4 mA to 15 mA and the voltage drops from 2.3 V to 1.7 V.
In the simplified design for the matrix there are no current limiting resistors. That means, the LEDs suck as much current as they could and as the micro delivers. If more LEDs are lit, the current rises and the voltage drops. So, the more LEDs are lit, the dimmer they get. In real, you can notice that, but you have to look at it very thorough.
Does this clear things up? Maybe I should do an extra post about that.
7 mightyOhm » Blog Archive » Space Invaders Button // Apr 13, 2009 at 18:49
[...] at Interactive Matter made this awesome space invaders button, inspired by Alex Weber’s 64pixels project. It uses almost entirely SMT components and an ATmega164P [...]
8 remmelt // Apr 14, 2009 at 16:03
Would this be programmable in-place? I would think so, but I’m not sure. The SpokePOV is pretty similar and that one is programmable, so I’d assume this should be as well.
Any thoughts?
9 Alex // Apr 14, 2009 at 16:30
The pins for ISP are all used for the matrix. Furthermore, the LEDs directly attached to the micro may pose a problem to a programmer, because they will need some mAs to get the voltage up. And they might just burn down, if you attach a 5V ISP programmer.
But, you could solder a 20-pin socket to the matrix and then pop the micro out, if you want to reprogram it externally.
Or, set it up on a breadboard first.
10 remmelt // Apr 15, 2009 at 11:08
The pins on the 2313 of the minipov3 are also used for LEDs, but still it can be programmed in place. I guess the main difference is that the minipov uses resistors before the LEDs (very informative post on when to use resistors, thanks for that!) so it won’t burn out when programmed. The LEDs do light up somewhat when it’s being programmed.
http://www.ladyada.net/images/minipov3/minipov3schem.png
11 Alex // Apr 15, 2009 at 11:12
Yes, you’re absolutely right.
12 Nate // Apr 23, 2009 at 22:16
Awesome idea, and I’m working on a slight modification of it for my own devious uses…
I’ll post pics, build, and proper credit on my site once it’s done.
Have you (or anyone else) had any trouble with Futurelec, though? It’s been over a week since I ordered a few of the LED matrices from them, and I haven’t seen anything except a “we received your order” email.
13 Alex // Apr 23, 2009 at 23:13
Cool, I would love to see that.
Futurelec? Once I waited a couple of days. Then I wrote an email and received a very kind mail back almost instantly. They were waiting for some parts and offered to ship the parts they had already. Worked fine for me.
14 Mischka // May 6, 2009 at 15:45
Hey Alex,
i tried to flash the Attiny by myself but always getting an Error-Message while flashing the firmware..:
[...]
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
[...]
can you tell me whats wrong with it?
15 Alex // May 6, 2009 at 19:30
Hi Mischka,
I just learned, that the avr-gcc 3.4.6 (comes with CrossPack) packs the code much tighter as the newer gcc 4.x compiler.
The newer WinAVR 20090313 compiles the matrix.c to 2310 bytes. The old compiles it to 1958 bytes. For now I would suggest to install an older version of avr-gcc (WinAVR) and try again.
In the meantime I will try to squeeze the code a bit.
Cheers,
Alex
16 Alex // May 6, 2009 at 20:09
Please try WinAVR-20060421-install.exe, that one comes with gcc 3.4.6.
17 Mischka // May 6, 2009 at 23:04
Hey Alex, Thanks for your reply. I am using Linux, so WinAVR would not work, but i’ll try an older version of avr-gcc.
18 Nate // May 13, 2009 at 06:26
Alex, Mischka…
I’m getting the same error when I try to burn the hex file.
Basically, it boils down to “the file’s too big”?
I already have two versions of avrdude on my box just to accommodate the fact that I’m using my Arduino Diecimila as the programmer (FTDI, etc.), and I’d really rather not build a “spare” version of gcc.
Could I simply trim the final size down by removing some animations and/or scrolling text?
19 Alex // May 13, 2009 at 07:35
Hi Nate,
yes, at the end it’s a “the file is too big”.
You can try to cut things down by removing some messages and/or animations.
Cheers,
Alex
20 64 Pixels Roundup | Interactive Matter // May 20, 2009 at 18:25
[...] Tinkerlogs 64 Pixel Project [...]
21 robotguy.net/Blog » Welcome to the Mazetrix // Jun 18, 2009 at 05:56
[...] My board is for a project based on the Tiletoy, and incidentally not unlike the Space Invaders Button, the Awesome and 64Pixels. [...]
22 Chris // Jun 22, 2009 at 19:32
Is there anything special about a 3V CR2032 lithium battery that would make it unsuitable to power one of these?
23 Alex // Jun 22, 2009 at 21:02
Chris,
a CR2032 would work. Marcus did his Space Invader Button with it. http://interactive-matter.org/2009/04/space-invaders-button/
Maybe the battery life is a bit limitted.
Cheers,
Alex
24 saw0 // Sep 25, 2009 at 12:34
Hello
I am trying to build this with a 8×8 Led-Matrix:
http://www.jsweihao.com/pro/dz-6.jpg
It has the same witing as the one from Futurelec, but somehow i only end up with the whole matrix lit constantly. Any hints?
Thanks
saw0
25 Alex // Sep 26, 2009 at 07:41
Hi saw0,
the pinout looks the same, but the LEDs of your matrix is common anode, while the one I used, was common cathode.
There is a code snippet (display_active_row) in the source that is commented out right now. Try to use that part.
Cheers,
Alex
26 saw0 // Sep 26, 2009 at 15:49
Hey Alex!
Thanks for pointing this out, now i also see that the wiring is different.
I uncommented the part, It works flawlessly now.
Thanks for this nice Blinky, my girlfriend loves it
Just another question: I don’t quite understand how to make own animations:
0×18, // ___XX___
0×3C, // __XXXX__
0×7E, // _XXXXXX_
0xDB, // X_XXXX_X
how can i translate the “0x##” part so i know which pixel i actually lights?
Greets and thanks in advance!
saw0
27 Alex // Sep 26, 2009 at 15:56
Hi saw0,
0x## is the hex notation.
As an example: 0×18 is one byte in hex. In bits it looks like this: 0001 1000, so first 4 digits is the 1, that last 4 is the 8. So that lights up the two LEDs in the middle.
Cheers,
Alex
28 saw0 // Sep 28, 2009 at 01:40
Thank you so much
I found a Conversion table in the net.
Greetings
saw0
Leave a Comment