Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read lipo charging progress? #15

Open
glowingkitty opened this issue Jun 2, 2021 · 7 comments
Open

Read lipo charging progress? #15

glowingkitty opened this issue Jun 2, 2021 · 7 comments

Comments

@glowingkitty
Copy link

glowingkitty commented Jun 2, 2021

Is there a way how we can read the remaining battery level of a connected lipo battery / how much the battery is charged?

@capedra
Copy link

capedra commented Jul 21, 2021

I would like to know about it either.

@JM-FRANCE
Copy link

JM-FRANCE commented Aug 31, 2021

same question (or just where to read the current battery voltage)

@nochlab1
Copy link

nochlab1 commented Dec 6, 2022

same question (or just where to read the current battery voltage)

Did you figure it out?

@nochlab1
Copy link

Is there a way how we can read the remaining battery level of a connected lipo battery / how much the battery is charged?

Did you figure it out?

@JM-FRANCE
Copy link

JM-FRANCE commented Dec 14, 2022

I dropped that board as there was no answer from LilyGO. Their PDF does not show any VBAT related connection to an ADC pin.

There was this discussion to read for a different board about reading VBAT

if you test and find out, please post back, that will surely help someone

@rigr
Copy link

rigr commented Feb 11, 2023

I use code snippets found in the repo for TTGO-T-Display to monitor voltage of a lipo connected to the board. I call this function numerous times in my code - and if voltage is below 3,75V the board switches to deep sleep. Something alike might work for you, too.

void voltage(){
  digitalWrite(14, HIGH);
  delay(1);
  float measurement = (float) analogRead(34);
  float battery_voltage = (measurement / 4095.0) * 7.26;
  digitalWrite(14, LOW);
  Serial.println(battery_voltage);
  tft.setCursor(170, 98);
  tft.print(battery_voltage);
  tft.print("V ");
  if (battery_voltage < 3.75){    //////////////////////////
    Serial.println("Going to sleep now.");
    tft.fillScreen(TFT_BLACK);
    tft.setCursor(0,0);
    tft.setTextSize(3);
    tft.println("LOW  BATTERY");
    tft.println(" ");
    tft.println("NOW GOING TO");
    tft.println(" ");
    tft.print("DEEP   SLEEP");
    delay(20000);
    esp_deep_sleep_start(); // to save the lipo - no wakeup.
    // RETURN;
  }  
}

@fgnievinski
Copy link

a practical answer:
Xinyuan-LilyGO/TTGO-T-Display#35 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants