Get a bicolour LED to 'be' both colours at once?

Hey guys!

I have some bicolour LEDs (3 pin, common cathode).

I currently have a simple circuit set up - with pin 2 and pin 3 supplying an output to both anodes of the LED and then GND hooked up to the anode.

One colour is dominant (as in, if I power both at once, then the other one doesn't even light up).

I wondered if it is something to do with GND so I swaped the cathode over to another pin and set that as OUTPUT LOW but the same thing occurs.

I thought you should be able to light both colours at once on a bicolour LED? Or do I need to alternate between the two at a high frequency instead? I have done it by alternating quickly but if I can just power both at once .. that would be much easier.

These are the LEDs I have: Bicolor 3mm Blue & Yellow LED Specs, Data Sheet N300TBY2D from lc-led.com

This is my code: (although I'm pretty sure this is an electronic question!)

void setup() {
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT); 
}

void loop() {
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, LOW);   //The 'test' ground
}

I'm a newbie when it comes to this electronics stuff so, thanks in advance!

edit: could it possibly be that the dominant colour is just much brighter so I can't physically see the other one?

Do you have a current limit resistor on each anode? You're gonna damage the IO pins if you don't.
Connect the common cathode to Gnd, not to an IO pin. Limit the current on the 2 anode pins to 20mA.
(5V - Vf)/.02A = resistor value

could it possibly be that the dominant colour is just much brighter so I can't physically see the other one?

Yes. You need resistors to limit the current (therefore brightness) through the LED.

I have current limiting resisitors on both, yes! And I have the common cathode plugged into ground! (GND pin, rather than an IO pin).

If I set it to alternate using the bit of code below, I can a visible mix:

void setup() {
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  digitalWrite(2, HIGH);
  digitalWrite(3, LOW);
}

void loop() { 
  digitalWrite(2, !digitalRead(2));
  digitalWrite(3, !digitalRead(3));
}

I'm starting to wonder if maybe they are both on .. however the dominant colour is just so much brighter that I can't physically see the other one when they're both on 100% of the time. Alternating reduces both to 50% so maybe it allows the 'weaker' colour to visibly shine through? In which case, theres nothing to actually solve!

Could just be a matter of adjustment.

If you are using the same resistor value, try making the brighter LED a higher resistance to limit the current. The same resistance will result in different brightness for the same current because the LEDs are different materials (to get the colour).

I have been using different resistors for both lights. Using the values from the datasheet (Bicolor 3mm Blue & Yellow LED Specs, Data Sheet N300TBY2D from lc-led.com) the blue light has a forward voltage of 3.8V and the yellow 2.3V.

The arduino output is 5V/20mA. So the resistor values I need are R=( V(supply)- V(forward) ) / I.

So for blue I get (5-3.8/20mA) = 60 Ohms and yellow is 135 Ohms. Is that correct? They seem quite low.

I'm actually going to be using one of these chips to drive the LEDs in the final thing (https://www.adafruit.com/datasheets/tlc5947.pdf) which looks like it has different output values in which case those resistor values will definitely be wrong. However the description of this chip says that you do not need to use current limiting resistors due to an inbuilt one..

"Outputs from these boards are constant-current and open drain. You can drive multiple LEDs in series. One resistor is used to set the current for each of the outputs, the constant current means that the LED brightness doesn't vary if the power supply dips."

So maybe I should add an extra resistor to the brighter colour and leave the other one connected directly to the chip?

The arduino output is 5V/20mA

It doesn't have to me 20mA. I think the spec is up to 20mA. It would be better to look at the brightness output curve for the LED and pick comparable points for both colors, then look up the current for that brightness, then work out the resistance you need for that current.

More to the point, use the maximum current as defining a minimum resistance and just work upward with resistor values on the brighter one until it looks right.

This is not something you do by theory and calculation.

Have you been tested for colour blindness? :slight_smile:

You will find that a blue LED stimulates your eyes very much more than yellow so I'd suggest you reduce the blue current to 2mA

If your driver IC has sink outputs how are you going to drive a common cathode LED?

aarg:
Have you been tested for colour blindness? :slight_smile:

I have, and I am a full-on deuteranope.

I usually determine the color of a multi-colored LED by the position and relative brightness of the emitters (blue usually looks unique, but red/amber/yellow/green/ are often indistinguishable).Because of this, color-based annunciators should not be too bright - just less than squinting when the size is that of an outstretched hand at arm's length.

Better yet - use yellow/green/blue LEDs instead of red/yellow/green.

Just use separate LEDS to cater for those that are colour blind :wink: I have a colleague who is (partial ?) colour blind. He can't e.g. see the difference between red and green and therefore hates equipment with one LED displaying two different colours to indicate a status.

The scientific name for people who can't tell the difference between red and green is cyclist.

Grumpy_Mike:
The scientific name for people who can't tell the difference between red and green is cyclist.

That is at your side of the world; here they are called taxi drivers :smiley: They also think that the emergency lanes were specially made for them (and there is more).

If the LEDs will be driven with tlc5490 eventually, there will be 4096 levels of PWM brightness control for mixing colors.
You could play with 255 levels for now by using
analogWrite (pinX, value);
with pinX being pins 3,5,6,9,10, or 11 and
value from 0 to 255. 0 = full off, 255 = full on

Grumpy_Mike:
The scientific name for people who can't tell the difference between red and green is cyclist.

How true!!