I'm trying to use build a constant current Led driver, using two BJTs (BC338 and BC547). The idea is to be controlled by Arduino's PWM, for dimming. I'm using the circuit bellow.
The led is a white one, 10.5 mm, 3.3V/30mA. I'm using an Android charger (5V) as PSU. From what I read, the led whould be On when the "control" is connected to VCC, and Off when "control" is connected to GND. But what is happening is the opposite: the led lights full On whenever control is connected to GND (and it glows a little if I touch R1 with my finger) and shuts Off when control is connected to VCC.
I calculated R2 as:
R2 = 0.7/0.03 = 22, where 0.7 is Q2 Vbe and 0.03 is Iled.
If I get this working correctly, I'm planing to replace qthe led with a 1W version (3.3V/300 mA), replacing the R2 for a 2.2 ohms piece.