1
\$\begingroup\$

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:

State Response
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?

\$\endgroup\$
2
  • \$\begingroup\$ More background on your specific use case would be helpful. To reduce current draw you can just turn off devices that are drawing the current or stop using them -- and this should be easy if you have a microcontroller. Responding to a push button should also be easy with a microcontroller. \$\endgroup\$
    – ErikR
    Jun 7, 2021 at 18:04
  • \$\begingroup\$ "... read current not voltage ..." followed by "It world be extremely helpful to have a trimpot to adjust the cutoff voltage." I think some clarification might be in order. \$\endgroup\$
    – Transistor
    Jun 7, 2021 at 18:11

1 Answer 1

2
\$\begingroup\$

Use a circuit like this to measure current: enter image description here
https://circuits4you.com/2016/05/13/dc-current-measurement-arduino/

You can measure the current, feed it into the ADC of the micro and then use any manner of logic to shut down the processor.

Many voltage regulators can be purchased with enable lines, you could have the voltage regulator enabled by a push button switch to kick things off. The micro could hold the line high until it needs to go into shutdown. As shown in this question:

Latching power with LDO enable pin enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Can this be modified so the circuit doesn't use any GPIO on the micro? I'd like this to be a self-contained system, although great initial answer. \$\endgroup\$ Jun 7, 2021 at 20:30
  • \$\begingroup\$ Yeah, just use a comparator with a pot where it says 'out' in the first diagram and then take the output to where it says "latch" on the second, you won't be able to use logic though, it will be off or on. A micro is the way to go. \$\endgroup\$
    – Voltage Spike
    Jun 7, 2021 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.