how do i made led matrix? ¯\°_o/¯

Apr 26, 2008 01:15

Two days ago I came up with this idea of making a 4x4 LED matrix. Yesterday I soldered it together and today I wrote a demo program.

(Yeah, I know they sell pre-made ones.)

This is the first time I actually made something, that you can call a device. Before now, I would just assemble the circuit on my breadboard, play with it for a few hours and then disassemble it. And the circuits I assembled could hardly be called 'devices' since they were usually intened for a one time demonstration or something like that, not for a long-term functioning.

Components I used: standard logic integreted circuits (IC's), namely, two 74HC373 (a "latch" ("защелка")) and one 74HC04 (the NOT gate); sixteen 220 Ohm resistors and sixteen LEDs.

The principles behind it are as follows: since the LPT port has only 8 data lines, we can't obviously operate on all the 16 LEDs at the same time. So we need to either switch between them very fast, or we need to find a way to preserve the information on the one half of the LEDs while we are working with the other half. I chose the second option, because it's easier to program, and because with the first method -- the computer would need to run in an endless loop and that would consume CPU power and... Well, I just felt like the second method would be more appropriate.

Soldering time: around... 10 hours. Those small wires were a real nuisance =_=
Programming time: around 4 hours.

Photos.

Planning how to arrange elements:



The isolation on wires melted ofcourse:



CONSTRUCTION COMPLETE:






The back:



Schematics:



Here's A VIDEO of the device, demonsrating a scrolling "HELLO WORLD" string.

And here's the source code of the program that does that.

usage: ./ledmtrx [-t delay] [-s || -b || -d || -r || -D] data

-t delay -- delay for scrolling or substituting display modes, see below
-s -- default mode, scroll text; 'data' is the text to scroll
-b -- display text by substituting chars; 'data' is the text to display
-d -- display an individual char; 'data' is the char
-r -- raw; 'data' is an unsigned short value to write to the matrix
-D -- display a demo; 'data' is ignored

This thingie has some serious weak points. I bought clear LEDs, but I should've bought diffused LEDs, then it would look much better. And it's too small. I'm thinking of making an 8x8 matrix.

Also, my cat:

openbsd, unix, electronics, i did it for teh lulz, fun, programming

Previous post Next post
Up