Shift registers/LED drivers

Apologies if this is an RTFM question - I've tried but not found an answer yet.

I want to drive 16 LED's from an ESP32 board. I'd like to do that from as few ESP32 pins as possible, so the obvious thing is to use a couple of shift registers, but the ones I have (74hc595) are good for only 6mA per output pin. I know how to use that output to make a driver using discrete transistors, but that would take up space and involve a lot of soldering. Looking at other sites where a similar problem has been aired replies say that 'there are IC's which can do this for you' without giving actual details. Can anyone advise on a suitable IC? Ideally I'd like to drive the LEDs at around 15mA each.

You can use the TPIC6x595; the 'x' is either A, B or C; the difference is in the specification of the max. current. Check the datasheets which one will be suitable.

See post #7.

Even the C should suffice, if you're driving single 15 mA LEDs.

If you must use a shift register . . .

  • The TPIC6x595 is a very good option.

  • You can use a 74HC595 along with a ULN2803 driver.

Example

  • U4 in the schematic below is connected to ULN2803 which drives LEDs.

There's a handy device made specifically for driving LEDs and only needs 2 pins to drive it. It is the PCA9552D,118. You can control 16 LEDS and set the brightness as well.

Use addressable LEDs and you only need one (signal) pin!

Not with a 3.3volt-logic ESP. The TPIC family is 5volt-only.

There are plenty of other choices.
A MAX7219 can drive 64 LEDs with very few external parts required, but is also 5volt-only.
The easiest way (one Arduino pin) is addressable LEDs.
Most LED derivers require a 5volt supply and 5volt logic because of the higher Vf of blue and white LEDs.

“The TPIC family is 5volt-only.”

Ouch

You're not the only one that fell for that :cry:

Even the 74Hc595 might require a 5volt supply if it is to drive white or blue LEDs.

It all depends on the LED and the required current.

Example: A 5mm white 20mA LED driven at 15mA could have a volt drop of 3.2volt.
An 8mm white 180mA strawhat LED driven at 15mA will only drop 2.7volt.
Both have about the same light intensity.

I would like to know the application. And why the 15mA.

DM13A is another possibility (I've never used one). This has 16 channels/outputs with the advantage that they are constant current sources, which means you don't need a current limiting resistor for each led, just a single resistor controls the current to all 16 LEDs.

It can be powered at either 3.3V or 5V. But as already pointed out, when powering with 5V, there is no guarantee it will be able to accept signals from the 3.3V ESP32 pins (a HIGH signal must exceed 70% of the supply voltage, which is 3.5V). To be sure, you would need to level-shift the signals from the ESP32 up to 5V.

If you power the DM13A at 3.3V, there's no problem with the signals from the ESP32. But you may not be able to use blue or white LEDs because the voltage may not be high enough.

Indeed there is.
You can use the TBD62783APG with your HC595
or TBD62781A or TBD62381A

My thanks to all who have replied . My principal reason for posting here was that I'd read similar threads in other places and responses were vague - yeah, there are IC's that will do this, but no specific part numbers. I've now got some definite possibilities and am looking at datasheets. The ULN2803 suggested by LarryD in post #4 is looking good at the moment, but I'll investigate other possible solutions too.

I'd thought about addressable LEDs but what I really want is small through panel status indicators - the LEDs I have are 1.8mm and I haven't found any suitable addressable alternatives yet. I did run across some 5mm (I think) individual (as opposed to strip) LEDs on a US site but expensive to ship to the UK, where I am.

I need only red LED's so voltage for higher energy colours isn't a worry.
I think you all have solved my problem, one way or another. Thanks again.

some common proposals
MAX7219 ... interface is nearly SPI with lot of breakout boards available
HT16K33 ... for I2C, several breakout boards available
SX1509 ... for I2C, breakout boards available,

you will find several libraries for these ICs

furthermore, if you can't find an addressable 1,8mm LEDs, you might look for the WS2811 which is a single IC for 3 LEDs and chainable.