Arduino controlled LED matrix boards
Posted by Jurgen Westerhof on 11 October 2011
Tag(s): Hobbyprojecten
Here at Infi we’re proud to have adopted something like Google’s 20 percent time philosophy. We’re allowed to use one week a year to spend on projects not necessarily in our job descriptions. You can use the time to develop something new, or if you see something that’s broken, you can use the time to fix it. This is how we, Jorik van der Werf and Jurgen Westerhof recently got Conway’s game of life, among other features, working on second hand LED boards controlled by an Arduino.
The initial goal of the project was to display Conway’s game of life on a matrix board of 32x32 LEDs. You might consider this an easy task but since we’re software engineers, hardware is something new for us. In addition to that, the LED matrix boards we eventually came up with were three second hand (taken from a discarded sports hall score board) 16x32 LED boards of which the control protocol was unknown.
Other ideas we came up with while imagining where to spend our week on were things like a ticker tape, clock and thermometer display. During the week we advanced fast enough to even implement a software menu to switch between them and PONG, one of the first computer games.
The Arduino

To control the LEDs we use an Arduino Mega 2560. A device with a 16MHz Atmega 2560 processor and has 256 kB memory, 8 kB SRAM and 4 kB EEPROM. The Arduino can connect to other peripherals with its 54 digital input and output ports which support some popular protocols natively and 16 analog ports. The device also includes an USB-connector which makes it really easy to connect it to a computer and flash it with compilations of your own (C, C++ and the like) programs.
To connect buttons, for the user interface, the led boards, the clock and thermometer we used a breadboard. This breadboard makes soldering obsolete and allows you to make quick circuit changes and prevents damage from soldering (this includes burns to clumsy programmers). You can simply plug wires in the board to have them connected to each other.
LED matrix boards
Before implementing the game of life we needed to figure out how the led boards could be controlled. After plugging them to a 5V jack we found out every led still worked (although the circuit boards seemed to be very sensitive to physical contact). We could even see the patterns of worn LEDs caused by extensive use from displaying the time or the score match after match after match.
One board has 16 rows of 32 LEDs each. How would they be controlled? Thorough use of Google aided us to find the types of chips and connectors used on the boards, and we found a schematic for the 16-pin connector on the back of the board. We connected the 16 pins to some digital i/o-ports of the Arduino and started ‘talking’ to it.

One board seems to be divided in two halves of 8x32 LEDs. These halves each have their own data input: LDAT (lower data) and UDAT (upper data) which are two of the 16 pins of the connector (‘CLOCK’ being the third).

- The upper half, controlled by UDAT
- The lower half, controlled by LDAT
| nc | 15 | 16 | GROUND |
| LDAT | 13 | 14 | GROUND |
| nc | 11 | 12 | GROUND |
| UDAT | 9 | 10 | GROUND |
| A2 | 7 | 8 | GROUND |
| A1 | 5 | 6 | /OE |
| A0 | 3 | 4 | STROBE |
| CLOCK | 1 | 2 | GROUND |
The LED boards can be controlled by iterating the rows per column. In this iteration the values of A0, A1 and A2, which are three of the 16 pins of the connector, are set to binary 0 to 7. The first row representation is 000, the second 001, the third 010, etc. In the example above, A[0,1,2] has value 001, so the second row is addressed.
After selecting the row it’s time to clock in the data for this row. This is accomplished by looping over 2 x 32 LED’s (with 1 bit for the upper half and one bit for the lower half each iteration) while clock pulsing every pair. See the above example for a graphical representation. For the upper half, while clocking if UDAT is 0, the target LED will be off and when UDAT is 1 it’ll be on.

This is an example pseudo code to control the LED boards.
loop {
for y=0 to 7 {
for x=0 to 31 {
LDAT high if the LED(x, y+8) should be on
UDAT high if the LED(x, y) should be on
CLOCK low
CLOCK high
}
[A2, A1, A0] = binary(y)
}
}
Now we figured out the LED matrix boards a relatively simple task was to implement Conway’s game of life on it. The game is a simulation of colonization of life in a world of X x Y cells. The LED boards form an ideal world because together they consist of 48 x 32 (3 x 16 x 32) LEDs.
At time = 0, a seed is needed on the world to start the game: to have some cell which are alive and some are dead. Every turn of the game, the new state of every cell is evaluated using a couple of simple rules. A cell dies of loneliness if it has one or no living neighbors and it dies of food shortage if it has four or more living neighbors. It stays alive when it has exactly three living neighbors. A cell rises from the dead if it has exactly three living neighbors. This way different patterns occur during time.
Conclusion
The Arduino is a simple and fun device to program. All you need to know is the common C/Java-like syntax. Every Arduino program has as Setup() and a Loop() method, which are called during initialization and iteration respectively. It was fun to learn the hardware/software match this way and it is very exiting when the first controlled LED patterns occur on the boards. I don’t think I’ll ever need this for work but the complete project of building the circuit along the usual programming was a fun and educative process.
More information
- Powerpoint presentation (slideshare)
- Conway's Game of Life
- Conway's Game of Life implementation
- Arduino Mega 2560
Comments:
I've learnt a lot from ur examples. I'm begineer in led board displaying. I'm working on TI controller with 32*16 led board, canu help me for writing code?
thanks

















