After extensive research and finding very helpful circuits for the rest of the system I still have not found what im looking for. I am building a PoE raspberry pi weather station that will be mounted on a 30 meter tower so access is limited.
The challenge is as follows. The AC source is unreliable so I have a +-2 hour battery backup inside the weather station. The idea is to monitor the AC input, battery voltage, and Pi state ( Shutdown or not). When the AC is not avialable the Pi will run off the battery. when the battery nears depletion the circuit must send a signal to the PI which will run shutdown script.
When the AC supply is restored the "Run" pins on the Pi needs to be toggled to reboot the pi. the issue is the reset circuit cannot just reset the pi every time the AC comes back and falls away. becuase if the run command is given to the PI While still running on battery it has a good chance of corrupting the SD card. my current solution is a Arduino pro micro programmed to check all the conditions and only reset the PI when the Arduino it self sent the shutdown command.
Is there a way todo all of this with simple circuit ?