The awesome embedded adventures logo goes here!
GO

EMBEDDED ADVENTURES: CONNECT THE WORLD AROUND YOU

Using a LED Matrix Display with Raspberry Pi

By Pete Goss

When I received a Raspberry Pi for Christmas it could have been little like "Coals to Newcastle,"because my day job is working with UNIX systems.

However, the great thing about the Raspberry Pi, which sets it apart from other systems, is the General Purpose IO pins.

Therefore, I immediately set about to connect my Pi with an LED display. I found Embedded Adventures' LED Matrix Display with 80 columns by 8 rows of LEDs (LDP-8008), and it was perfect for what I what I wanted to do.

Rasberry Pi with LDP-8008 LED Matrix Display

The LDP-8008's data sheet explains reasonably well what you need to do get the display working. Though, note that the data sheet is for both the and the LDP-6416, a 64 pixel by 16 pixel LED matrix display also available from Embedded Adventures. 

I connected up the GPIO pins of the Pi to the LDP-8008 in the following way:

###############################################
# connect Raspberry Pi GPIO to J1 on LDP-8008
###############################################
# GPIO pin LDP-8008 pin
# 3  ------------> 2  A  (Row address)
# 5  ------------> 4  B  (Row address)
# 6  ------------> 5  GND
# 7  ------------> 6  C  (Row address)
# 8  ------------> 7  EN (Enable Display)
# 10 ------------> 8  D  (Row address)
# 11 ------------> 9  R1 (Red Led)
# 12 ------------> 10 G1 (Green Led)
# 13 ------------> 14 L  (Latch)
# 15 ------------> 16 S  (Shift)
###############################################

The data sheet went into depth about the need for a 5V 2.5 amp power supply, but to my surprise I found it worked without any power supply connections at all!

The main thing to remember is that the LDP-8008 has an 80 bit shift register that you must shift one row's worth of column data into. You then select which of the 8 rows you want that data to show on.

I created a python module (ldp.py) to make it easier to write python scripts without worrying about pin numbers.

This module, a font module and two example scripts are included in a compressed tar file (ldp_8008.tar.gz). The example scripts are called static and scroll. I'll leave you to work out what they do.

To use my examples you must have the RPi.GPIO module installed, which you can find here: http://sourceforge.net/projects/raspberry-gpio-python/. My Pi came with this module pre-loaded, but just in case. 

You can copy my zipped tar file to your Pi and then extract it with: tar xvzf ldp_8008.tar.gz

Assuming you have connected the LDP-8008 to your Pi as shown above you can then try this: sudo ./scroll "Raspberry Pi" 1

The two example python scripts need two args. The first is your required text string, and the second is the LED colour - 1 for red, 2 for green and 3 for orange.

Type CTRL-C to terminate the script.

Have fun!