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
736 stars 305 forks source link

ESP32 WiFi Lora Board - deep-sleep power consumption #6

Open rmh78 opened 6 years ago

rmh78 commented 6 years ago

Hardware:

Board: Heltec ESP32 WiFi Lora Board Core Installation/update date: 25/nov/2017 IDE name: Arduino IDE Flash Frequency: 80Mhz Upload Speed: 921600

Description:

I want to set the esp32 to deep sleep mode and measure the power consumption. The esp32 specification says that the power consumption should be in the µA range. My measurement is between 3mA and 10mA in deep-sleep mode. I'm powering the board with 3.7V lipo on the 3.3V input pin.

Sketch:

#include "esp_sleep.h"

#define uS_TO_S_FACTOR 1000000  /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP  60       /* Time ESP32 will go to sleep (in seconds) */

void setup() {
  Serial.begin(115200);
  delay(1000); 

  esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
  esp_sleep_pd_config(ESP_PD_DOMAIN_MAX, ESP_PD_OPTION_OFF);
  esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
  esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_OFF);
  esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_OFF);
}

void loop(){
  delay(5000);
  esp_deep_sleep_start();
}
TheNetStriker commented 4 years ago

I also have this problem with this board from Banggood. I'm using this exampleto connect to TheThingsNetwork. I tried several software solutions in this thread, but I was not able to reduce the power consumption below 10mAH.

Is there anything other I could try to reduce the power consumption without removing components?

Skipper-is commented 4 years ago

With those boards from Banggood I've not managed to get the power consumption down to sensible levels. I've tried cutting components out, and different software solutions but nothing has reduced the power to managable levels. I think they're nice little proto boards, but you just need to go for another solution for the in field applications - like the Wireless Stick Lite, or the new CubeCell boards

TheNetStriker commented 4 years ago

@Skipper-is Thanks for the hint. The CubeCell boards look quite nice. Maybe I can use the Banggood boards for something else where power consumption does not matter.

Skipper-is commented 4 years ago

Gateway? Or just pack a big battery and a big solar panel?

TheNetStriker commented 4 years ago

@Skipper-is I already have Gateway. I think I will use them for my smoke detectors. I designed a circuit that can be attached to any cheap smoke detector that should not consume any power until smoke is detected. Then the circuit will convert the 9 Volts of the Battery to 5 Volts and this could power up the device and send a LoRa message.

Lordcybertracker commented 3 years ago

Hi guys, maybe a little late, but I had the same problem with TTGO LoRa32 (V1) deep sleep power consumption and I managed it by cutting the LDO from 5V circuit and by soldering the LiPo directly to LDO. Fortunately the LDO is wired to 5V-circuit by a more or less good reachable single track coming from right top (on my picture) to the right top corner of pin 1 of LDO. After this change CP2102 is powered only by 5V USB and working if USB is plugged. The on board LiPo-charger of course is not working. No problem for me, because I decided to use a discrete charging module with temperature tracking and batterie protection. But you may wire pin 3 of charger and pin 1 of LDO by a shottky diode - should work. Deep sleep power consumption now is 900uA.

Cut

(sorry for the bad picture quality...)

Gott sei dank. Very Good. so i must not Trash my 5 Boards.

Heltec-Aaron-Lee commented 3 years ago

Dear There

TTGO is not our products, we don’t know much about their product features.

Regards. Aaron.Lee


Best regards/此致敬礼

李生 Aaron.Lee 工程师 Electronic Engineer 成都惠利特自动化科技有限公司 Heltec Automation +86 18080100260 +86-028-62374838 www.heltec.org

2020年11月23日 下午5:11,Lordcybertracker notifications@github.com 写道:

Hi guys, maybe a little late, but I had the same problem with TTGO LoRa32 (V1) deep sleep power consumption and I managed it by cutting the LDO from 5V circuit and by soldering the LiPo directly to LDO. Fortunately the LDO is wired to 5V-circuit by a more or less good reachable single track coming from right top (on my picture) to the right top corner of pin 1 of LDO. After this change CP2102 is powered only by 5V USB and working if USB is plugged. The on board LiPo-charger of course is not working. No problem for me, because I decided to use a discrete charging module with temperature tracking and batterie protection. But you may wire pin 3 of charger and pin 1 of LDO by a shottky diode - should work. Deep sleep power consumption now is 900uA.

https://user-images.githubusercontent.com/39725678/58792613-cd09d980-85f4-11e9-8abd-2e4d9311bd0f.JPG (sorry for the bad picture quality...)

Gott sei dank. Very Good. so i must not Trash my 5 Boards.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/issues/6#issuecomment-732028753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH2WTFMOSBFL2O3D3R2HEFTSRIRLDANCNFSM4EFRDAEQ.

deejot0 commented 3 years ago

