I am having problem getting this red and green led to switch on in its yellow color state. Red + green = yellow!! But it simply refused to do so. It's more like an annoyance than a real big deal problem to me, but It's also pretty interest if I can still able to fix it using software, which I am not sure if I could.

Here is the LED: (red 2v, green 3v) enter image description here

Here is how it looks like. The green colored leds should be turning yellow, and when I stare close enough, I can actually see the red led being turned on, but not bright enough. Normally, one would assume that the red led will be brighter than the green led because red is lower voltage, but strangely, it's the opposite.

enter image description here

Here is the circuit!! It's huge, please open it in a new tab and zoom in to see the detail. Basically the left part of the led is the red led. enter image description here

Here is the code that I use to run the leds. It's nothing fancy, just a simple old multiplexing.

    PORTC &=~(1<<0);
    PORTD= ~(led[counter]);   

  if(counter>0 && counter<8){
    PORTB =0;  
    PORTD= ~(led[counter]);     

    PORTB =0;
  PORTD= ~(led[counter]);       
    PORTC |=1<<0;

   if(counter>8) {
   for( byte i=0; i<9; i++){

So, to make it clear, Q1, why no yellow? Q2, is it fixable using software? Q3, if so how? Q4, in case it's not fixable by software, what do I need to fix it in hardware. adding 12 resistors to red leds?

Update: Here I try to toggle the first dual led on and off, the last photo showing them switching on/off very fast, and clearly, it's not yellow. enter image description here

  • \$\begingroup\$ Are LED1 through LED60 your tri-color LED's? The LED's symbols are for conventional LEDs. \$\endgroup\$ – Michael Gorsich May 21 '18 at 9:59
  • \$\begingroup\$ @Michael Gorsich They are not. total 60 led, only 12 of those leds are dual color leds, from led 1, 6, 11, 16 and etc. The rest are normal red leds. \$\endgroup\$ – Atmega 328 May 21 '18 at 10:04
  • \$\begingroup\$ What R and G duty cycle are you using? What's the brigtness of R and G at some given current in the datasheet? \$\endgroup\$ – winny May 21 '18 at 10:12
  • \$\begingroup\$ I am used to seeing tri-color LEDs that bring only two pins to the outside and you switch polarity for color change. It looks like these LEDs bring all four pins out, so can't you just wire the green and red LEDs in parallel to get yellow? \$\endgroup\$ – Michael Gorsich May 21 '18 at 10:12
  • \$\begingroup\$ @winny red300MCD, green700MCD; red 620NM green520NM; same 10MA current; They are being switched on/off with the same speed. \$\endgroup\$ – Atmega 328 May 21 '18 at 10:24

Closely related to this Q&A.

Our eyes are more sensitive to green; if the LEDs are equally efficient, you need about twice the current in Red in order for them to appear equally bright, which will presumably generate a good yellow.

A first step will be to experiment with a single LED and two current sources (or variable resistors or two PWM channels on your MCU) to find what relative currents or ON periods give the colour you want.

A second step would be to generate that current ratio somehow; perhaps with a larger resistor in series with Green and a smaller one with Red. Or connect the LEDs in antiphase and drive them one way round for green, another for red, adjustable in software. Or some other means according to the hardware or software changes yo uare willing to make.

  • \$\begingroup\$ Brian, I'm thinking the dimmer reds are due to a 1/8 duty cycle as compared to the three-color LEDs. \$\endgroup\$ – Michael Gorsich May 21 '18 at 10:51
  • \$\begingroup\$ The mCd-rating already takes this into account. Or did he add the information after your post perhaps? \$\endgroup\$ – winny May 21 '18 at 11:32
  • 1
    \$\begingroup\$ ah I see it now in the comments. \$\endgroup\$ – Brian Drummond May 21 '18 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.