Monitoring Battery Supply to an ESP

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
philwilkinson40
Posts: 59
Joined: Tue Nov 14, 2017 3:11 am
Location: Perth, Australia

Monitoring Battery Supply to an ESP

Post by philwilkinson40 » Mon Mar 05, 2018 3:35 am

I would like an idea of remaining juice left in a battery supplying my WEMOS D1 mini via a battery shield.

A previous thread in this forum indicated that the ability to monitor the supply voltage, while available in the ESP, is not implemented in Micropython. Is this still the case?

I read a lot of power usage discussion on this and other forums as it is a key element of sustainable remote sensor use cases. However, I don't need a super accurate reading at this stage, I just need to know if the sensor is likely to die soon so I can go out and replace the battery!
Is the only method of reading this input voltage to drop it down and then connect to the ADC pin?

User avatar
Roberthh
Posts: 1649
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Monitoring Battery Supply to an ESP

Post by Roberthh » Mon Mar 05, 2018 6:13 am

Is the only method of reading this input voltage to drop it down and then connect to the ADC pin?
Yes, that seems to be the supported way of doing it. There was some discussion on the board about it, and while reading the voltage alone does not tell you much about the remaining charge, for a known battery characteristic is should be sufficient.

OutoftheBOTS_
Posts: 653
Joined: Mon Nov 20, 2017 10:18 am

Re: Monitoring Battery Supply to an ESP

Post by OutoftheBOTS_ » Mon Mar 05, 2018 7:29 am

I am in the process of implementing a battery monitor on my ESP32 controlled robots.

For my purposes the small amount of current draw from a permanently connected voltage divider doesn't matter as I am using big batteries and my motor sdraw so much current the voltage divider doesn't really affect it.

laboris posted a very nice circuit for a voltage divider that you can turn on and off with a IO pin this way you just turn it on when you want to do a reading and when the ESP32 is in sleep mode you leave it turned off so that it isn't draining the battery. see https://www.esp32.com/viewtopic.php?f=2&t=4692#p20349

Post Reply