Small 16×16 RGB LED Display

The photo shows a prototype of a small 16×16 RGB LED matrix display that I worked on during 27c3 in the Hardware Hacking Area.

The display is made up of four 8×8 RGB LED modules which are only 32mm by 32mm which doesn’t give much room to work with. Each module has it’s own TLC5947 a 24-Channel, 12-Bit PWM LED Driver from Texas Instruments sinking the columns and a A2982 8-Channel Source Driver from Allegro MicroSystems source the rows. The display is controlled by an mbed NXP LPC1768 micro controller. With a 74HC238 3-to-8 Decoder and a custom switch-mode power supply module rounding out the board.

Coming up with a suitable schematic and layout only took a couple of days as I’ve used all the parts before in other boards. Etching the board and drilling the holes took about two hours on xmas eve. Reviewing the board and schematic on Day 1 I discovered a problem with the way some part were connected. With a craft knife and some future solder bridges I was able to work around the problem. I’ve already corrected the schematic and layout if I decide to make the board again.

On Day 2 after Mitch Altman’s workshop on Arduino For Newbies I began to solder the board. The process was relatively straight forward with mostly surface mount packages in SOIC and TSSOP package types. The most time consuming part was creating vias by soldering a thin wire between the two sides of the board and inserting the last LED module as the drill holes were very narrow. Though in all the soldering took about six hours.

The smoke test was successful in that it found no faults in the board. So I could now move on to programming the mbed by adapting some code from a previous project. The programming results late on Day 2 weren’t great with significant flashing of the display. Though I did discover a soldering fault which didn’t show up during the smoke test.

Day 4 was much more successful after a good nights sleep. So with a fresh head, the basic operation is. Each TLC5947 contains 24 12-bit shift registers which are connected together in series and driven by one of the SPI ports on the mbed, these registers are the source of gray scale data which is controlled by additional pins connected to the mbed. The high side current coming from the A2982’s is controlled by a 3-to-8 decoder also connected to the mbed. The corrected sequence for displaying a line on the display is that the 1153 (24 * 12 * 4) bits of data is loaded into the shift registers through the SPI port, the output is blanked, then the correct row is selected on the decoder, the data latched into the gray scale registers and the output re enabled. Then repeat for the next 7 lines, to draw a full frame.

Now at the end of Day 3 the display and code can easily operate with no flashing, I’m not sure of the refresh rate. I even spent some time working on random graphics and drawing display modes, though I’m sure better results would be achieved by someone else. I’m very happy with the results as I was expecting an out right failure.

Now what? I’ve got some small changes I could make to the board including reducing the brightness of the LEDs by changing some current controlling registers and the software can always be worked on. This was a proof of concept project for a 16×16 display I’ve been working on similar to the cool [Projekt:Bunt] a large 10×10 RGB matrix. So this prototype and any software developed for it should help the testing or running of a larger display.

Introducing the Mini Mood Light v1

Over the coming months I will use this site to try and document some of my previous electronics projects, as well as covering my future work and activities.  Kicking things off I’ll introduce the Mini Mood Light v1 kit.

Most of my recent projects have involved light emitting diodes (LEDs), you could possibly go as far as saying I’m obsessed. Some of my recent projects required hundreds and thousands of LEDs.

For the beginner working with a standard LED is relatively simple. It just requires a LED, a voltage source (battery) and a resistor with the correct value (ohms law is your friend). Working with a Tricolour or RGB (Red, Green and Blue) LED is a bit more complicated.

To achieve the larger range of possible colours with a RGB LED you can use pulse-width modulation (PWM). PWM is used to control the intensity of the LED by rapidly turning it on and off and by varying the amount of time that the LED is on or off. With a RGB LED the human eyes and brain are able to combine the different intensity of the individual red, green and blue LEDs into a particular colour.

The Mini Mood Light v1 provides a simple way for you to experiment and learn about working with RGB LEDs. The circuit combines two independent RGB LEDs, four buttons and a micro controller (MCU) on a small circuit board.

The Mini Mood Light v1 uses a MSP430G2211 MCU from Texas Instruments (TI). This MCU doesn’t contain any PWM hardware, but it’s relatively straight forward to implement PWM functionality in code using a loop and a comparison. The following fragment of C gives a very simple implementation.

int pwm = 128;
while (1) {
    enable_led();
    for (int i = 0; i < 256; i++) {
        if (i == pwm) {
            disable_led();
        }
    }
}

The combined pins of the MCU have a maximum source or sink current of 48 milliamperes. Reasonable luminous intensity for a typical LED is achieved at about 20 milliamperes. Which for the six LEDs in the Mini Mood Light that make up two RGB LEDs would exceed the maximum current rating of the MCU. To overcome this a Darlington transistor array (ULN2003A) is used as a switch to control the LEDs. With a suitable resistor setting the current for each LED to 20 milliamperes.

Four tactile buttons are connected directly to the MCU and can be sampled and debouched by polling or using a timer interrupt within the MCU. A 3.3 volt low dropout linear regulator (MCP1702), reverse polarity protection diode and a number of decoupling capacitors round out the circuit.

The Mini Mood Light v1 kit is being used as a hands on activity during a set of electronics workshops I’m giving in the TOG Hackerspace in Dublin. The workshops called Building it! are part of their Science Week 2010 and Innovation Dublin Festival 2010 activities.