Hello folks,
I'm wondering how to measure the LiPo voltage using a Lolin's D32. I wasn't able find any pins attached to one of the adcs. Do you know a code example for putting the esp32 into deepsleep when the battery reaches a critical level?
Thanks,
yanosz
Lipo voltage Lolin D32
Re: Lipo voltage Lolin D32
Hi,
The battery voltage monitor is on GPIO#35 (not exposed). More info at https://youtu.be/yZjpYmWVLh8?t=88
The battery voltage monitor is on GPIO#35 (not exposed). More info at https://youtu.be/yZjpYmWVLh8?t=88
--
Paul.
Paul.
-
- Posts: 1
- Joined: Sun Dec 15, 2019 9:32 pm
Re: Lipo voltage Lolin D32
I used this code, I'm not sure if it is correct or not.
Code: Select all
void loop()
{
int ADC_VALUE = analogRead(35);
Serial.print("ADC VALUE = ");
Serial.println(ADC_VALUE);
int adc_percentage = int(100 * ADC_VALUE / 4095);
//delay(1000);
float voltage_value = (ADC_VALUE * 3.3 ) / (4095);
Serial.print("Voltage = ");
Serial.print(voltage_value);
Serial.println(" volts");
//delay(1000);
EPD.clearBuffer();
EPD.fillScreen(EPD_WHITE);
EPD.setCursor(0,0);
EPD.print(adc_percentage);
EPD.println("%");
EPD.setCursor(0,26);
EPD.println(voltage_value);
EPD.setCursor(0,52);
EPD.println(ADC_VALUE);
EPD.display();
delay(60000);
}
Who is online
Users browsing this forum: No registered users and 108 guests