Why does a bipolar transistor not work, but a MOSFET does

I'm not convinced that this is the most elegant circuit / method to achieve what you want (switching on/off your Arduino). More on that below.

But anyway, my guess is that the main difference between the circuits is that the NPN transistor needs a (small) base current in order to conduct. That base current can only flow when C1 (22 nF) is being charged. As C1 has a very small value, charging it takes only an instant, then there's no more base current, Q1 switches off, the Arduino stops as it has no supply voltage.

The MOSFET doesn't need a current, it just needs a voltage. The gate of a MOSFET is isolated so no current can flow. The only way that C1 can charge is through the leakage current of D1. Wow, that's scary, relying on a diode's leakage current! No experienced circuit designer would do that willingly.

All-in-all your circuit creeps me out, I would never do this like that. What would I do then? First of all, letting some circuit switch on/off its own power supply is always a bit scary and actually not needed. I have made a project where an Arduino runs on 2 AA batteries in series and is continuously connected to the battery. Those AA batteries last for more than a year.

For this I removed the voltage-regulator chip on the Arduino board (leaving it in place and using the 3.3 V supply pin might also work) then I programmed the Arduino such that it goes into sleep mode most of the time. In sleep mode it consumes very little power.

I suggest that you find similar battery powered Arduino projects and see how they do that, then just do the same.


The transistor requires that the base have a higher voltage than the emitter to turn on. However, when the power from the button goes away, you can see that the only voltage that is applied to the base .. comes from the emitter! (through the Arduino and its diode, but still: that just guarantees that the base voltage is lower than the emitter voltage).

Bipolar transistors require a continous flow of current. As soon as they are deprived of current through the base, they turn off.

In the MOSFET case, the transistor is being held on by its own capacitance. There's actually no way it can be pulled low other than by leakage back through the diode. Current does not flow from the gate to either the drain or source.

The transistor approach could probably be made to work by changing it to a PMOS which requires being held low to turn on.

Edit: Falstad simulation with the Arduino replaced by a wire, which shows it initially turning on (pulse through C1) then very slowly turning off as leakage through the diode. Falstad doesn't simulate capacitor leakage, which may also be relevant.


The circuit below will do what you want.
Direct replacement with suitable MOSFETs would also work.
Component values are correct as shown but could be altered to optimise results.

Many other small bipolar transistors will do what you want, but the ones I have shown (especially the BC327-40) are better suited to the task than many. The "-40" suffix means it has a high current gain and the BC327 / BC337 have a higher current handling capacity and lower Vsat (minimum turn on Vce) than most other small bipolar transistors. Despite the less usual BC suffix they are widely available internationally.

The BC327-40 will handle 100's of mA and has a voltage drop of perhaps 0.3V.
A suitably low Rdson MOSFET will produce minimal voltage drop in the same role.

Positive input at D2 or D1 will start or hold the circuit on.
Q1 turning on turns on Q2.

If required, turn off delay could be added by adding a capacitor from Q1 base to ground. A MOSFET in this location will allow a far higher value of R1, making turn off delay longer for a given C1.

schematic

simulate this circuit – Schematic created using CircuitLab

Here is a MOSFET version.
R1 & R2 in the bipolar circuit are not needed.
R4 and C1 set a turn off time constant - about 0.1 second as shown - so turn off times is 0.1 to a few tenthos of a second depending on the FET (lower Vgsth = longer turn off time).
MAny MOSFETs could be used - I've left the standard circuitlab defaults in place but they have much larger current and voltage capabilities than need, larger Rdson than necessary and Vgsth is OK for 5V and not low enough for 3V3 operation.

schematic

simulate this circuit