Electronic – Smart ways to control an LED ladder

led

I have two sets of LED ladders (12 in each ladder, so 24 LED's) that I want to control from my microcontroller. I don't have enough inputs for 24 LED's (and want to make it scalable), and the microcontroller has other tasks to attend to, as well as control the LED ladders.

  • I don't have a set amount of PIN's I can dedicate for a ladder, but the lesser the better (if a number is required, maximum of 8 pins per ladder)
  • The LED's will be updated very infrequently (every few hours), so I don't want to eat up processing power by multiplexing continously.
  • My microcontroller doesn't have a DAC

Currently, I am thinking of using shift registers (8 bit and 4 bit cascaded). However, since shift registers are "one way" devices I'll have to clear the registers to set a lower value.

I don't think this is a big problem (for me, as they get updated infrequently), but are there better methods to control an LED ladder?

Edit: By an LED ladder, I mean a single line of leds (like a bar of an equalizer) that shows a level of something. The LED's don't need to be controlled individually.

Best Answer

If you want expandability, and to use almost zero Digital I/O pins for the purpose of merely LED driving, think about using a proper LED driver chip. You can do schenanigans with shift registers, but you will only go so far. If you are going to invest in board space for these ICs, why not just use a good old I2C bus LED driver with 16 channels each? Like the TLC59116 by Texas Instruments

Four hardware address pins allow up to 14 devices on the same bus. That gives you 14 * 16 total LEDs, all individually controllable (open drain, you can connect them straight to the IC with resistor from your voltage rail (up to 17V rated too!)

Not only are they individually controllable, but because it's an I2C bus you can add/remove any device from your "motherboard" in a very easy way (power + I2C connector, done!). Up to 224 LEDs with 8-bit PWM dimming, bus-wide commands, or individual LED commands. Quite amazing. Try it!

I should point out that by all means, try other types of multi-channel LED driver ICs, however the fact that there are I2C bus compatible ICs out there makes them EXTREMELY useful for expand-ability and quickly add/remove large amounts of LEDs, merely changing some software to deal with the hardware changes. The ICs are fairly cheap, only a few $ each but they will be better than trying to administer to many shift registers as fast as possible - let an IC deal with it, because that is what the are designed for.

Finally, you may use these more for "logic" than actual power driving, if the LEDs you are trying to drive are heavy duty (like, hundreds of mA to Amps each) by using inverting buffers and push/pull totem pole (also called cascode circuits) to operate the gate of a MOSFET (usually N channel, in a low-side power switch circuit).