How to write code Read/Measure the voltage on the battery that power the ESP8266?
Hi.
You just need to use analogRead() and pass as an argument the pin in which you are reading the voltage.
Let me know if this helps.
Regards,
Sara
Thank you for your reply.
The battery doesn’t connect to any pins.
I use Solar manager which connected to the battery and the kit.
I use the system as in this linkhttps://www.waveshare.com/solar-power-manager.htm
Hi.
I thought you were using a battery without any module.
I’m not familiar with that module. But from the specs, it doesn’t seem to have any output to measure the current voltage. You would have to solder a wire to the terminals of the battery and measure the voltage on an analog pin.
You also have to take into account the maximum output voltage of the battery and that the ESP32 can only measure up to 3.3V.
Regards,
Sara
Hi. Hope you are alright. I’m worried about putting the battery in the esp32’s GPIO to monitor the voltage level, as I don’t know if the current can burn it. My project uses two batteries (one for esp32 and sensors and one for motor and servo) connected to Vin of tp4056 and Vout connected to Vin of step up DC DC. Can you help me? I would like to monitor the battery voltage level.
Hi.
Your question will be answered here: https://rntlab.com/question/battery-voltage-level-monitoring-circuit/
Regards,
Sara