Don't you think you need a current limiting for the PWM...I don't know how fast it is... but you better place a 220Ω resistor tothat transistor base... or else... you will smell your micro burning..... let the transistor fry.....

Logged

For whom the interrupts toll...

P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

If your mcu can only handle 40ma and you keep the LEDs parallel then you need the transistor because it would be 30ma x 2 now if you put them in series and put an appropriate resistor in you should be able to do it without the transistor.

If your mcu can only handle 40ma and you keep the LEDs parallel then you need the transistor because it would be 30ma x 2 now if you put them in series and put an appropriate resistor in you should be able to do it without the transistor.[/quotein series would mean that one would be brighter than the other , because of the voltage drop after the 1st LED!

If they are the same they should have the same voltage drop across each and be of the same brightness. Even being parallel doesn't guarantee they will be the exact same brightness due to slight variations in the resistors and in the LEDs themselves. In fact unless you use high precision resistors or variable resistors i would guess they would be closer to the same brightness in series.

I just say that you need a current limiting at the transistor base....And if you want to avoid two resistor just connect the two grounds of the LEDs together and then use resistor...I don't know about heat up.... doing that I guess you need a 1/2W resistor....you can also do the same with the anode... like this....transistor --> resistor ---> LEDs ---> ground....That's the more normal thing to do....

I don't really understand why you get drawn in a spoon's water.... really...It's simple....

How many Watts your LED are? What is the maximum allowable current through the LEDs?W = VI where W are Watts, V is volts, I is current....You have a let's say 30mW LED with a 5V supply right? then you get the amps from the equation above!!!Then... Ohm Law!!!! R = V / I.... you have I and you have V.... So you get the resistor needed!!! Simple!!!If you have two LEDs then by the second Kirchhoff's law about current splitting, you get thatif one LED is 30mW then two same LEDs are 60mW!!! and calculate the resistor again.... which should be the half...You don't have to worry, about burning your LEDs cause you can possibly imagine that their resistance is almost the same...Thus equal currents should go through them...

EEehhhh..... I hope this helped you....

Regards, LefterisGreece

Logged

For whom the interrupts toll...

P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

assuming the LEDs were all the same , they would all have the same brightness?What about the diode voltage drops ?

Well if they were all the same they would have the same resistance hence the same voltage drop and since they are in series they would all have the same amount of current going through them so they would each be using the same amount of power which would mean they should all be the same brightness.