Arduino auto-power off.

Hello, first I'm not sure if this is the proper group for this question.

I'm testing an auto-power off feature using a Uno 3 in combination with a 18650 battery and a charger/booster module (based on a TCA4056).

First I tested how long a single 18650 battery could keep the UNO with a 8 digit 7-segment LED display alive. The test sketch was counting seconds. The battery could keep the UNO alive for more than on day. The charger/booster cut the power to the UNO when the battery voltage got too low.

But when power has been cut, the voltage on the battery increased turning the controller on again and kept it alive for a few seconds. This continued over night. This ruined the battery (it does not hold charge anymore).

So then I added an auto-power off feature. It worked fine until I added a sensor pin from A0 to the battery so that the controller can monitor the charging and turn itself off if the voltage on the battery get too low.

That did not work very well until I added the R6. It seems like the UNO was powered directly from the battery through A0.

Is that possible?

(NOTE: The VR1 and R1 has been added for testing - so that I can simulate a lower battery voltage).

Absolutely.
This is called 'phantom powering' or 'back feeding'.
It happens when you turn off arduino power with
any wires connected to any input that have voltage
on them. This known to everyone with any experience with arduinos. It occurs because all the inputs have protection diodes from the input pin to
the 5V power rail. If you know how a diode works then you know that if you have 5V on the anode
that means you have 5V-0.7V on the cathode.

Thanks. It confirm what I thought was happening.

If you look at the datasheet for the microcontroller (and almost every CMOS chip) you'll find that the
absolute maximum voltage to any input pin must be within something like -0.3V to Vcc+0.3V at all times...

This is simply saying that the anti-static protection diodes will conduct if this restriction is ignored, and
they (being tiny and designed for very small currents) can be easily fried.

I'd change that R6 10k value to more like 100k to 1M with 10nF to ground on A0 to stiffen up the impedance.
10k will still discharge a battery over a timescale of weeks.

Do you not have the same problem with D8 in your circuit? What does D8 do?

D8 detect if the 220 V PWM is on (or if we run on the battery). When it is ON the UNO is always on so this cause no problem.

Does anyone know that the input impedance is on the IO pins?

ShermanP:
Do you not have the same problem with D8 in your circuit? What does D8 do?

I can't see a "D8". Where is it?

IRF4905 is the wrong component. It is not a logic-level FET.

D8 or pin 4 on the screw connector J1.

It might be wrong to use the IRF4905. Suggestion for a better FET to use?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.