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?
Monitoring Battery Supply to an ESP
- philwilkinson40
- Posts: 63
- Joined: Tue Nov 14, 2017 3:11 am
- Location: Perth, Australia
Re: Monitoring Battery Supply to an ESP
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.Is the only method of reading this input voltage to drop it down and then connect to the ADC pin?
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: Monitoring Battery Supply to an ESP
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
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