You still have the problem that if the main supply dips the Pi will brownout.'ere 'tis:
car psu B_schem.jpg
OK, an opto and a couple of transistor too.
Acc comes on energise the first relay which powers the Pi and feeds a GPIO through an optocoupler. Pi sets GPIO high which activates the second relay.
Second relay keeps power to the Pi even whn not present on the first.
Pi monitors the opto. When it indicates Acc has been gone for more than, say, a minute it triggesr a safe shutdown which cuts power to teh second relay thus cutting power to the Pi.
Statistics: Posted by ame — Sun Sep 08, 2024 11:20 pm