I am using the auto off circuit as shown on the attachment. I came up with this, and it seems to work fine, but I am wondering what others use to achieve auto off, and whether there are problems with this one that I haven't considered. The circuit gives an ON, an AUTO OFF (uC controlled), and an OFF, depending upon the position of the switch.
A few points about it:
-The switch is a 3 position DPDT type that connects pins 1-2 or 3-2, if the switch is centered there are no connections.
-The auto off position is when the switch is centered. When the uC takes POWER GATE low, the voltage on the gate Q1 goes low, causing Q2 to turn off.
-The off page POWER GATE comes from an output on the uC. As soon as power is applied, the uC pulls it high.
-D7 makes sure that the uC is isolated from the input voltage. The pin on the uC is pulled high, so when it goes low, the gate of Q1 goes low.
-When the switch is in the 1-2 position, the voltage on the gate of Q1 is not zero, but its lower than the Vgs of Q1 and Q1 turns off.
-The off page VSENSE goes to an ADC pin for low voltage sensing.
-Q2 is a PFET with an Rds(ON) of 30 milli-ohms.
-The purpose of R9 is to pull the input rail down faster when the PFET turns off.
-The peak current through Q2 is less than 200 mA. It averages about 120mA.
-The diode D8 is to protect against the user inadvertently reversing the polarity of the battery connection. I am not sure if it necessary considering the internal diode in Q2.
Appreciate any comments.