Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: TanHadron on Jun 17, 2013, 08:09 am

Title: Controlling 3 LEDs with one constant current circuit
Post by: TanHadron on Jun 17, 2013, 08:09 am
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?
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: KirAsh4 on Jun 17, 2013, 08:12 am
If you choose to use a WS2801, read its datasheet as it explains how to create a constant current setup.
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: fungus on Jun 17, 2013, 12:56 pm

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!)


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 (http://www.ebay.com/sch/i.html?_nkw=an6884) or (this - same thing (http://www.ebay.com/sch/i.html?ka2284)). 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...


Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: KirAsh4 on Jun 17, 2013, 06:07 pm


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 (http://www.ebay.com/sch/i.html?_nkw=an6884) or (this - same thing (http://www.ebay.com/sch/i.html?ka2284)).


That second URL takes you to eBay's categories page.  Perhaps you meant this page instead (http://www.ebay.com/sch/i.html?_nkw=ka2284)?
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: sonnyyu on Jun 17, 2013, 07:18 pm
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.
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: TanHadron on Jun 17, 2013, 08:31 pm
Thanks for the responses, guys.  I also found an LED driver from Mouser (http://www.mouser.com/Search/ProductDetail.aspx?R=NSI45020AT1Gvirtualkey58410000virtualkey863-NSI45020AT1G) 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.
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: KirAsh4 on Jun 17, 2013, 09:19 pm

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':
Quote
The number of the LEDs can vary from one to an unlimited number. T
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: TanHadron on Jun 17, 2013, 10:44 pm
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.
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: Docedison on Jun 17, 2013, 10:49 pm
Red LED's typically require 20 mA @ 1.8 - 2V.. So 2V might be just right.

Doc
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: TanHadron on Jun 22, 2013, 03:19 am
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.
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: foxdown on Jun 22, 2013, 02:37 pm
right,our battery type (voltage, Ah) and LED w ( current, A) as well as dimmable will determine the LED drive IC.(http://to.ly/lJNz)
Title: Re: Controlling 3 LEDs with one constant current circuit
Post by: fungus on Jun 23, 2013, 09:16 am

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.


Neither does the LM317.


Same problem.