Electronic – arduino – Problem with arduino controlled constant current supply with MOSFET/NPN

arduinoconstant-currentled

I am building a lamp using 5 1-Watt LEDs, an 18V DC power supply and an Arduino for dimming/controlling it. Im using a simple design (below) for the constant current driver (as was used here for example). The MOSFET I have is not logic level (it's a FQP50N06) but it opens enough at 5V to pass the 350mA that feed the series of 5 LEDs.

This circuit works fine when the Arduino is On; my problem is when the MC is turned Off, and the PWM pin is (I guess) floating, the LEDs are still powered (though slightly dimmer). I am looking for a way to modify this circuit so that M1 shuts down when the MC is Off. (Assuming that the power supply V1 is still On.)

Any idea? thanks!

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

You should add a resistor (say 100K) from the left side of R1 to ground. That way it will not divide down your already too-low gate voltage.

If you are actually removing the supply voltage from the Arduino this will not work if you are breaking the ground connection. If you break the 5V connection the internal protection network on the ATMega chip will supply a few volts. Only break the +5V side, if you must break something.