I spent the last few days working on the best way to handle proper startup and shutdown of the PI. Because this is a battery powered device, I want to ensure a safe shutdown when the battery is low and not corrupt the SD card. At first I was looking at a complicated soft start circuit with a timer and a latch, but then realized a simple slide switch is all I need. When you slide the switch to ON, the power supply will enable and boot the PI. Once the PI is up, one of the GPIO pins will go high and hold that unit on. When the switch is flipped to off or the battery goes low, a routine runs on the PI to do a safe shutdown and then the supply will naturally disable once the PI is off.
Yes, there is still a chance that if the switch if flipped to off during boot it will hard power off the device and corruption could still occur, but that’s a chance I’m going to take.