LED Matrix and Arduino

Light Emitting Diodes (LED) are everywhere. There is a good reason for that, we love them! Most of us are using LEDs to communicate information, debug our code or simply add some style to our electronic projects. One of the first things one normally want to do is pack a bunch of LED to create a mini display. Lets see how we can build a simple 3×3 LED matrix display in less than an hour.

LED Matrix Driven by an Arduino

LED Matrix Driven by an Arduino

To build this simple circuit all you have to do is solder the cathodes (longer pin) of each column together and the anodes (shorter pin) of each row together. To avoid shorts between anodes and cathodes I added a layer of cardboard before to bend the anodes over the cathodes. Here is the schematics for this circuit:

LED Matrix Circuit

LED Matrix Circuit

Once the circuit is finished you connect the cathodes (k) to pins 2, 3 and 4 and the anodes (a) to pins 5, 6 and 7 of the Arduino board. You are done with the hardware. Lets make the program …

The following program will display a few different patterns on the LED matrix. The code is ugly and I don’t really care. We are not here to talk about code re-use but to play with LED!

You can find the code on my Github at:
https://github.com/pchretien/flash_leds

To match the code and the circuit displayed here, connect K3 with pin #5 and A3 with pin #2. I guess you will figure out how to connect the remaining LED wires!

Driving only 9 LEDs using 6 wires is far from efficient. To find out how to drive more LEDs using only 3 pins on your Arduino and an 75HC595 register chip , visit the Arduino Playground website at:
http://www.arduino.cc/en/Tutorial/ShiftOut

Have fun …

Tags: , , , , ,

4 Replies

Trackback  •  Comments RSS

  1. Thanks, you are very generous as a teacher with your examples.

  2. Fernando Perez says:

    thanks, and nice job i made my led matrix thanks to you, it was very helpfull greetings and farewells from San Luis Rio Colorado, Sonora, Mexico

Post a Reply

Your email address will not be published. Required fields are marked *

Top