Wireless Paper: deep sleep power consumption too high

Hi folks,

I just got my hands on a Wireless Paper board. Got a sketch running and testing its power consumption during deep sleep.
My multimeter indicates 1.68 mA with a Li-ion battery attached. The age-old problem: this is much higher than advertised (“Low power consumption, 20uA in deep sleep”).
There’s no power LED (only on USB power), so I am not completely sure in which direction to look.
Anyone get ideas?

Sketch to reproduce:

#include "HT_QYEG0213RWS800_BWR.h"
#include "images.h"

// Initialize the display
QYEG0213RWS800_BWR   display(6, 5, 4, 7, 3, 2, -1, 6000000);//rst,dc,cs,busy,sck,mosi,miso,frequency

typedef void (*Demo)(void);

/* screen rotation
 * ANGLE_0_DEGREE
 * ANGLE_90_DEGREE
 * ANGLE_180_DEGREE
 * ANGLE_270_DEGREE
 */
#define DIRECTION ANGLE_0_DEGREE

int width,height;
int demoMode = 0;

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

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

void enter_deepsleep(void)
{

  Serial.println("Going to deepsleep...");
  Serial.flush();
	esp_sleep_enable_timer_wakeup(20*1000*(uint64_t)1000);
	esp_deep_sleep_start();
} 

void drawCircleDemo() {
  int x = width/4;
  int y = height/2;
  display.clear();
  for (int i=1; i < 8; i++) {
    display.setColor(WHITE);
    display.drawCircle(x, y, i*3);
    if (i % 2 == 0) {
      display.setColor(BLACK);
    }
  }
  display.update(BLACK_BUFFER);
  
  display.clear();
  x = width/4*3;
  for (int i=1; i < 8; i++) {
    display.setColor(WHITE);
    if (i % 2 == 0) {
      display.setColor(BLACK);
    }
    display.fillCircle(x, y, 32 - i* 3);
  }
  display.update(COLOR_BUFFER);
  display.display();
}

void setup() {
  Serial.begin(115200);
  if (DIRECTION==ANGLE_0_DEGREE||DIRECTION==ANGLE_180_DEGREE)
  {
    width = display._width;
    height = display._height;
  }
  else
  {
    width = display._height;
    height = display._width;
  }
  VextON();
  delay(100);
  Serial.println("Woke from boot/sleep");

  // Initialising the UI will init the display too.
  display.init();
  display.screenRotate(DIRECTION);
  display.setFont(ArialMT_Plain_10);

  drawCircleDemo();
  delay(10000);
  display.sleep();
  delay(100);
  VextOFF();
  
  enter_deepsleep();

}

void loop() {

}

//Keep the NSS feet pulled up将nss脚保持上拉

pinMode(RADIO_DIO_1, ANALOG);

  digitalWrite(RADIO_NSS, HIGH);

 gpio_hold_en((gpio_num_t)RADIO_NSS);

// pinMode(RADIO_NSS, ANALOG);

// digitalWrite(RADIO_NSS, HIGH);

pinMode(RADIO_RESET, ANALOG);

pinMode(RADIO_BUSY, ANALOG);

pinMode(LORA_CLK, ANALOG);

pinMode(LORA_MISO, ANALOG);

pinMode(LORA_MOSI, ANALOG);

I modified the enter_deepsleep() function such that it reads like this:

void enter_deepsleep(void)
{
  Serial.println("Going to deepsleep...");
  Serial.flush();

  //Keep the NSS feet pulled up
  pinMode(RADIO_DIO_1, ANALOG);
  digitalWrite(RADIO_NSS, HIGH);
  gpio_hold_en((gpio_num_t)RADIO_NSS);
  // pinMode(RADIO_NSS, ANALOG);
  // digitalWrite(RADIO_NSS, HIGH);
  pinMode(RADIO_RESET, ANALOG);
  pinMode(RADIO_BUSY, ANALOG);
  pinMode(LORA_CLK, ANALOG);
  pinMode(LORA_MISO, ANALOG);
  pinMode(LORA_MOSI, ANALOG);

  esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
  esp_sleep_enable_timer_wakeup(20*1000*(uint64_t)1000);
  esp_deep_sleep_start();
} 

But my multimeter reads 1.72 mA during deepsleep… :frowning:
Any other ideas, anyone?

Give it a try and add the vextoff() function

As you can see in the main script in the first post, you’ll see that I called it from the main function… so that apparently doesn’t help :frowning:

@navi I would love to hear if you have a script that demonstrates the low-power capabilities of the Wireless Paper. I have managed to get mine down to 906 uA during deepsleep, while similar boards such as the TTGO T5 v2.3.2 can go down to 170 uA and the Heltec website claims much lower, even.

I use the following sketch:

#include "LoRaWan_APP.h"

static RadioEvents_t RadioEvents;

void enter_deepsleep(void)
{
  Serial.println("Going to deepsleep...");
  Serial.flush();

  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);

  pinMode(TX, ANALOG);
  pinMode(RX, ANALOG);

  esp_sleep_cpu_pd_low_init(true);
  esp_sleep_pd_config(ESP_PD_DOMAIN_VDDSDIO,ESP_PD_OPTION_OFF);
  esp_sleep_enable_timer_wakeup(20*1000*(uint64_t)1000);

  delay(100);
  esp_deep_sleep_start();
} 


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

  delay(100);
  Serial.println("Woke from boot/sleep");
  Mcu.begin();
  Radio.Init( &RadioEvents );
  Radio.Sleep();

  delay(10000);  
  
  enter_deepsleep();

}

