Lipo voltage Lolin D32

yanosz
Posts: 12
Joined: Sun Jun 10, 2018 12:37 pm

Lipo voltage Lolin D32

Postby yanosz » Mon Apr 15, 2019 10:09 am

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

papaluna
Posts: 50
Joined: Tue Jan 30, 2018 11:27 am

Re: Lipo voltage Lolin D32

Postby papaluna » Mon Apr 15, 2019 2:58 pm

Hi,
The battery voltage monitor is on GPIO#35 (not exposed). More info at https://youtu.be/yZjpYmWVLh8?t=88
--
Paul.

juanpabloaj
Posts: 1
Joined: Sun Dec 15, 2019 9:32 pm

Re: Lipo voltage Lolin D32

Postby juanpabloaj » Sun Dec 15, 2019 9:38 pm

yanosz wrote:
Mon Apr 15, 2019 10:09 am
I'm wondering how to measure the LiPo voltage using a Lolin's 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);
}
https://github.com/juanpabloaj/lolin_d ... el.ino#L40

Who is online

Users browsing this forum: MSN [Bot] and 14 guests