efficient way to monitor batteries - Page 1
Forum section: electronics / beginners

author: mkling
author_rank: Newbie
timestamp: November 15, 2017, 12:32:12 pm
content: Hi all,I have a problem/question that I want to ask you great guys that knows how to calculate energy. I have googled and hasn’t found a decent description on why this or that is the best way).So, scenario comes:I am using a esp12 (programmed via the arduino IDE) in 2 different schenarios.1. measure temperature and report via wifi once every hour (deepsleep between reports).2. monitor my mailbox in my garden -deepsleep until a micrositch on the door is activated and then report via wifi (also planning to add a LED and small camera).In both examples I am running the esp on battery (18650) and I also want to report the battery level so I know when it’s time to replace the battery.I have used voltage divider for this, and here are my concerns:To always have 2 resistors crossed over the battery has to draw some energy over time?My next thought was to use a voltage divider in combination with a relay (and only switch on the divider when I need to measure it), and then I started to think if it was possible to use transistors to ‘switch’ on and off the divider. And then I stared to think on how much a relay consumes the time it’s ‘on’ (I guess it’s a solenoid that has to draw pretty much whin on).And the last thing I was thinking about is the cost, maybe a relay give so much extra cost that it would be worth to use a extra battery insted.So, I guess the short question is: - How the *** do you guys monitor batteries in the most efficent way?

author: Ian.M
author_rank: Super Contributor
timestamp: November 15, 2017, 01:06:08 pm
content: Use a high side PMOSFET with its gate driven by a NMOSFET (+ a pullup to Vbatt) controlled by a MCU output pin to disconnect the divider chain from the battery except when making a voltage measurement.Alternatively use a divider chain with a total resistance of a couple of Megaohms, so its drain is small compared to the typical self-discharge of a 18650 cell (1%/month for a good one), and a picoamp input current micropower OPAMP as a buffer to present a low enough ource impedance to the MCU's ADC.

author: Peabody
author_rank: Super Contributor
timestamp: November 15, 2017, 02:43:23 pm
content: Here's a recent project I found on Hackaday.io illustrating Ian's idea:https://hackaday.io/project/27886-soft-power-button-with-sense-outputThe switch is used to turn the power on, after which the MCU keeps it on and ultimately turns it off sometime after the switch is off. But the MCU can also independently sense the state of the switch even when the power is on.So for the mailbox, instead of deep sleep between events, the power to the circuit would be completely shut off. Your microswitch would need to close when the door is opened, which would turn on the power. Then the ESP 12 would boot up, set the GPIO pin to maintain the power on, send the wireless message, sleep until the mailbox door is closed, then turn the power off. There would probably be no need to measure the battery - an alkaline would probably last for years. But the ESP 12 could measure the voltage if you like through the resistor divider and report that along with the door-open message.No relays are involved, and the parts are reasonable in both size and cost. When the power is off, the only current draw would be what leaks through the upper transistor, which would be very, very small.The only other thing you might want to add is some kind of reverse battery protection, depending on whether backwards installation is physically possible. That could be a diode, or another P-Channel MOSFET, installed backwards.