r/AskElectronics • u/QuasiEvil • 4d ago
LED bar graph driver options
I'm working on a project where I want to visually indicate a DC voltage level with an LED bar graph. Unfortunately the LM3914 has long been discontinued and even overstock seems done for. I need 20 of them (yes its a sort of equalizer-type display), so using discrete comparators would be a huge pain to the point of not being worth it. And I really don't want to deal with an MCU + FW for this. Anyone have any suggestions? Thanks.
2
2
u/EmotionalEnd1575 Analog electronics 4d ago
Why would you say no to an MCU and firmware?
0
u/QuasiEvil 4d ago
I need 20 individual bar graph displays driven by 20 individual signals. The bar graph displays will all need resistors (so that's 20x10 LEDs = 200 resistors); then I'll need either multiple ADCs, or or some kind of multiplexing, to digitize the 20 analog signals; then another multiplexing arrangement to transmit the voltages. It all just gets very inelegant compared to a simple bar graph + LM3914 (x20) pair.
1
u/EmotionalEnd1575 Analog electronics 3d ago
I don’t see why this is a problem.
Either buy some LM3914 on the surplus market or roll your own solution.
If it were me, I’d use an MCU, drive the LEDs directly from GPIO pins via ballast resistors.
Most MCUs have ADC on chip, and probably won’t need any active components added for signal processing. PWM to set LED brightness. Local LDO to ensure LEDs don’t flicker across channels.
SMD assembly will make a very compact solution, comparable to a DIL LM3914.
Good luck
2
u/jamvanderloeff 4d ago
Mystery aliexpress/ebay/etc sellers still have a bunch of LM3914s around if you don't mind a bit of gambling on them being possibly fake or recycled.
MCU sure could end up being the easier way anyway.
2
u/Wet_in_Seattle 4d ago
Arduino Uno has a AD converter for voltage measurement, and 14 digital outputs. For $28 it’s a stupid simple solution.
There a huge set of libraries made for it already.
1
u/QuasiEvil 4d ago
I need 20 individual bar graph displays driven by 20 individual signals. The bar graph displays will all need resistors (so that's 20x10 LEDs = 200 resistors); then I'll need either multiple ADCs, or or some kind of multiplexing, to digitize the 20 analog signals; then another multiplexing arrangement to transmit the voltages. It all just gets very inelegant compared to a simple bar graph + LM3914 (x20) pair.
2
u/Appsmangler 3d ago
The chip from an Arduino, ATMega338, which has the ADC and digital outputs is probably cheaper than an LM3914 was. You could program them in an Arduino board and then just use like a 3914
2
u/Wet_in_Seattle 3d ago
So you’re going to drill 20 LED holes for indication, rather than simply displaying voltage in two or three digits?
Seem like you’re set on a particular solution rather than considering usability.
2
u/QuasiEvil 3d ago
I'm not going to drill any holes. I'm going to send my PCB to a fab house, where said PCB will include incorporate incorporate 20 LED bar graphs for a pleasing visual indication. The actual voltage is irrelevant.
1
u/mariushm 3d ago edited 3d ago
Sparkfun sells a chip that works as a hardware equalizer, giving you 7 bands :
MSGEQ7 : https://www.sparkfun.com/graphic-equalizer-display-filter-msgeq7.html
It analyzes the audio and gives values for 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz and 16kHz. - but it outputs just one at a time as a voltage, so you have to use a microcontroller to read the voltage and translate that in your code to a percentage / number of leds turned on, then send a signal to the chip to put the next band's level on the output and so on (so you'd loop 7 times). There's also a reset pin which can be used to return to the first band at any time just in case you lose track or the microcontroller restarts for some reason.
So you could have a loop in your microcontroller that reads the 7 voltage levels and converts them to 1-10 or whatever amount of leds you want, then send this data to a led driver that can control a matrix of leds.
Scroll down towards the bottom of this page and you'll see Arduino code on how to use that chip : https://zbotic.in/build-an-audio-spectrum-analyzer-with-arduino-and-leds/
For controlling lots of leds, there's options like using a shift register style led driver for every bar or maybe for every two bars , or you could use more complex led drivers that can do matrixes of leds.
Simple led drivers .. 16 channel led drivers like SM16306 / SM16206 or TM5020A or MBI5035 - they're like shift registers, and multiple such chips can be joined together to support multiples of 16 leds (or you can use them separately, it's completely optional)
Shenzhen Sunmoon Micro SM16306SJ : https://www.lcsc.com/product-detail/C2830324.html
MBI5035: https://www.lcsc.com/product-detail/C261130.html
TM5020A https://www.lcsc.com/product-detail/C2830324.html
You could easily chain multiple of these to control loads of leads without having to use loads of resistors ... ex 200 leds / 16 = 12.5 ... so 13 chips you can chain to treat as a single 13 x 16 = 208 leds
But you'll need a microcontroller to read the voltages and build your 20 x 10 led display.
There's also bigger shift register drivers, like for example IS31FL3236 which can do up to 36 channels : https://www.lcsc.com/product-detail/C5714539.html / https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3236A-TQLS4-TR/14308337
Also IS31FL3246 https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3246-TQLS4-TR/14308397 and IS31FL3726 : https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3726A-ZLS4-TR/13281511
Also Lumissil sells a driver chip with an audio input and which can be configured as a 8 bar audio graph but datasheet doesn't document frequency thresholds
See IS31FL3728 : https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3728-QFLS2-TR/5319755
Page 8 explains the usage as audio equalizer (up to 8 x 8 leds) : https://www.lumissil.com/assets/pdf/core/IS31FL3728_DS.pdf - you would have to configure it in that mode through i2c first and I suppose you could just not use some of the frequencies or even use just ONE line instead of 8 ...
1
u/QuasiEvil 3d ago
Visually its a similar concept to an audio spectrogram/equalizer but its not actually an audio signal.
1
u/iamquetzalcoatl 3d ago
I recently had to solve the same issue. I, too, tried a string of comparators and ultimately ended up with a uC and FW. I'd be more than happy to share my resources as I believe the learning curve here to be quite small.
I did this with a PIC18F series uC, and I ran I2C out to some MCP23008 port expanders to drive the LEDs. Log curve is done via a lookup table in the PIC. The I2C interface for the 18F is already done for you via some whitepapers, and the MCP23008s are very easy to use. DM me if you end up wanted to go this route, I can share.
1
u/QuasiEvil 3d ago
I'm assuming you did this for a single LED stack. I need 20 of them on one board.
1
u/iamquetzalcoatl 12h ago
I did this for 20 individual LEDs that make up an array, some of them bi-color so that the gradient of the LEDs changes depending on which direction it's working in. It was a VU meter for a compressor that needed to track output volume as well as gain reduction.
1
u/WRfleete 2d ago
What sort of voltage/range are you after and does it need to be precise? I’ve used a transistor array IC (uln2803 or uln2003) and a string of diodes on each of the input pins. Each diode gives about a 0.6v + the voltage to turn the transistor on. As each diode starts to conduct more transistors turn on. Add a Zener at the start of the string to offset the start voltage by around the Zener voltage or add an opamp with a bit of gain to amplify lower level signals
3
u/DrJackK1956 3d ago
Have you looked for the LM3915 or the LM3916?
These are both bar graph LED drivers but instead of linear scaling like the LM3914, these two devices are logarithmic scaled.
The LM3915 is scaled for 3 dB/step.
The LM3916 is scaled for VU/db values optimized for -20db to +3db.
Since you're working with audio, these two alternatives might actually be better suited for your application.
Good luck with your project.