Controlling 3 LEDs with one constant current circuit

I have a red, a green, and a blue LED that I need to light up brightly. Only one at a time, though. My project is run from batteries, and I would like the brightness to not diminish as the batteries lose voltage. I understand that is what a constant current circuit is for.

Can I just use one LM317 adjustable voltage regulator, or would I need 3, or is there an easier way? Do people usually use ws2801 or something?

If you choose to use a WS2801, read its datasheet as it explains how to create a constant current setup.

TanHadron:
I have a red, a green, and a blue LED that I need to light up brightly. Only one at a time, though. My project is run from batteries, and I would like the brightness to not diminish as the batteries lose voltage. I understand that is what a constant current circuit is for.

Yes.

(...and 10/10 for correct thinking - very rare around here!)

TanHadron:
Can I just use one LM317 adjustable voltage regulator, or would I need 3, or is there an easier way?

You can do it with 1 if you're only going to light up 1 LED at a time. Nothing will die if you turn all of them on but the brightness won't be what you want.

Easier then a LM317 + resistor? Probably not.

If I wanted to light up more than one I'd do it with one of these or (this - same thing). Yes, it's a VU meter but if you tie pin 7 to VCC you get five constant-current pins, no other components needed, and they take up less space on a PCB than resistors/whatever. You can also connect pin 7 to an Arduino pin and PWM it or whatever. Worth buying a few dozen if you're going to play around with LEDs...

fungus:

TanHadron:
I have a red, a green, and a blue LED that I need to light up brightly. Only one at a time, though. My project is run from batteries, and I would like the brightness to not diminish as the batteries lose voltage. I understand that is what a constant current circuit is for.

If I wanted to light up more than one I'd do it with one of these or (this - same thing).

That second URL takes you to eBay's categories page. Perhaps you meant this page instead?

The battery powered LED has key issue is power efficiency, the higher efficiency the longer battery last. Your battery type (voltage, Ah) and LED w ( current, A) as well as dimmable will determine the LED drive IC.

Thanks for the responses, guys. I also found an LED driver from Mouser that looks pretty easy. I'm not sure it will work--all the sample schematics show multiple LEDs hooked up in series and I only have one at a time. Especially the red one that runs at 2.0 volts.

I guess I'll buy a few and hook one up and see how it goes.

TanHadron:
I'm not sure it will work--all the sample schematics show multiple LEDs hooked up in series and I only have one at a time. Especially the red one that runs at 2.0 volts.

Page 4 of the datasheet, under 'Single LED string':

The number of the LEDs can vary from one to an unlimited number. T

Very good. I'm sure the thing has no idea how many LEDs I have hooked up in series. The question is if it can handle voltages that low.

Figure one, the graph that shows current regulation vs anode-cathode voltage, probably tells the important number here. If only I could blow up that graph and see where the 2.0 volt mark hits. I'm not so sure it will be in the 20 mA area. I think it will be OK with the green and blue LEDs at 3.2 volts, but the red one might be a little bit low.

Red LED's typically require 20 mA @ 1.8 - 2V.. So 2V might be just right.

Doc

Well, the NSI45020AT1G doesn't work for what I need. Neither does the LM317.

If I use 8 volts supply, it works great. But if I only use 5 volts, my blue and green LEDs don't get full 20 mA. If I use 3.7 volts, none of my LEDs gets the right current. I need this to work down to at least 4.0 volts. 3.7 would be even better.

Bummer.

right,our battery type (voltage, Ah) and LED w ( current, A) as well as dimmable will determine the LED drive IC.

TanHadron:
Well, the NSI45020AT1G doesn't work for what I need.

If I use 8 volts supply, it works great. But if I only use 5 volts, my blue and green LEDs don't get full 20 mA. If I use 3.7 volts, none of my LEDs gets the right current. I need this to work down to at least 4.0 volts. 3.7 would be even better.

Datasheet says it needs 1.8V overhead to work so a 3.6V LED needs a 5.6V power supply.

TanHadron:
Neither does the LM317.

Same problem.