Heltec-Aaron-Lee / WiFi_Kit_series

Arduino source codes and toolchain for WiFi_Kit_series made by HelTecAutomation.
GNU Lesser General Public License v2.1
756 stars 307 forks source link

WIFI Kit 32 Battery to ADC connection #10

Open garthberry opened 6 years ago

garthberry commented 6 years ago

Is there any kind of connection between the battery and one of the ADC pins for monitoring battery level?

seaser0 commented 6 years ago

I have the same question. @garthberry: Do you figured it out?

seaser0 commented 6 years ago

I was running some test and it seams to be A4. When I connect a full LiPo the analog read function shows values around 500 and it will drop below 100 when the battery is empty. I hope that helps.

garthberry commented 6 years ago

@seaser0 I performed the same test with a bench power supply connected to the battery terminal and I can confirm that out of A1-A7, A4 is the only one that reflects the change in battery voltage. The minimum voltage seems to be about 3.3v, anything less and the analog read function returns 0.

At a guess I would say there is a voltage divider connected between the battery + and A4 pin. @Heltec-Aaron-Lee Any chance the schematics could be made available somewhere?

kovir commented 6 years ago

sorry for a dumb question.... A4 - which PIN number is this? ( I can't see A4 on pinout diagram) thanks Marcel

seaser0 commented 6 years ago

According to this diagram A4 (or ADC1_4) corresponds to GIPO 32.

Heltec Wifi Kit 32 Pinout Diagram: http://esp32.net/images/Heltec/WIFI-Kit-32/Heltec_WIFI-Kit-32_DiagramPinout.jpg

walterheisenberg commented 5 years ago

Has anyone code for micropython to read the battery level? vcc = machine.ADC(machine.Pin(32)) vcc.read() does not work reliable and gave me values from 500 to under 100 in one minute the 1000mAh battery is connected with the JST-connector and I'm connected via webrepl

mwargan commented 5 years ago

@walterheisenberg have you figured it out? My readings are all over the place too :/

christiangda commented 4 years ago

Heltec Schematic

Voltage divisor with n-fet

Good discussion about that