Simple low voltage disconnect circuit for Arduino
Your design requires pin A5 to be at the same voltage as the battery in order to shut off the system. The problem is that when you remove power from the Arduino, pin A5 can no longer remain high &mdash; there are internal protection diodes that force its voltage to be no higher than V+ plus the diode drop (about 0.7V).

The simplest solution is to add a second transistor (NPN) that inverts the logic of pin A5 &mdash; when A5 is high the system is on, and you drive A5 low to shut it off. This shuts off both transistors and the quiescent current should be zero.

Also, you should consider using a P-channel MOSFET instead of your PNP BJT. It will be more efficient: less voltage drop to the Arduino when on, and no wasted current through the gate terminal.







simulate this circuit &ndash; Schematic created using CircuitLab

I've used an N-channel FET instead of an NPN transistor. The Arduino can drive it directly, and the only "wasted" current is the 30 &micro;A or so that flows through R1 when the system is powered up.