I'm attempting to design a battery-saving circuit for a microcontroller/computer. I plan to hook the circuit up to a raspberry PI and have it cut the power completely once it is fully shut-down.
The circuit and PI will be running off of a battery pack (or power bank) where it could be shut down for long periods of 2+ weeks.
The device should essentially function as a low-current cutoff switch (read current not voltage), and be externally trigger-able (say, 5v from timer circuit wired up to it).
Note: This question is similar, but it is a bit different from Simplest latching circuit with press-ON hold-OFF button that can cut power when Raspberry Pi halts. The switch will power off the controller when long press (possible unwanted behavior). Correct behavior would be to allow the system to go through the power-down routine however long that takes, and only cut the power once it is below the threshold
It world be extremely helpful to have a trimpot to adjust the cutoff current from about 30-100 mA.
the state diagram is as follows:
|High Current||Gate remains closed (allow power)|
|Trigger & Open||Gate closes (allow power)|
|Low Current||Gate opens(deny power)|
|Trigger & Closed||Send polite shutdown request|
What kind of circuit could I build to get this kind of functionality?