Quick sanity check on this comparator LED string circuit please. - Page 1
Forum section: electronics / beginners

author: homeward
author_rank: Contributor
timestamp: May 26, 2024, 10:01:35 am
content: Schematic below. I've modified a circuit from elsewhere to use an NPN instead of PNP but I'm unsure if using the +15v rail for the top of the LED string and the NPN biasing is correct. Could someone confirm please.Also, is it ok to use one CCS for multiple LED strings, as I have done? (Assuming current doesn't exceed transistor capabilities).Thanks.

author: ArdWar
author_rank: Frequent Contributor
timestamp: May 26, 2024, 10:29:12 am
content: I don't think your circuit works the way you think it'll work.For one the LEDs are all reverse biased. Even if you turn them all around they'll still burns out. LM339 (and most common comparators) have open collector/drain output. The moment one of the comparator turns on, the whole supply voltage will be applied to the LED. Your CCS won't help here since it's in parallel with the comparator output drive. You need to move it to the high side.Also no, you should not use common CCS for parallel LED strings that have (potentially) different number of LEDs between them. It's already dicey enough dealing with forward voltage variations even with equal length strings.

author: homeward
author_rank: Contributor
timestamp: May 26, 2024, 10:43:25 am
content: Hi, thanks for your reply. Is this now correct?What do you mean by dicey? I can be sure each string will have the same number of LEDs, so is it just a case that the small Vf variations will cause each string to have a slightly different brightness?

author: ArdWar
author_rank: Frequent Contributor
timestamp: May 26, 2024, 10:48:01 am
content: Maybe just do it this way. Much simpler, cheaper, and no need to fiddle with CCS. You can even drive the circuit from 5V now.The only downside is maybe a bit higher power consumption when all LEDs are on (of which more than compensated for if you go to 5V supply).

author: homeward
author_rank: Contributor
timestamp: May 26, 2024, 12:28:46 pm
content: Thanks but it's only simpler and cheaper if I have enough spare current, which I don't, hence putting the LEDs in series. (Not sure if you saw my reply above yours with revised schematic?)

author: Zero999
author_rank: Super Contributor
timestamp: May 26, 2024, 04:01:56 pm
content: It won't work.If the LEDs are connected in series, with a constant current sink, then they need to be short circuited in order to turn them off.EDIT:You're on the right track, but:Why are you using such low value resistors? They should be much higher for a low power application. There are also numerous lower power comparator ICs than the LM339.Here's a way to do it.The current source is on the positive side and the LM339 shorts the LEDs which are required to be off to 0V, but the first comparator is connected to the current source enable, which is active low, so its inputs are connected the other way round. The circuit draws very little current, until the first LED lights and is fairly constant from that point onwards.

author: homeward
author_rank: Contributor
timestamp: May 26, 2024, 07:21:13 pm
content: Thank you so much for this. Do you know happen to know what I'd need to be wary of when trying to run parallel strings off of one CCS?

author: Zero999
author_rank: Super Contributor
timestamp: May 26, 2024, 08:30:52 pm
content: Quote from: homeward on May 26, 2024, 07:21:13 pmThe general advice is don't. Use a separate current source for each string.

author: xvr
author_rank: Frequent Contributor
timestamp: May 27, 2024, 06:02:16 pm
content: Quote from: homeward on May 26, 2024, 07:21:13 pmOnly one row with fewer LEDs turned on will be lit. The other will be completely turned off.