8x5 led matrix how to?

Hi guys :slight_smile:

First let me say I'm new to the arduino, hardware and electronics world. I'm mostly a developer (programming like java, python, and mostly web like php, flash, javascript).

I recently got an arduino starter kit (a few leds, cables, a breadboard and the arduino duemilanove). I mostly have no idea about circuits, other than what I learned in highschool 10 years ago, but I've managed to go through the most basic tasks: make a couple of leds blink, use a button to turn leds on/off and finally connected a wii nunchuck. It all works. I have no problems understanding the software and all that, but my main problem is the circuits.

Now, here comes my problem. I got a 5x8 led matrix which I want to control using the wii nunchuck. Once I have it receiving signals, I guess I'll be able to do it, but my main problem is I have no idea how to do the circuit. It has 14 pins (7 on each side)...how do I create a circuit for it (keep in mind I don't know which pin goes to ground, which is power, etc). I've searched and searched, but most info skips this part, assuming you know how to (I bet this is basics electronics).

Could you refer me to a place where I can learn about this, or I'm aiming too high, and should stay with blinking leds (if so, that's damn bad luck, because my next project was going to be using a pan and tilt mechanism with servos).

I hope you can help me with some directions on where to start :slight_smile:

If the matrix has a number printed on the side of it, Google that number along with the word "datasheet." If not, see if there's a datasheet at the vendor you bought the matrix.

If no datasheet is available, hook up a resistor from GND, and a wire from +5VDC, and start attacking pairs of pins. The resistor should be at least 220 ohm, I'd pick a 1K ohm if I had no datasheet.

GND <------////------Pin Pin------> +V

Sliding your wire across a bunch of pins is easy and quick. If you get anything to light up, note what pin pair you have as "cathode" (the GND side) and "anode" (the +V side). You can likely get neighbors to light up with nearby pins, and when you do, you'll find out if cathodes control whole rows, or if cathodes control whole columns.

That's how they're wired: if a particular cathode pin controls a whole row, then an anode pin will control a whole column. Draw your own datasheet on graph paper.

Then comes the software: eight lines for rows, five lines with resistors for columns. If columns are cathodes, then make all column pins HIGH except for one. If column pins are anodes, then make all column pins LOW except for one. Then the lights in that column will match the HIGH/LOW pattern you put on the row pins. (Or they'll be the perfect complete opposite.) To get all the lights in the matrix to do what you want, just repeat this process for each column, and repeat the whole process over and over, at least 60 Hz so it's easy on the eyes.

Avoid digital i/o pins 0 and 1, so you can use Serial.print() for debugging. By the way, you can use the "Analog" pins as regular digital i/o for pinMode() and digitalWrite(), they're just numbered from 14 to 19. With 8 row plus 5 column matrix pins, you'll need 13 digital i/o lines.

Or will you? Can you use fewer digital i/o lines? That's the next challenge. :slight_smile: Good luck!