Driving a looooooot of LEDs

Driving a looooooot of LEDs

Driving Multiple LEDs

Before stumbling across the RGB LED chain, I did research on how to control a large number LEDs through the Arduino. The Arduino has 14 digital input/output pins (of which 6 can be used as PWM outputs) and can only control a small amount of LEDs without any additional hardware. Our “Scales” design has 72 panels which will contain at least 1 LED per panel. In order to drive 72+ LEDs and control the R, G and B separately , we need to look into shift register chips for our circuits. On my quest, I came across 2 shift register chips; the MAX72XX and the TLC59XX.

MAX72XX

Found on the Arduino.cc website itself link, the MAX7219 LED Driver is recommended when you need some help driving a lot of LEDs. The MAX7219 does all the control and refresh work for you in driving either a 64 individual LEDs, or up to 8 digits of 7-segment displays. The drivers implement a SPI compatible slave interface that can be controlled from the Arduino using only 3 of the digital output pins. Additionally, the drivers can be cascaded by simply connecting the signal DOut from one chip to DIn on the next chip. The risk of cascading the drivers is the lack any capability of error checking on the transmitted data and you might run into trouble if the cables get any longer than 10cm between each chip.

http://www.adafruit.com/products/453 $9.95
http://www.adafruit.com/datasheets/MAX7219.pdf (datasheet)
http://playground.arduino.cc/Main/LEDMatrix

TLC59XX

During my search, I also stumbled across the 2 shift register chips from the TLC59XX series from Texas Instruments. First, the TLC5926 chip is designed for LED displays and LED lighting applications and contains a 16-bit shift register with data latches, which convert serial input data into parallel output format. Second, Anisha pointed out the TLC5940 chip mentioned on the Arduino.cc website link. This chip is also a 16-bit shift register, but it has a nifty advantage over the TLC5926 version.

TLC5926 Chip

  • 16 channels
  • 8bit analog dimming steps

http://www.ti.com/product/tlc5926
http://www.digikey.com/product-detail/en/TLC5926IDBQR/296-24760-2-ND/1906422 ± $0.75

TLC5940 Chip

  • 16 channels
  • 6bit analog dimming steps
  • 12bit grayscale PWM dimming control

http://www.ti.com/product/tlc5940
http://www.digikey.com/product-search/en/integrated-circuits-ics/pmic-led-drivers/2556628?k=tlc5940 $1.50-$3.75

Both chips require 5 pins based on this schematic. The TLC5940 has less analog dimming steps, but the it comes with a 12bit grayscale PWM dimming control which is not present in the TLC5926 chip. Grayscale PWM provides better quality and more stable brightness levels. I’ve made a short summary below with the main differences between Analog Dimming and Grayscale PWM Dimming for those who are interested.

Analog Dimming vs Grayscale PWM dimming
Older LED drivers use analog dimming to provide these brightness levels. Analog dimming changes brightness by changing the LED’s forward current. For example, if an LED is at full brightness with 20 mA of forward current,then 25% brightness is achieved by driving the LED with 5 mA of forward current. While this dimming scheme is simple and works well for lower-end displays, the drawback with analog dimming is that an LED’s color shifts with changes in forward current.

PWM dimming provides reduced brightness by modulating the LED’s forward current between 0% and 100%. The LED brightness is controlled by adjusting the relative ratios of the on time and off time. A 25% brightness level is achieved by turning the LED on at full current for 25% of each period. The advantage of PWM dimming is that the forward current is always constant, so LED color does not vary with brightness like it does with analog dimming. Pulsing the current provides precise brightness control while preserving the color purity.

Source: http://www.ti.com/lit/an/slyt238/slyt238.pdf

After reviewing both the MAX72XX and TLC59XX shift registers, I would say the TLC59XX chips would be more suitable for our prototypes such as the “Scales” concept. The MAX7219 chip is expensive going for $9.95 per unit while the TLC59XX are only half the price. The TLC59XX do require more pins in order to drive them, but I don’t think this will cause a problem since we’re not going to add many more features to our “Scales” design other than a few analog inputs.

So, if the TLC59XX is a better choice, would it be the 5926 or the 5940? As I mentioned before, the TLC5940 comes with a 12bit grayscale PWM dimming control which the 5926 does not have. I would go for that one, purely based on that and the fact that there’s a section devoted to the TLC5940 on the Arduino.cc website. Sure, the 5940 is a couple of dollars more expensive, but we won’t be needing that many of them.

PS. Texas Instruments gives free samples to students – we can check in on this later when necessary.