Navigation

    LILYGO

    • Register
    • Login
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. SimonnomiS
    3. Posts
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 3
    • Best 0
    • Groups 0

    Posts made by SimonnomiS

    • Wake from deep sleep vs hard reset

      I am having a problem with my ESP32 TTGO T-Display device. If I wake from sleep using an ext wakeup the code below works as it should, if the voltage is below 3.35 the screen will not turn on and if above 3.35v it turns on but if I do a hard reset the screen turns on even if the voltage is below the 3.35v any idea as to why the reset seems to ignore the if (battery_voltage <= 3.35) statement?

        float v = analogRead(34);
        float cutoff_voltage = ((float)v / 4095.0) * 2.0 * 3.3 * (vref / 1000.0);
      
        if (battery_voltage <= 3.35) {
          Serial.println(String("display off"));
          ledcSetup(pwmLedChannelTFT, pwmFreq, pwmResolution);
          ledcAttachPin(TFT_BL, pwmLedChannelTFT);
          ledcWrite(pwmLedChannelTFT, 0);
          DisplayOff = true;
        } else {
          tft.init();
      
          Serial.print("Configuring PWM for TFT backlight... ");
          ledcSetup(pwmLedChannelTFT, pwmFreq, pwmResolution);
          ledcAttachPin(TFT_BL, pwmLedChannelTFT);
          Serial.println("DONE");
      
          Serial.print("Setting PWM for TFT backlight to default intensity... ");
          ledcWrite(pwmLedChannelTFT, BrightnessLevel);
          Serial.println("DONE");
      
          tft.fillScreen(TFT_BLACK);
          tft.setRotation(3);
          tft.drawXBitmap(30, 30, logo, 175, 72, tft.color565(0, 59, 161));
          delay(2000);
      
          tft.fillScreen(TFT_RED);
          tft.setRotation(0);
          tft.setTextSize(1);
          tft.setFreeFont(GenFnt);              // Select the font
          tft.setTextColor(0xFFE0, TFT_BLACK);  // White characters on black background
          tft.drawString(Punit, 15, 45);        // Print the name of the font
          tft.drawString(Tunit, 15, 140);       // Print the name of the font
          tft.drawXBitmap(50, 6, BTlogo, BTlogoWidth, BTlogoHeight, TFT_DARKGREY);
          DisplayOff = false;
      }
      
      posted in Technical Discussion
      S
      SimonnomiS
    • Battery powered problem

      I am running my TTGO ESP32 using a 16340 3.7v 800mah battery. When measuring the battery with the device awake and screen on the voltage is for example 3.0v and when I put the device into deep sleep the battery rises to 3.2v. I am using MCP130-315HI/TO supervisor to monitor the battery voltage and the issue is that the voltage drops below the supervisor threshold and it pulls the reset low turning off the device but then when the device is off the battery voltage rises over the supervisor cut off and powers the device back on causing the battery voltage to drop again and so on. Any idea how to get around this issue?

      posted in Technical Discussion
      S
      SimonnomiS
    • ESP32 doesn't wake-up from deep sleep when battery goes flat

      We have battery powered ESP32.

      In the program start, a custom button is configured as an external wake-up source (through RTC GPIO). Afterwards, once application is done, device goes to deep sleep. Normally, I am able to wake-up the device with the button afterwards.

      I only encounter problem in following scenario:

      leave the device active for long time, battery discharges.
      charge the battery so that device can get enough power.
      press the custom button to wake the system - nothing happens at all.
      reset the board - the system works normally again. Button for waking from sleep works.
      So, the issue is that after some time device forgets that it can be awaken with the RTC GPIO. Only way to restore it is with manual reset.
      Any idea to correct this?

      posted in Technical Discussion
      S
      SimonnomiS