0
\$\begingroup\$

I am trying to operate a lot of RGB LEDs for a project. I came up with a crazy scheme which only works if the RGBs work exactly as three separate LEDs.

What I want to do is connect the R, G and B lines of all the LEDs with the same source of PWM and connect their grounds to separate pins(which have tri state logic). So when I want to turn on a pin I will give the PWM for the color on the PWM line and drive its ground pin low and ground pins of other RGBs to high impedance (theoretically separating them from the circuit). Will such a circuit work?

\$\endgroup\$
3
\$\begingroup\$

Yes, but they are not full separated LED's, as @Joby Taffey stated they share a common anode or common cathode. In order to use the circuit you said, you'll probably need to get one common anode one and connect the CA pin with the PWM output. The other 3 pins (cathode for R, G and B) will be switched with an transistor for example.

You could use an common cathode, but in this case, with an PWM duty cycle of 100% (turned one) the corresponding led would be turned off.

One problem I'd see is the refresh rate. You can't turn on the 3 leds at once because you want to control each color individually. The solution is multiplexing. You should use an enough high PWM frequency and enough low multiplexing frequency, so the multiplexing will not interfere with the color intensity while trying to avoid flicker with multiplexing.

And keep in mind that the output luminance will be only one third of the tri-led maximum.

\$\endgroup\$
2
\$\begingroup\$

Yes, RGB leds are usually 3 coloured LEDs in a single package with 4 wires. Sometimes they're common anode, sometimes common cathode.

\$\endgroup\$
  • \$\begingroup\$ I have clones of these sparkfun.com/products/105, so I think as the tri-state logic is used in Charlie plexing,so it will work. \$\endgroup\$ – Rick_2047 Mar 14 '11 at 14:56
  • 1
    \$\begingroup\$ There are also rgb leds with no common anode and no common cathode. They actually have six connectors. 3 single anode + the 3 RGB contacts. i have them lying around my house, since i wrongly ordered them instead of common anode :) \$\endgroup\$ – 1amtoo1337 Mar 14 '11 at 15:19
1
\$\begingroup\$

RGB leds are common anode of common cathode as Joby has stated. your way will work but will take up 4 pins (R, G, B, PWM) depending on if your pins can sink/source the current. I would use the below example depending on your specific RGB led, and drive each led line with PWM.

Common Cathode example RGB pwm schematic

As a side note, you could hook up the example below and drive Vcc with PWM and drive each pin high or low to turn on and off colors

\$\endgroup\$
  • \$\begingroup\$ What software did you use to make this schematic? I couldn't get it to work in eagle. \$\endgroup\$ – Rick_2047 Mar 14 '11 at 16:22
  • \$\begingroup\$ I didnt make the pic, Someone offered to replace one of my olds ones from my blog and this was the replacement. It was created with CAD software and the one that you see is a PNG. \$\endgroup\$ – jsolarski Mar 14 '11 at 16:54
  • 1
    \$\begingroup\$ your single resistor combination above will give differing levels of brightness when more than 1 LED is on - use 3 resistors? \$\endgroup\$ – BullBoyShoes Mar 15 '11 at 13:01
  • \$\begingroup\$ to even out the brightness you would use 3 on the anode side, but use a potentiometer to find the best value for each line. Or just correct it in the pwm signal \$\endgroup\$ – jsolarski Mar 15 '11 at 13:20

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.