How to explain the behavior of this circuit?

I have made a simple MOSFET driver and while testing it with a 9V supply, I noticed something unusual.
Here is the schematic for the original driver. The second picture shows how I modified it for (basic) testing.

When I was using the test setup, I noticed that whenever I connected the + terminal from a 9V battery to the + rail, the LED blinked momentarily. (It also seemed to blink again on disconnecting but I can’t be sure).

I tried the same thing after removing the diode D1… The LED blinked the first time I connected the battery, but not after that.
I can’t understand why this is happening…

The circuit is designed so that when the Arduino sends a signal HIGH, the MOSFET is OFF and when it sends LOW signal, the MOSFET turns ON.

EDIT: THere should be a 1k resistor in series with the LED

Test setup.jpg

It might have to do with time constants. Possibly the MOSFET is turning on just slightly faster than the NPN turns on to turn off the MOSFET.

You've got the circuit drawn up in LTSpice, why not do a transient simulation with various NPN transistors and MOSFET's and look at the LED current in each case. You may see a "spike" that explains the temporary blink.

-- The Aussie Shield: breakout all 28 pins to quick-connect terminals

I'm not very familiar with simulations in LTspice.. but I'll give it a try and post back if I find anything. Thanks for the quick reply.

There is no resistor in series with led, is it alive or you've seen its last "blink"?

SOrry.. The schematic should show a 1k resistor in series with the LED. I forgot to put it into the diagram.

Is R2 necessary? When Q1 is on, its collector takes the MOSFET gate to GND.

You're right.. I'll remove it.

.... but the LED still blinks.

I bet you can make it stop blinking if you replace the 1k/10k resistors with 10k/100k. Maybe....

My quick-and-dirty simulation suggests it's definitely possible due to the different time constants of the BJT and the MOSFET. Here is an LTSpice simulation schematic. The schematic and simulation waveform are attached. This is only a simulation, not a guaranteed reality, but the fact that 1mA of current went through the LED is interesting and a possible explanation.

-- The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

What type of M1 and Q1?

I ran my own simulation as well but by then you had already posted this… :wink:
I got similar results. I figured out how to import spice files (for 3rd party components) and used the file for the IRFZ44 MOSFET which I’m using in the circuit. I couldn’t find a spice file for the BJT that I use in the circuit.

My simulation is more rudimentary than yours…

And here is my spice file…
The main difference is that I have gotten a spike of 720uA. Your value seems more probable… Also, the duration of my pulse is much longer… 20uS.

I’ll try changing the resistors like you suggested…
Thanks for the help.

Setup.jpg

Frankly, none of the simulation results are going to be particularly trustworthy since a) they are just models, and b) there is large variation from device to device. I had to pick and choose a couple of different BJT's and MOSFET's to get a 1mA result -- most combinations were around 500uA.

Really the only reliable take-away message from these simulations is that you can turn a MOSFET on faster than a BJT (in this type of circuit) which can lead to a MOSFET being on for a very short period of time, against expectations. Actual current values or time durations: not so much.

The point of using larger resistors is to make the MOSFET take longer to turn on.

-- The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

I don’t get it.
I have used the circuit in the attachment. Very effective, nothing unexpected, on when on and off when off. Bit-banged PWM to vary the speed of a box fan.

fanspeeds1.JPG

Some differences between your circuit and the OP’s circuit:

  • You used a 22k resistor, which turns the MOSFET on slower
  • A fan may not display any motion in response to a very-short-duration 1mA burst, while an LED will flash visibly


The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins

! I tried my circuit with an LED. It turns on/off as it should. Fine.

But then, I guess mahela007's conundrum didn't fully register in my noggin: there's a brief flicker at power up. Are you meaning that 1.5-2sec at init when the Atmel/Arduino is firing up? As it is, the FET is pulled up - default on, till the NPN gets turned on, bringing the FET gate to Gnd. If that brief period is objectionable then the FET has to be pulled down, default off, waiting for +Vg (applied later).

** I added a 10K pullup to the Arduino pin. Now, when I hold the reset down the LED/FET is off and likewise when I switch the power off and back on. (The 4700Ω is still between the pin and the base.) OK? Note: If I turn off my bench supply and turn it back on then there is a brief flicker, but not if I interrupt/apply the V_DC full on. OK? **

very inteseting pic, but I don't know, sorry.

runaway_pancake: ! I tried my circuit with an LED. It turns on/off as it should. Fine.

But then, I guess mahela007's conundrum didn't fully register in my noggin: there's a brief flicker at power up. Are you meaning that 1.5-2sec at init when the Atmel/Arduino is firing up? As it is, the FET is pulled up - default on, till the NPN gets turned on, bringing the FET gate to Gnd. If that brief period is objectionable then the FET has to be pulled down, default off, waiting for +Vg (applied later).

** I added a 10K pullup to the Arduino pin. Now, when I hold the reset down the LED/FET is off and likewise when I switch the power off and back on. (The 4700? is still between the pin and the base.) OK? Note: If I turn off my bench supply and turn it back on then there is a brief flicker, but not if I interrupt/apply the V_DC full on. OK? **

No.. it had nothing to do with the arduino startup. What I'm referring to is the flicker you observed when you turned on your bench power supply. There doesn't seem to be any such effects when turning the MOSFET ON and OFF using the arduino signal. Since this occurs only at power up, I thought I'll just ignore it.. (hope it doesn't bite me in the backside later on.. ;) )