Hi guys, maybe a little late, but I had the same problem with TTGO LoRa32 (V1) deep sleep power consumption and I managed it by cutting the LDO from 5V circuit and by soldering the LiPo directly to LDO. Fortunately the LDO is wired to 5V-circuit by a more or less good reachable single track coming from right top (on my picture) to the right top corner of pin 1 of LDO. After this change CP2102 is powered only by 5V USB and working if USB is plugged. The on board LiPo-charger of course is not working. No problem for me, because I decided to use a discrete charging module with temperature tracking and batterie protection. But you may wire pin 3 of charger and pin 1 of LDO by a shottky diode - should work. Deep sleep power consumption now is 900uA.

Gott sei dank. Very Good. so i must not Trash my 5 Boards.

Hello! Unfortunately I could not find a PCB layout of the LoRa32 board. Thus, it is not completely clear, what cutting the track you mentioned really does. Do you know, whether it is still possible to power the board via one of the 5V pins after the modification?

frankheisig71 commented 3 years ago

Hi deejot0, it is completely clear: cutting the track seperates the ESP32 power regulator from the 5V supply - you need to solder power directly to it, and, no you can not power ESP32 by 5Vpins any more.

deejot0 commented 3 years ago

Here is a reversible solution for those, who do not want to cut the track. It is quite easy to lift the 5V pin of the LDO from its pad. Then a pin header can be soldered to that pin and the second contact of the pin header can be soldered to one of the 5V contacts of the LoRa32 board. When the contacts of the pin header are closed with help of a jumper, the board behaves as known. When the jumper is removed, the board has to be powered with 3.3V, but has a deep sleep current of ~3 mA.

LoRa32

Maarkk commented 2 years ago

I did more "brutal" thing - I have cut traces powering CP2102 (pins 7 and 8 of the chip, close to the via that provides +25V). Before I did that, I have observed that after removing usb plug (TTGO operating from battery) current drops to 3mA, but after reset it stays on 8mA. All that means CP2102 enters its low-power mode only after disconnection, after reset it is full power. I've decided thus to cut it off from 5V, now power consumption is 2.9mA

gwerhart0800 commented 2 years ago

I know this is an old thread, but for those working on low power consumption, I highly recommend the Nordic Power Profiler II kit. It is ~$100US. I have found that I can get deep sleep for the Heltec ESP32 Lora V2 board down to ~10uA if I power it from the 3.3v pins. For my application, I am using 12v batteries + solar for power, so I use an external switching regulator. (Note, I am using the RadioHead library for the LoRa radio.) I think the best combination would be an LiFePO4 battery and skip the Heltec regulator and battery charging circuit. I made no modifications to the board and the sleep code is:

`/**

![IMG_8052](https://user-images.githubusercontent.com/

Screen Shot 2022-05-10 at 6 09 11 AM

735626/167625320-44bca4a0-95b7-48f7-b217-4d17a66b3c9d.jpeg)

gwerhart0800 commented 2 years ago

Here is a comparison of powering the Heltec ESP32 Lora V2 with 5v and 3.3v pins using the PPK2 as the source meter. The application is the same. It wakes up, does a bunch of sensor config and polling, then sends the sensor information and gets a message back telling it to sleep.

Screen Shot 2022-05-10 at 1 08 50 PM
johannes-777 commented 2 years ago

Thank's for mentioning ppk2 - just ordered one at RS. I spent the whole morning yesterday researching ppk2 and other Nordic products. The nRF9160 seems to be very interesting for ultra low power. Instead of LoRa, it uses LTE-NB, but this should work too. However, development-boards are quite expensive (e.g. from https://www.jaredwolff.com/store/nrf9160-feather/), so maybe this could be a next product for Heltec? In general my impression is that Heltec should recommit resources to its roots (i.e. affordable and well equipped development boards - where is the CubeCell with 256KByte, which was announced a year ago?), rather than trying to explore new terrain with overpriced gateways or complete cloud solutions, which will never be acceptable in Europe due to the strict data protection regulation (DSGVO).

dagnum commented 2 years ago

I have the HTCC-AB01 (https://heltec.org/project/htcc-ab01/) and I am getting 20 uA with wake on interrupt and timer for wake up and check in. Let me know if that helps anyone.

epgodoy commented 2 years ago

What configurations are you using to get that? How are you powering it? Tks -------- Mensagem original --------De : dagnum @.> Data: 18/05/2022 00:44 (GMT-03:00) Para: Heltec-Aaron-Lee/WiFi_Kit_series @.> Cc: Subscribed @.***> Assunto: Re: [Heltec-Aaron-Lee/WiFi_Kit_series] ESP32 WiFi Lora Board - deep-sleep power consumption (#6) I have the HTCC-AB01 (https://heltec.org/project/htcc-ab01/) and I am getting 20 uA with wake on interrupt and timer for wake up and check in. Let me know if that helps anyone.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

dagnum commented 2 years ago

1100 mAh 3.7 lipo... emailed you ino

FritzOS commented 1 year ago

I have adapted the solution from gwerhart0800 to the HELTEC ESP32 LoRa V3 board. Power supply comes from a LiPo connected to the onboard battery interface. In deep sleep the board consumes ~25uA.

`

