😴 15uA. with Xiao ESP32C6 with PPK2 while sleeping BASIC example

Glad to see the New Xiao living up to the hype :sleeping: it draws a :pinching_hand:tiny amount of juice. Man batteries will go a while now.
Here is some basic code that blinks the led and uses the RTC to wake up from sleep. attached are the power profiles collected.
HTH
GL :slight_smile: PJ :v:

Test code…

// Basic Sleep code Counts reboots saves the number in the RTC memory 
// and blinks USER LED (10)times , then Pauses and then sleeps. 
// Wakes Up after 30 seconds and repeats.
// Using board 'XIAO_ESP32C6' from platform esp32\3.0.0-rc1
// Paoched and Toasted by PJG
// --------------------------------------------------------------------
#include <Arduino.h>
#include "esp32-hal-gpio.h"
#include "esp_sleep.h"
#include "driver/rtc_io.h"

const int ledPin = 15; // Built-in LED pin on the Xiao ESP32C6
const int wakeUpPin = 2; // GPIO 2 as the wake-up pin

RTC_DATA_ATTR int bootCount = 0; // Counter to keep track of wake-ups

void setup() {
  
  // Increment boot count and print it
  bootCount++;
  //Serial.begin(9600);
  delay(2000);
  //Serial.println("Processor OUT of RESET ");
  //Serial.println("");
  //Serial.println("Boot number: " + String(bootCount));
  pinMode (LED_BUILTIN,OUTPUT);  
  pinMode(wakeUpPin, INPUT_PULLUP);

  // Blink LED 10 times
  for (int i = 0; i < 10; i++) {
    digitalWrite(LED_BUILTIN, LOW);
    delay(500);
    digitalWrite(LED_BUILTIN, HIGH);
    delay(500);
  }
  // Configure wake-up sources
  //esp_sleep_enable_ext1_wakeup(1 << wakeUpPin, ESP_EXT1_WAKEUP_ANY_HIGH); // Wake on high level
  esp_sleep_enable_timer_wakeup(30 * 1000000); // 1 minute in microseconds , 30 seconds
 // Pause for 15 seconds
  delay(15000);

//  Serial.println("Going to sleep now");
//  Serial.flush();
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  // Enter deep sleep
  esp_deep_sleep_start();
}

void loop() {
  // This function will not be called as the device enters deep sleep
}


Average function run current is 30 Ma. with no optimisation.

Zoomed

Sleeping… Again No optimisation. some more could be squeezed :accordion:

This chip is definitely feels faster than the C3 albeit same clk’s you can tell by how responsive it is. Wifi connects faster too on my tests with the WPS. I like it! Why would you want a C3 I’m thinking?
here’s the setup, pic…


Hi PJ,
I am just now putting together a summary of sleep currents. I will post it as soon as it is done.
Preliminary results are 16mA (room temperature 25C).
Since SBD with high leakage current are used, the sleep current can easily double as the temperature rises. If you measure it with no wake-up, the temperature rise will be eliminated and the current will be around 16mA.

Hi there,
I should have called Vegas :moneybag: for the Odd’s you would… LOL nice stuff my Guy.
Looking forward to it. :star_struck: :+1:
GL :slight_smile: PJ

I’m using the ESP-IDF deep_sleep sample and I’m getting a little over 300µA during the deep sleep portion. The chip should be completely asleep and get woken once every 20 seconds. Connect my PPK to the battery terminals shows the behaviour pattern, but during the sleep, it’s averaging 324µA

@PJ_Glasso If you’re getting a tiny 15µA via Arduino, how can I determine what the configuration it’s using?

I’m hoping to get a battery powered Matter device working on this C6, but I’m hoping for a better sleep draw than 300µA! Any advice or tips are welcome.

Hi tomasmcguinness,
Would the following links be helpful to you?

Hii @msfujino - I found your thread first and seeing the 14.3µA gave me reason to continue digging!

As that’s Arduino too, it doesn’t give me any tips on getting the same low consumption when using ESP-IDF.

I guess the Arduino is turning something off by default. I just need to find what that is :slight_smile:

To compare apples with apples, I tried the Arduino code and flashed that onto my ESP32-C6.
The LED Blinks as expected, but deep sleep is drawing 299µA!

What am I doing wrong?

If you can show your Arduino sketch, I can check it here.

Thanks for offering to look. The sketch is exactly the same as @PJ_Glasso posted at the top. I copied that into Arduino IDE.

I’m using Arduino 2.4.3. I’ve installed the esp boards from espressif (espressif/arduino-esp32: Arduino core for the ESP32 version 3.0.7.

I’m powering the C6 using the battery terminals at the rear, with my PPK2 providing 3.3v in source meter supply mode.

The LED blinks as expected, before the power consumption drops down to 299µA.

I’ve performed a complete erase on the board. The ~300µA deep sleep draw is the same with both the Arduino code and the esp-idf deep sleep example.

I’m quite the amateur here, so I may have missed something obvious.

Try this sketch of just DeepSleep.

// Board Library : esp32 by Espressif 3.0.7
// Board Select  : XIAO_ESP32C6, XIAO_ESP32S3, XIAO_ESP32C3
// ArduinoIDE compile options left at default
// Vbat = 3.8V

void setup() {
  esp_deep_sleep_start();
}

void loop() {
}

Roughly the same result. 299µA.

I just spotted the vBatt of 3.8 in your sketch, so I increased my PPK2 to 3.8v

image

and …

Consumption dropped to 12µA!!!

In PPK2, zoom in on the area that is DeepSleep.
I think the SELECTION-average (current value in the gray area) in the bottom column is 15uA.
Perhaps what you are seeing is the average current value including the part before DeepSleep.

If I highlight a section, it’s only 4uA.

image

I don’t know what the 400uA spikes are about, but an average of 12uA is brilliant.

Could the voltage regulator on the battery suffer if the voltage is below a threshold?

At 3.5v, it’s

image

At 3.4v

image

At 3.3v it’s

image

The spike is probably generated by the 3.3V regulator SGM6029.
If you consider the Sleep current as an average current, it would be 15uA including this spike.

As the input voltage drops, the regulator changes its mode of operation and its efficiency also decreases.
Also, the minimum operating voltage of the ESP32C6 is 3.0V, so if VDD falls below 3.0V due to the voltage drop of the regulator, it may be unable to operate and not be able to enter Sleep mode.

1 Like

Thanks. I’ve more to learn :slight_smile:

Running @PJ_Glasso code sample with the 3.8v input shows an average of 10µA during sleep, so the issue does indeed seem to be the supply voltage.

Hopefully when I go back to my Matter code, it will have a similar effect! Thanks for your time @msfujino!

Hi there,

So you are in good hands with the Power Ninja @msfujino. I use a 3.85vDc battery So my results are based around same, AT the lower end it appears the voltage regulator switching modes is indeed the culprit I have found so far to effect if it will even go to sleep let alone , wakeup properly. We are out on the edge so expect some cuts… :smile: :+1:

HTH
GL :slight_smile: PJ :v:

FWIW the BSP’s also can have an effect overall current so Beware.