void loop() {

}

AND: is there a schematic available? As for the Wireless Tracker, the defined pins do not always match the actual wiring, and I would love to see the schematic available.

I would like to add that since a few days, the schematic of the Wireless Paper is available for download on

Still investigating the power consumption of the Wireless Paper. I now got it down to 900 uA or 0.9 mA.
This is much higher than the ~20uA that I can get the other ESP32-S3 boards down to.
The main difference I see compared to the other boards is the addition of the CP2102 and 2N7002BKS chips.

Can @wangwuse or someone else help reach an acceptable power consumption? There’s hundreds of Papers on the line if we can get this power consumption down to the other boards!

Sketch to reproduce my 0.9 mA:

#include <Arduino.h>
#include <RadioLib.h>
#include <SPI.h>

SPIClass spi(SPI);
SPISettings spiSettings(2000000, MSBFIRST, SPI_MODE0);

// NSS/CS, DIO0, RST, DIO1
SX1262 radio = new Module(8, 14, 12, 13, spi, spiSettings);

void deepsleep(void) {
	spi.end();
	pinMode( 8, ANALOG);
    pinMode( 9, ANALOG);
    pinMode(10, ANALOG);
    pinMode(11, ANALOG);
    pinMode(12, ANALOG);
    pinMode(13, ANALOG);
    pinMode(14, ANALOG);

    esp_sleep_enable_timer_wakeup(20 * 1000 * 1000);
	esp_deep_sleep_start();
}

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

	// SCK/CLK, MISO, MOSI, NSS/CS,
	spi.begin(9, 11, 10, 8);

	// initialize SX1262 with default settings
	radio.begin();

    delay(5000);
    Serial.println("Putting radio to sleep...");
    radio.sleep();
	
    delay(5000);
}

void loop() {
    Serial.println("Entering deepsleep...");
    delay(500);
    deepsleep();
}

Pull the NSS foot up and maintain it during sleep

@wangwuse that results in at least 1.8mA of power consumption, so that is not the solution! Please share a picture and code if it does for you

Finally got back around to this. I must have done something wrong earlier, because I now got pin 8 (LoRa CS) pulled down during deepsleep and power consumption is down to 18 uA. Impressive and good news!

Hi,

When trying to compile the wireless_paper “Factory test” sketch in platformIO, I get the follwoing error:
error: ‘gpio_hold_en’ was not declared in this scope gpio_hold_en((gpio_num_t)RADIO_NSS);

What I am missing?
Thanks


#include <Arduino.h>
#include “WiFi.h”
#include “heltec.h”
#include “LoRaWan_APP.h”
#include <Wire.h>
#include “HT_QYEG0213RWS800_BWR.h”
#include “images.h”
#include “driver/gpio.h”
#include “esp_sleep.h”

I’m struggling in exactly the same ways as you were at the start of the thread, and I can’t think of what it is that I’m missing here…

Is there any chance you could post the exact code which did finally give you good results?

Hey Todd, happy to see you here! Hope catch up on you soon on both topics.

1 Like

The official has updated the low-power lorawan for wirelesspaper in the latest version 1.0.0.

I believe I have figured out where I have been going wrong.

This all seems right, however apparently it is also necessary to put the SX1262 transceiver chip into sleep mode first, using an SPI command.

In the Heltec driver, this is handled by Radio.Sleep(). This call eventually executes Line 236 of sx126x.c

I imagine that RadioLib has a sleep method which is issuing a similar command (?)

As a stripped back example, this code puts the board into a sleep state drawing 18μA, by manually issuing the “SLEEP mode” SPI command:

// Pins
#define PIN_VEXT       45

#define RADIO_DIO_1    14
#define RADIO_NSS      8
#define RADIO_RESET    12
#define RADIO_BUSY     13

#define LORA_CLK       9
#define LORA_MISO      11
#define LORA_MOSI      10

// Setup LoRa CS
digitalWrite(RADIO_NSS, HIGH);
pinMode(RADIO_NSS, OUTPUT);

SPI.begin(LORA_CLK, LORA_MISO, LORA_MOSI);
SPI.beginTransaction( SPISettings(8000000L, MSBFIRST, 0) );
digitalWrite(RADIO_NSS, LOW);   // CS LOW
SPI.transfer(0x84);             // Command: Enter SLEEP mode
SPI.transfer(0x04);             // Option: Preserve chip config while sleeping
digitalWrite(RADIO_NSS, HIGH);  // CS HIGH
SPI.endTransaction();           
SPI.end();

pinMode(PIN_VEXT, OUTPUT);
digitalWrite(PIN_VEXT, HIGH);

pinMode(RADIO_RESET, ANALOG);
pinMode(RADIO_BUSY, ANALOG);
pinMode(LORA_CLK, ANALOG);
pinMode(LORA_MISO, ANALOG);
pinMode(LORA_MOSI, ANALOG);

pinMode(RADIO_NSS, OUTPUT);
digitalWrite(RADIO_NSS, HIGH);
gpio_hold_en((gpio_num_t)RADIO_NSS);

esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
esp_deep_sleep_start();

Yup, you got it! Good minimal example as it doesn’t require the inclusion of any library. That’s what I used RadioLib for (with its radio.sleep()).

1 Like