Monday, 4 November 2013

LED Matrix Display and Controller


Every year the local Cub Scout pack has a Kub Kar race, where the children carve blocks of wood into cars of their own design and then race them. In order to help them identify which car passed the finish line first, I built them a detector using photointerrupters. Naturally, the winner needed to be displayed and I thought we could go all out and have an LED matrix display the winner.

Display Operation

In order to display an image, the LED matrix works by sweeping an image horizontally across the display; persistence of vision allows us to see the complete image. The controller contains a parallel bus that sets the on/off state of all of the LEDs in each row. Shift registers enable a single column at a time allowing the controller to illuminate each single column sequentially. The columns are drawn at a rate much higher than perceivable by the human eye, so we see the full image and do not see any sweeping or flicker.


This project consists of two board designs:
  • Display Module Board: This board consists of the shift registers and LED drivers needed to select which LEDs are illuminated. A standard 8 x 8 bi-colour LED module in soldered directly to this board. The board is designed to be able to connect multiple identical boards in series to extend the length of the display.
  • Controller Board: This board is the brains of the system and incorporates an Atmel XMEGA microcontroller. The extra muscle of the XMEGA was needed in order to make the control of the display completely hardware driven, leaving processing power to the display image generation and the main application.

The following is a block diagram describing the various signals and buses used to control the display.

The controller board includes circuitry for digital inputs/outputs, a speaker driver, LEDs and push buttons. Although not currently implemented, these circuits allow for the expansion of this system for features such as an automated car release mechanism, sound effects, and as an interface to other sensors and displays.

The Display Module board layout consists of a panel of 2 x 3 boards since most cheap PCB fabricators round charges based on specific board sizes. The boards can always be cut from the panel if needed. For convenience, the modules on the panel are electrically connected horizontally.




The software provided flashes between "READY!" and "PRET!" indicating that the system is ready for a race. When an edge is detected on one of the photointerrupter inputs the winner's colour ("RED" or "GREEN") is displayed. After a timeout, the system returns to ready.