EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: Simon on June 20, 2021, 09:29:48 am
-
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?
-
Need more info, you have said a few things that seem to contradict themselves.
-
There is auxiliary circuitry that only needs to run when the battery is charging/discharging
-
Set up an external interrupt fed by whatever battery monitoring and go into sleep mode?
-
Yes that is the other option. I've never really looked at low power design.
-
If anything I was more curious about the hardware solution. would this actually be a problem for a comparator.
-
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.
-
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.
-
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.
-
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.