Electronic – arduino – BJT Constant Current LED Driver – Inverted behavior

arduinoconstant-currentled-driverpwm

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.

enter image description here

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.

Best Answer

The circuit diagram looks correct as drawn.

If you have a multimeter that provides a diode check function, remove transistor Q1 (BC338) and test in both directions (forward and reverse bias) the base-emitter diode and the base-collector diode (see Fig. 1). Ensure Q1's base-collector diode has not failed (short circuit failure mode).

Also remove transistor Q2 and use the multimeter's diode check function to test Q2's base-emitter and base-collector diodes.

enter image description here

Figure 1. Pinout for the BC338 and the BC547.

Related Topic