Wiki kit 32/8266 read battery voltage

Hi,

I have two ESP’s , ESP8266, by Heltec and an ESP32, also made by Heltec. I would like to make both if not one be able to read the battery level/voltage so i can be warned before it runs out. I have found this script on the Heltec GitHub, ESP32 i couldn’t find one for the ESP8266, but i am not sure how to or what to connect.

Hi, in the newest ESP32 board, there already have a battery voltage read circuit:

You can read battery voltage by using this example: https://github.com/HelTecAutomation/Heltec_ESP32/blob/master/examples/ESP32/ADC_Read_Voltage/Battery_power/Battery_power.ino

Why doesn’t the version 2.1 of the schematic show where GPIO # 37 is?

Performing an analogRead(37) works as suggested by the schematic above, but the same schematic shows no actual connection to the MCU pins (i.e. where is the actual VBat connection to analog input GPIO #37?).

Thanks.

hi,

please refer the picture.

%E5%9B%BE%E7%89%87

What is the correct pin for Heltec Wifi Kit 32 V1 ?
I am trying a simple:

analogRead(analogPin);

I am reading Voltage from A4 pin but it looks like the value is not going down after 4hours of battery use.