Raspberry Pi reset circuit
Is your charging circuit wired this way? With the PI ADC monitoring the battery voltage at the red circle?





simulate this circuit &ndash; Schematic created using CircuitLab
When the PI is powered (CONTROL pin is high) &amp; 5V mains is powered; 3V3 supply is still available. The Reset pin will pull high to 3V3 via 10k ohm; Q1 is close and Q3 is open.
When the PI is powered (CONTROL pin is high) &amp; 5V supply is gone; 3V3 supply is still available. The Reset pin will pull high to 3V3 via 10k ohm; both Q1 and Q3 is open.
When the PI is powered (CONTROL pin is high) &amp; 5V supply is gone and return back; 3V3 supply is still available. The Reset pin will pull high to 3V3 via 10k ohm; Q1 is close and Q3 is open.
When the PI is shut down (CONTROL pin is input / float) &amp; 5V supply is gone and return back; 3V3 supply is still available. The Reset pin will go low then high again; Q1 is close and Q3 is close momentarily then high. To change the timing of the toggle, adjust C1 cap.
Note: Please test out circuit on breadboard. Also do test the condition when you don't have Mains and your battery is totally flat.