Is there a way to make these tricolour LEDs not hog all the current? - Page 1
Forum section: electronics / beginners

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 16, 2017, 09:32:28 pm
content: 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

author: Benta
author_rank: Super Contributor
timestamp: March 16, 2017, 09:36:39 pm
content: You need a resistor on each cathode. I hope the part is still OK.

author: Avacee
author_rank: Unknown
timestamp: March 16, 2017, 09:42:18 pm
content: 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/TLC5940http://howtomechatronics.com/tutorials/arduino/how-to-extend-arduino-pwm-outputs-tlc5940-tutorial/http://tronixstuff.com/2013/10/21/tutorial-arduino-tlc5940-led-driver-ic/

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: March 16, 2017, 09:58:25 pm
content: Quote from: Benta on March 16, 2017, 09:36:39 pmOr multiplex them one colour at a time

author: sahko123
author_rank: Frequent Contributor
timestamp: March 16, 2017, 10:00:04 pm
content: You also may PWM the LEDs and strobe them at the same time minimising the current consumption

author: danadak
author_rank: Super Contributor
timestamp: March 16, 2017, 10:51:58 pm
content: Use of individual r's is an adequate solution, but if you want realcontrol drive each LED with a current source. You will have muchbetter control over temp and device to device variation due toVled threshold.Regards, Dana.

author: Audioguru
author_rank: Super Contributor
timestamp: March 17, 2017, 12:08:56 am
content: 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.

author: Brumby
author_rank: Unknown
timestamp: March 17, 2017, 03:24:33 am
content: Quote from: raspberrypi on March 16, 2017, 09:32:28 pmA very big YES.Do this:Quote from: Benta on March 16, 2017, 09:36:39 pmThis 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:Quote from: Audioguru on March 17, 2017, 12:08:56 amUsing 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.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 17, 2017, 04:18:42 am
content: 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 Vfwdfor 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 pinAnd 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 LEDSo 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".

author: Avacee
author_rank: Unknown
timestamp: March 17, 2017, 09:36:29 am
content: 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/MultiplexingIn 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_visionHowever 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)

author: tooki
author_rank: Super Contributor
timestamp: March 17, 2017, 09:42:51 am
content: 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).