define TIME_TO_SLEEP 10 / Duration ESP32 will go to sleep (seconds) /

define TIME_UP 5 / Duration ESP32 stays up (seconds) /

//--prepare LoRa ---------------------------------------------------------------------------

include "LoRaWan_APP.h"

static RadioEvents_t RadioEvents;

//-- prepare OLED display -----------------------------------------------------------------

include

include "HT_SSD1306Wire.h"

extern SSD1306Wire display; // already defined in LoRaWan_APP stack //SSD1306Wire display(0x3c, 500000, SDA_OLED, SCL_OLED, GEOMETRY_128_64, RST_OLED);

void setup() { Serial.begin(115200); Serial.printf("Deep sleeping test");

initOLED(); initLoRaRadio();

goToSleep(TIME_TO_SLEEP); return; }

void loop() { display.clear(); display.drawString(58, 16, "this text"); display.drawString(58, 32, "shouldn't"); display.drawString(58, 48, "appear !"); display.display(); }

void goToSleep(int sleepSeconds) { Radio.Sleep( );

display.sleep(); delay(100); VextOFF();

// // Heltec V2 // Heltec V3 pinMode(17, INPUT); // 4 SDA // 17 OLED SDA pinMode( 9,INPUT); // 5 LORA SCK // 9 LORA pinMode(14,INPUT); // 14 RST 1278 // 12 LORA RST pinMode(18, INPUT); // 15 SCL // 18 OLED SCL pinMode(21,INPUT); // 16 OLED RST // 21 OLED RST //pinMode(17,INPUT); // 17 HS1_DATA5 // pinMode( 8,INPUT); // 18 LORA NSS // 8 LORA NSS pinMode(11,INPUT); // 19 MISO // 11 LORA MISO pinMode(12,INPUT); // 26 DIO026 // 12 DIO1 (LORA) pinMode(10,INPUT); // 27 MOSI // 10 LORA MOSI

Serial.printf("Deep sleeping for %d seconds\n", sleepSeconds); esp_sleep_enable_timer_wakeup(sleepSeconds * 1000000); Serial.flush(); esp_deep_sleep_start();

Serial.println("This will never be printed"); }

void VextON(void) { pinMode(Vext,OUTPUT); digitalWrite(Vext, LOW); }

void VextOFF(void) //Vext default OFF { pinMode(Vext,OUTPUT); digitalWrite(Vext, HIGH); }

void initOLED() { VextON(); delay(100); display.init(); display.clear(); display.setFont(ArialMT_Plain_16); display.setTextAlignment(TEXT_ALIGN_CENTER); display.drawString(58, 16, "DEEP"); display.drawString(58, 32, "SLEEPING"); display.drawString(58, 48, "TEST"); display.display(); delay(TIME_UP * 1000); }

void initLoRaRadio() { Mcu.begin(); Radio.Init(&RadioEvents); } `

maxklt commented 1 year ago

unfortunately the script does not work, still a power consumption of ~16mA

Quency-D commented 1 year ago

V3 version development board, using the following code, low power consumption is 15uA.

#include "Arduino.h"
#include "LoRaWan_APP.h"
void lora_init(void)
{
  Mcu.begin();
  static RadioEvents_t RadioEvents;

  RadioEvents.TxDone = NULL;
  RadioEvents.TxTimeout = NULL;
  RadioEvents.RxDone = NULL;

  Radio.Init( &RadioEvents );

}

void VextON(void)
{
  pinMode(Vext,OUTPUT);
  digitalWrite(Vext, LOW);

}

void VextOFF(void) //Vext default OFF
{
  pinMode(Vext,OUTPUT);
  digitalWrite(Vext, HIGH);
}
void setup()
{
    Serial.begin(115200);
    delay(100);
    lora_init();
    delay(1000); 
}

void loop()
{
    VextOFF();
    Radio.Sleep();
    SPI.end();
    pinMode(RADIO_DIO_1,ANALOG);
    pinMode(RADIO_NSS,ANALOG);
    pinMode(RADIO_RESET,ANALOG);
    pinMode(RADIO_BUSY,ANALOG);
    pinMode(LORA_CLK,ANALOG);
    pinMode(LORA_MISO,ANALOG);
    pinMode(LORA_MOSI,ANALOG);
    esp_sleep_enable_timer_wakeup(6000*1000*(uint64_t)1000);
    esp_deep_sleep_start();
}

1685786356798