Author Topic: Is there a way to make these tricolour LEDs not hog all the current?  (Read 2622 times)

0 Members and 1 Guest are viewing this topic.

Offline raspberrypiTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 358
  • Country: us
I just bought these today but it seems red over rides the other colors when you try to hook them up in combination. Is that because I just have one resistor on the common anode? Here is the data sheet since I know you guys love data sheets.

https://cdn-shop.adafruit.com/datasheets/FLR-100WAS-RGB.pdf
I'm legally blind so sometimes I ask obvious questions, but its because I can't see well.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #1 on: March 16, 2017, 09:36:39 pm »
You need a resistor on each cathode. I hope the part is still OK.

 

Offline Avacee

  • Supporter
  • ****
  • Posts: 299
  • Country: gb
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #2 on: March 16, 2017, 09:42:18 pm »
As with the 7-segment display earlier each LED needs its own resistor - or not (see below :p).

Check the individual forward voltages of each LED - they will be different.
Tweak the individual resistors as desired to get a balance you are happy with ensuring you don't go over their max current.

The datasheet lists 2.0 / 3.2 / 3.2 (R/G/B) as typical Vforward and the recommended mA range as 10-20mA with absolute max of 20mA so stay well within this.

Edit: An excellent starter IC for fellow beginners for driving common anode LEDS is the TLC5940 - which is available quite cheaply. Other IC's are available but as a beginner there are a lot of articles on using this chip with arduino.
http://playground.arduino.cc/Learning/TLC5940
http://howtomechatronics.com/tutorials/arduino/how-to-extend-arduino-pwm-outputs-tlc5940-tutorial/
http://tronixstuff.com/2013/10/21/tutorial-arduino-tlc5940-led-driver-ic/
« Last Edit: March 17, 2017, 08:44:26 am by Avacee »
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13695
  • Country: gb
    • Mike's Electric Stuff
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #3 on: March 16, 2017, 09:58:25 pm »
You need a resistor on each cathode. I hope the part is still OK.
Or multiplex them one colour at a time
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline sahko123

  • Frequent Contributor
  • **
  • Posts: 318
  • Country: ie
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #4 on: March 16, 2017, 10:00:04 pm »
You also may PWM the LEDs and strobe them at the same time minimising the current consumption :-+
Asking for a friend
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #5 on: March 16, 2017, 10:51:58 pm »
Use of individual r's is an adequate solution, but if you want real
control drive each LED with a  current source. You will have much
better control over temp and device to device variation due to
Vled threshold.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #6 on: March 17, 2017, 12:08:56 am »
It is shown on the datasheet. The red hogs all the current because it is a lower voltage diode and conducts at about 2V. The green conducts at about 3.2V and the blue conducts at about 3.4V. They all light when they have their own resistor.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #7 on: March 17, 2017, 03:24:33 am »
I just bought these today but it seems red over rides the other colors when you try to hook them up in combination. Is that because I just have one resistor on the common anode?
A very big YES.

Do this:
You need a resistor on each cathode. I hope the part is still OK.

This is the simplest way to address the problem.  (Oh - and as long as the current through the red LED has not exceeded the maximum allowed, then the part will be fine.)

Here's why:
It is shown on the datasheet. The red hogs all the current because it is a lower voltage diode and conducts at about 2V. The green conducts at about 3.2V and the blue conducts at about 3.4V. They all light when they have their own resistor.

Using the water analogy, your LEDs are a bit like waterfalls.  The red ones are low in height, the green ones are much higher and the blue ones a bit higher again.  By having one resistor, you are basically feeding all 3 waterfalls from the same pond.  Once the water (voltage) gets high enough to pass over the red waterfall, that's where pretty much all the water goes.  The green and blue ones are just too high and look like walls and the only water passing these is, more or less, seepage.  By using one resistor for each LED, you are providing each waterfall with its own pond, so the ponds can be at different water levels and you get water flowing over each waterfall.


The other suggestions about multiplexing and constant current drivers are alternatives that require more circuitry and just a little more design effort than you might be capable of at this time.
« Last Edit: March 17, 2017, 03:37:42 am by Brumby »
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #8 on: March 17, 2017, 04:18:42 am »
Ok... let's say you are trying to use this tricolor common Anode LED with your Arduino.

So you check the Data Sheet and find the Vfwd for each color as follows: Red, 2v. Green, 3.2v. Blue, 3.4v. 

The basic circuit is going to be like this:

+5V > LED common Anode, each LED Cathode > each resistor > each Arduino pin

And you will want the Arduino pin to go LOW to turn the LED ON (5v is the Source and the Arduino pin is the Sink, so a HIGH pin (+5V) will result in no current flow and a LOW pin is like the pin is grounded, so current flows.).

And you want, say, 10mA current through each separate color of the LED.
 
So you use Ohm's Law to calculate the resistor value for each Cathode. R=V/I so

(Vsupply - VfwdLED)/0.010 = (5 - 2)/0.010 = 300 ohms for RED LED

(5-3.2)/0.010 = 180 ohms for GREEN LED

(5-3.4)/0.010 = 160 ohms for BLUE LED

So these are the three resistor values to start with, to give 10 mA through each color LED. But does this result in "equal brightness" as perceived by the eyeball? So you may need to adjust the values to give equal perceptual brightness.

Now, if you use three of the Arduino's PWM pins for the LEDs, you can use analogWrite() statements to control the LED brightnesses by PWM and code, as in the Examples>Basic>FADE example sketch in the Arduino IDE.  So you can essentially arrive at almost any final color from the 3-color LEDs in combination at different brightnesses. The UNO's PWM-capable pins are 3,5,6,9,10,11.


I put my 3-color LED inside a ping-pong ball, with its individual cathode resistors connected to PWM pins of the Arduino, and my sketch fades each LED at different rates, so the ping-pong ball fades through "all" colors. Makes a nice "mood light".
The easiest person to fool is yourself. -- Richard Feynman
 

Offline Avacee

  • Supporter
  • ****
  • Posts: 299
  • Country: gb
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #9 on: March 17, 2017, 09:36:29 am »
OP: The problem you'll find if you PWM with only a single resistor is that at times more than 1 LED can be on at the same time and you'll get the same problem as you posted.
E.G you want White so all 3 LEDS are on at the same time so red hogs all the current, as explained above.

Thus you would need to multiplex them. https://en.wikipedia.org/wiki/Multiplexing
In this case it means to only turn on red, then turn it off, then only turn on green, then turn it off, then only turn on blue, then turn it off, and back to red and repeat......
When this is done very quickly it looks to your eye as if all three are on at the same time. https://en.wikipedia.org/wiki/Persistence_of_vision
However to control the colour + brightness you have to work out how much time each red, green and blue gets to create the balance you want.

Whilst multiplexing through a single resistor is a valid and correct answer at your level I strongly recommend three individual resistors (see above for value calculations) and not having to worry about multiplexing - crawl (three resistors) before you walk (IC) before you run (multiplex)
« Last Edit: March 17, 2017, 09:45:11 am by Avacee »
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 11341
  • Country: ch
Re: Is there a way to make these tricolour LEDs not hog all the current?
« Reply #10 on: March 17, 2017, 09:42:51 am »
Just bear in mind that an arduino really can't multiplex and PWM at the same time nearly fast enough to eliminate flicker. Because of the "phantom array effect", you need a 2KHz PWM speed (not the 60Hz of moving images).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf