Turning something on when power starts to flow - Page 1
Forum section: electronics / projects

author: Simon
author_rank: Unknown
timestamp: June 20, 2021, 09:29:48 am
content: So I have an application where I will have a microcontroller on a battery that powers stuff for periods of time. The power the micro controller draws does not have to be low and there are no real requirements for going to the extent of putting it to sleep etc but I can't have it running all the time.So I'm thinking of how do I turn it on when something is connected to the battery. My first thought was a current sense resistor with a comparator's inputs across it so that the comparator output would switch when current flows and the comparator will draw so little current that it is OK to have constantly connected. But what about the offset voltages of a comparator? what happens if the inputs are simply connected together? could it go either way?

author: Psi
author_rank: Super Contributor
timestamp: June 20, 2021, 09:39:49 am
content: Need more info, you have said a few things that seem to contradict themselves.

author: Simon
author_rank: Unknown
timestamp: June 20, 2021, 11:01:47 am
content: There is auxiliary circuitry that only needs to run when the battery is charging/discharging

author: madires
author_rank: Super Contributor
timestamp: June 20, 2021, 11:07:23 am
content: Set up an external interrupt fed by whatever battery monitoring and go into sleep mode?

author: Simon
author_rank: Unknown
timestamp: June 20, 2021, 11:26:12 am
content: Yes that is the other option. I've never really looked at low power design.

author: Simon
author_rank: Unknown
timestamp: June 20, 2021, 05:53:13 pm
content: If anything I was more curious about the hardware solution. would this actually be a problem for a comparator.

author: madires
author_rank: Super Contributor
timestamp: June 20, 2021, 06:32:13 pm
content: I think a comparator alone wouldn't be able to solve the problem. You have to deal with the battery's voltage, positive and negative voltage drop across the current shunt and some threshold for minimum current. This seems to ask for a high side current monitor IC followed by a comparator. There are also some digital monitor ICs with I2C, but I don't know any with a trigger output.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 20, 2021, 06:54:47 pm
content: Also have a look and see if your microcontroller has a built-in analogue comparator that when triggered can wake the MCU. Then you won't need a discrete comparator chip.Maybe there are current monitor/sense ICs out there that have an 'over current' logic level output, where you could set the current threshold really low.

author: Manul
author_rank: Super Contributor
timestamp: June 20, 2021, 07:00:56 pm
content: Maybe you could use a shuntable shunt resistor. It is a high value shunt resistor, which can be shorted by mosfet. You could choose such high value, that it triggers interrupt directly. Then MCU wakes up and turns on mosfet to bypass the resistor and allow current to flow with little drop. It all happens fast. Question is however, how to deal if MCU wants to go sleep, but the mosfet still in need to be on. Also how to deal with negative voltages. Maybe it fits your application, maybe not, just an idea.

author: Simon
author_rank: Unknown
timestamp: June 20, 2021, 08:41:52 pm
content: It does not have to be a current shunt per se, it can just be a higher value resistor that will then trigger a switch to bypass it once the logic starts up but yes you are right it's getting along the lines of a current sense chip anyway. I need to think about it a bit more.