PWM Controling Various LED's

This is my ciruit of my project:
LED3_RED 56 Ohms
|-------(<)------------////------------ +5V
| LED2_RED 56 Ohms
|-------(<)------------////------------ +5V
| LED1_RED 56 Ohms
|-------(<)------------////------------ +5V
10kOhms |
Pin 9 (PWM) |¯||¯||¯||¯|_ ----///-----/ transistor BC549
> Emiter
|
|
|
|
GND

LED3_GREEN 56 Ohms
|-------(<)------------////------------ +5V
| LED2_GREEN 56 Ohms
|-------(<)------------////------------ +5V
| LED1_GREEN 56 Ohms
|-------(<)------------////------------ +5V
10kOhms |
Pin 10 (PWM) |¯||¯||¯||¯|_ ----///-----/ transistor BC549
> Emiter
|
|
|
|
GND

LED3_BLUE 56 Ohms
|-------(<)------------////------------ +5V
| LED2_BLUE 56 Ohms
|-------(<)------------////------------ +5V
| LED1_BLUE 56 Ohms
|-------(<)------------////------------ +5V
10kOhms |
Pin 11 (PWM) |¯||¯||¯||¯|_ ----///-----/ transistor BC549
> Emiter
|
|
|
|
GND
BC549 datasheet says… VCEsat (Coletor-Emiter Voltage in Saturation) is 0.2V with IC=100mA…
(5V - 0,2(VCEsat) - 3,3 (LED)) / 56Ohms =~ 27mA per LED

It’s working, but i wanna a second opnion about this circuit.

I have only one problem… When I write

turnOffPWM(TIMER1A)  //Pin9
turnOffPWM(TIMER1B) //Pin10
turnOffPWM(TIMER2A) //Pin11

to turn off Timers, but only working to TIMER2A (pin11). If I disconect transistor for RED, GREEN and BLUE turn off… Maybe same problem with polarization of transistors?
If I write:

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);

All colors is switched off…

Hi wizarcl,

Those 10K base resistors seem high to me. How did you work them out?

Why do you want to turn the pwm timers off, what is wrong with using analogWrite (x, 0)?

Paul

PaulRB:
Hi wizarcl,

Those 10K base resistors seem high to me. How did you work them out?

Sorry, I'm using 1K resistor and not 10K..

Why do you want to turn the pwm timers off, what is wrong with using analogWrite (x, 0)?

Paul

No problem with analogWrite(x,0), but, I would like to know why does not work. Theoretically it should.
I replace BC459 by TIP120 (more current limit, because, limit of BC is 200mA) and the problem with turnOffPWM isn't solved... I will try to measure Arduino PWM Outputs...