I'm planning to power my ESP32 board directly from a battery. How can I measure the state of the battery to alert a user on low battery?
May I apply VCC directly to an analog input to measure the battery voltage?
How to measure a battery.
How to measure a battery.
Last edited by jenya7 on Thu Aug 13, 2020 11:55 am, edited 3 times in total.
Re: How to measure a battery.
Use a ruler if you want to measure its size. Use google if you want to measure its charge.
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
- jgustavoam
- Posts: 165
- Joined: Thu Feb 01, 2018 2:43 pm
- Location: Belo Horizonte , Brazil
- Contact:
Re: How to measure a battery.
Tommeyers se não quer ajudar, não atrapalha.
Hi Jenya,
If you are using the lithium ion battery to power the ESP32, you can measure the voltage at the battery poles.
But don't connect directly! The input of the ADC pin is limited to 3.3 Volts.
And the lithium-ion battery voltage can be up to 4.2 V in the fully charged state.
Therefore, use a voltage divider with two resistors. (for exemple, two 10 K ohms resistors).
Hi Jenya,
If you are using the lithium ion battery to power the ESP32, you can measure the voltage at the battery poles.
But don't connect directly! The input of the ADC pin is limited to 3.3 Volts.
And the lithium-ion battery voltage can be up to 4.2 V in the fully charged state.
Therefore, use a voltage divider with two resistors. (for exemple, two 10 K ohms resistors).
Retired IBM Brasil
Electronic hobbyist since 1976.
Electronic hobbyist since 1976.
Re: How to measure a battery.
Jenya,
To stabilize voltage, you may also want to add a capacitor and a resistor "just in case of":
https://github.com/esp8266/Arduino/issu ... -222891420
I've done so yesterday evening to mesure a backup battery for my home automation device (to ensure it doesn't go below 12V, otherwise that means the battery is dying and must be replaced) and it works perfectly.
Edit: that being said the value returned by the ADC and its stability differ when WiFi is turned on
Cheers
To stabilize voltage, you may also want to add a capacitor and a resistor "just in case of":
https://github.com/esp8266/Arduino/issu ... -222891420
I've done so yesterday evening to mesure a backup battery for my home automation device (to ensure it doesn't go below 12V, otherwise that means the battery is dying and must be replaced) and it works perfectly.
Edit: that being said the value returned by the ADC and its stability differ when WiFi is turned on
Cheers
Who is online
Users browsing this forum: No registered users and 49 guests