RGB Led with common cathode

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys.
I'm a newbie with the electronics stuff here and want to do the RGB Led projects with Atmega88, but i have problems how to choose the right resistors for my projects. I will use 4 RGB leds which has the common cathode and connect it with the PNP transistors. The datasheet from the LED shows:

2 x Blue - 4.5V
1 x Red - 2.5V
1 x Green - 2.5V
Current - 20mA

NPN transistor- BC639?
PNP transistor-which one?
So the total current (Ic) that flows will be 80mA for red and green and 160mA for blue right?

Pls guide me to build this project.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The pnp transistor is probably the 2n3906. The currents you listed will be the maximum provided you have the proper current limiting resistors (about 225ohm/B and 325 for R/G if using a 9V source) in place. If using pwm which I would suspect, then the actual current will be less dependent on the color being rendered.

The Mega88 only has 6 pwm channels so that would only provide direct support for 2 leds. It may be easier to just do the pwm in software using 12 i/o pins.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply. I will put the 4 leds just in parallel since it is easier for me to do. So 3 PWM channels are enough for me. The main problems for me are the base resistors for transistors.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you google a search for calculate base transistor you should get some helpful tutorials on how to come up with the values. As just a general rule you can usually get by with 1/10 base current when used for switching.

As a rough example, if your circuit uses 20ma/10 = 2ma base
(9v - ~.6vbe)(8.4) / .002 = 4200 ohms