Deep Sleep Power Consumption Issue on AMB82-Mini

I’m trying to achieve minimal power consumption in Deep Sleep mode on AMB82-Mini (RTL8735BDM), but I’m getting **70 mA (0.07A)** instead of the expected **~4.6 mA** according to the official documentation.

**Hardware:**

- Board: AMB82-MINI (Seeed Studio)

- Chip: RTL8735BDM

- Power supply: USB (5V)

**Expected consumption (from official docs):**

- RTL8735B module isolated: 32.78 µA

- AMB82-MINI board (5V on V_USB): ~4.6 mA

- AMB82-MINI board (USB): >10 mA

**Actual consumption:**

- Deep Sleep mode: **70 mA** (measured via USB)

## Test Results

### Visual Test (LED Indicator)

I added a green LED test to verify Deep Sleep activation:

**Behavior:**

1. :white_check_mark: Green LED blinks for 5 seconds before Deep Sleep

2. :white_check_mark: Green LED **completely turns off** when entering Deep Sleep

3. :white_check_mark: System wakes up after 60 seconds (LED blinks again)

**Conclusion:** Deep Sleep **IS WORKING** - the LED test confirms it.

### Power Consumption Measurements

**Measurement method:**

- Ammeter connected in series with USB power supply

- Board powered via USB (5V)

**Results:**

- Normal mode: ~200-500 mA

- Deep Sleep mode: **70 mA** (stable, doesn’t change)

**Problem:** 70 mA is much higher than expected 4.6 mA.

## Code

Here’s the current firmware:

```cpp

/*

* Deep Sleep test with LED indicator

* Based on official PowerMode examples

*/

#include “PowerMode.h”

#include <WiFi.h>

// Wake up by AON Timer

#define WAKEUP_SOURCE 0 // AON Timer

// AON Timer settings

#define CLOCK 0 // 0: 100kHz (minimum consumption), 1: 4MHz

#define SLEEP_DURATION 60 // seconds

uint32_t PM_AONtimer_setting[2] = {CLOCK, SLEEP_DURATION};

#define WAKUPE_SETTING (uint32_t)(PM_AONtimer_setting)

void setup() {

Serial.begin(115200);

delay(2000);

Serial.println(“\n========================================”);

Serial.println(“DEEP SLEEP TEST”);

Serial.println(“========================================\n”);

*// Configure green LED for test*

pinMode(LED_G, OUTPUT);

digitalWrite(LED_G, LOW);

Serial.println(“[LOG] LED test: green LED will blink before Deep Sleep”);

Serial.println(“[LOG] In Deep Sleep, LED should completely turn off”);

Serial.println(“[LOG] Disabling all peripherals…”);

*// 1. Disable WiFi*

WiFi.disconnect();

delay(100);

Serial.println(“[LOG] Peripherals disabled”);

Serial.println(“[LOG] CLOCK = 0 (100kHz)”);

Serial.println(“[LOG] SLEEP_DURATION = 60 sec”);

Serial.println(“\n[LOG] Normal mode - measure consumption”);

Serial.println(“[LOG] Green LED blinking - this is normal mode”);

Serial.println(“[LOG] Waiting 5 seconds before Deep Sleep…”);

*// Blink green LED before Deep Sleep*

for (int i = 5; i > 0; i–) {

Serial.print("[LOG] Remaining: ");

Serial.print(i);

Serial.println(" sec");

    *// Blink LED: 3 times quickly*

for (int blink = 0; blink < 3; blink++) {

digitalWrite(LED_G, HIGH);

delay(100);

digitalWrite(LED_G, LOW);

delay(100);

}

delay(700); // Rest of the second

}

Serial.println(“\n[LOG] Final blink before Deep Sleep…”);

*// Final blink: 5 times quickly*

for (int i = 0; i < 5; i++) {

digitalWrite(LED_G, HIGH);

delay(150);

digitalWrite(LED_G, LOW);

delay(150);

}

*// Turn off LED before Deep Sleep*

digitalWrite(LED_G, LOW);

delay(200);

Serial.println(“\n[LOG] === ENTERING DEEP SLEEP ===”);

Serial.println(“[LOG] Green LED should COMPLETELY TURN OFF now!”);

Serial.flush();

delay(500);

*// Initialize Deep Sleep (correct syntax: 3 parameters)*

Serial.println(“[LOG] Initializing PowerMode…”);

PowerMode.begin(DEEPSLEEP_MODE, WAKEUP_SOURCE, WAKUPE_SETTING);

Serial.println(“[LOG] PowerMode.begin() completed”);

Serial.flush();

delay(500);

Serial.println(“[LOG] Calling PowerMode.start()…”);

Serial.println(“[LOG] If Deep Sleep works:”);

Serial.println(" - Green LED will TURN OFF");

Serial.println(" - No more logs for 60 sec");

Serial.flush();

delay(1000);

*// Disable Serial before Deep Sleep*

Serial.end();

delay(200);

*// Enter Deep Sleep*

*// In Deep Sleep, LED should completely turn off*

PowerMode.start();

*// If Deep Sleep didn't work, code will continue*

delay(3000);

Serial.begin(115200);

delay(1000);

Serial.println(“\n[ERROR] Deep Sleep DID NOT WORK!”);

Serial.println(“[ERROR] Green LED still on - Deep Sleep not working!”);

Serial.println(“[ERROR] Consumption will be ~70-100 mA instead of ~4.6 mA”);

Serial.println(“[ERROR] Check logs above for diagnostics”);

*// If Deep Sleep didn't work - LED will be on*

digitalWrite(LED_G, HIGH);

}

void loop() {

*// If Deep Sleep worked, code will start from setup() after wakeup*

*// If not - this loop will execute*

static bool error_logged = false;

if (!error_logged) {

Serial.println(“[ERROR] loop() executing - Deep Sleep didn’t work”);

Serial.println(“[ERROR] Green LED blinking - Deep Sleep NOT working!”);

    error_logged = true;

}

*// Blink LED if Deep Sleep didn't work*

digitalWrite(LED_G, HIGH);

delay(500);

digitalWrite(LED_G, LOW);

delay(500);

}

```

## What I’ve Tried

1. :white_check_mark: Used correct `PowerMode.begin()` syntax (3 parameters, as in official examples)

2. :white_check_mark: Set `CLOCK = 0` (100kHz for minimum consumption)

3. :white_check_mark: Disabled WiFi before Deep Sleep

4. :white_check_mark: Added LED test - confirms Deep Sleep is working

5. :white_check_mark: Proper sequence: `begin()` → `flush()` → `end()` → `start()`

6. :white_check_mark: Removed GPIO configuration (was causing issues)

## Analysis

### Why 70 mA instead of 4.6 mA?

**Possible causes:**

1. **USB power supply measurement:**

- USB-to-Serial converter (CH340) remains active: ~20-30 mA

- Voltage regulators: ~5-10 mA

- Power LED: ~1-2 mA

- Other board components: ~5-10 mA

- **Module in Deep Sleep:** ~4.6 mA

- **Total:** ~35-55 mA from board components + 4.6 mA module ≈ 70 mA

2. **Board components not powering down:**

- USB controller stays active when powered via USB

- Voltage regulators have quiescent current

- Power LED is always on

3. **Measurement point:**

- Measuring through USB includes all USB-related components

- Need to measure at VCC pin (3.3V direct) for accurate reading

## Question

**Is 70 mA consumption normal for Deep Sleep when powered via USB?**

**Or is there a way to reduce it further?**

**According to the documentation:**

- Module isolated: 32.78 µA

- Board with 5V on V_USB: ~4.6 mA

- Board with USB: >10 mA (but doesn’t specify exact value)

**My measurement shows 70 mA** - is this expected for USB power, or is there something wrong?

**For battery operation, should I:**

1. Use external 3.3V power on VCC pin (not V_USB)?

2. Accept that USB power will always consume ~70 mA in Deep Sleep?

3. Is there a way to disable USB components programmatically?

## Additional Information

- **Arduino SDK version:** 4.0.9

- **Board package:** realtek:AmebaPro2:Ameba_AMB82-MINI

- **PowerMode library:** Included in board package

- **Measurement tool:** Digital ammeter in series with USB power

## Expected vs Actual

| Mode | Expected (docs) | Actual (measured) | Status |

|------|----------------|-------------------|--------|

| Normal | ~53-55 mA | ~200-500 mA | :white_check_mark: Normal (depends on activity) |

| Deep Sleep (USB) | >10 mA (not specified) | **70 mA** | :red_question_mark: Is this normal? |

| Deep Sleep (VCC 3.3V) | ~4.6 mA | Not tested | :red_question_mark: Need to test |

## Request for Help

1. **Is 70 mA normal for Deep Sleep with USB power?**

2. **How to achieve <10 mA in Deep Sleep?**

3. **Should I use external 3.3V power on VCC pin for battery operation?**

4. **Is there a way to disable USB controller programmatically?**

Thank you for your help!

Hi @inxnik

To help us provide more accurate support regarding the deep sleep power-saving mode issue, could you provide more information about your project if possible?

Thank you.

Thank you for your response. Below is the project description and the technical summary of the deep sleep power consumption issue.

Project overview

Project: fast photo-capture system with battery operation
Platform: AmebaPro2 (AMB82-MINI), Seeed Studio
Chip: RTL8735BDM
Arduino Core: realtek:AmebaPro2 4.0.9
Board Package: realtek:AmebaPro2:Ameba_AMB82-MINI
Goals: fast boot-to-photo (~1.1 s achieved), photo capture (5 frames, 0.5 s interval), SD storage, Wi-Fi upload, and battery operation with deep sleep (<10 mA target).

Deep sleep behavior
Deep sleep works correctly (confirmed by LED test and serial logs), but consumption remains 60–70 mA via USB and 95 mA when powered directly at 3.3 V. Expected values from documentation: ~4.6 mA for the AMB82-MINI board when powered at 3.3 V and >10 mA from USB. The isolated module should consume ~32.78 µA.

Tests performed
– Wi-Fi fully disabled.
– All GPIO set to input/high-impedance.
– Serial interface disabled.
– AON timer configured for minimum consumption.
– Retention memory disabled.
– USB cable removed for 3.3 V measurements.

Measurements

USB power (5 V): 60–70 mA in deep sleep

Direct 3.3 V power: 95 mA.

Deep sleep activation is confirmed, so the excess current comes from board components, not from the RTL8735B core.

Possible causes

High quiescent current of onboard regulators, CH340 USB-UART chip drawing power even without USB connection, DDR memory staying in self-refresh mode, internal power rails not fully shutting down, measurements in documentation possibly referring to the isolated module rather than the full AMB82-MINI board?

Questions

  1. Is 60–70 mA in deep sleep normal for AMB82-MINI when powered via USB?

  2. Why does direct 3.3 V power result in ~95 mA instead of ~4.6 mA?

  3. Which components on the AMB82-MINI board remain active in deep sleep and contribute to the consumption?

  4. How can deep sleep current be reduced below 10 mA for battery operation?

  5. Were the official values (4.6 mA) measured on the full AMB82-MINI board or only on the RTL8735B module?

  6. Is it possible to disable the USB subsystem or other peripherals programmatically?

  7. Is there a preferred power pin or method for battery-powered designs?

We need to determine whether lower consumption is achievable on AMB82-MINI or if hardware modifications or a different module are required for battery operation.

Hello, I would appreciate any clarification on the normal deep sleep current consumption, thank you. Is a minimum consumption of 70 mA acceptable? Details are in the message above.

Hi @inxnik

Please give us a little time, as we are currently doing some testing with the information you shared. We understand that you are using the Arduino SDK. May I check if you have considered using the FreeRTOS SDK instead?

1 Like

Thank you, your advice actually helps

Forum Post: Deep Sleep Implementation for AMB82-MINI - Solution and Technical Details

## Subject: Successfully Implemented Deep Sleep with Minimal Power Consumption on AMB82-MINI

-–

Hello everyone,

I wanted to share our successful implementation of deep sleep mode on the **AMB82-MINI (RTL8735B)** platform and provide technical details that might help others achieve minimal power consumption.

## Problem Statement

We needed to implement deep sleep with minimal power consumption (< 10 mA) for battery-powered applications. Initially, we tried to use the **FreeRTOS SDK** directly, but encountered issues with firmware flashing via `uartfwburn.darwin` tool (verification failures after 100% write completion).

## Solution: Arduino IDE + FreeRTOS API

Instead of flashing the full FreeRTOS SDK firmware, we used **Arduino IDE** with direct calls to **FreeRTOS API** for deep sleep. This approach works because:

1. **Arduino Core uses FreeRTOS**: The Arduino Core for Ameba is built on FreeRTOS, so the APIs are the same

2. **Reliable flashing**: Arduino IDE uses a proven flashing method through the bootloader

3. **Direct API access**: You can call the same functions as in FreeRTOS SDK

## Working Code

Here’s the complete working implementation:

```cpp

/*

* DEEP SLEEP TEST - Minimal Power Consumption

* Uses FreeRTOS API through Arduino Core

*/

#include “PowerMode.h”

#include <WiFi.h>

// Wake up by AON Timer (minimum consumption)

#define WAKEUP_SOURCE 0 // AON Timer

// AON Timer settings - minimum consumption

#define CLOCK 0 // 0: 100kHz (minimum), 1: 4MHz

#define SLEEP_DURATION 60 // seconds

uint32_t PM_AONtimer_setting[2] = {CLOCK, SLEEP_DURATION};

#define WAKUPE_SETTING (uint32_t)(PM_AONtimer_setting)

void setup() {

Serial.begin(115200);

delay(100);

// 1. Disable WiFi completely

WiFi.disconnect();

delay(200);

// 2. Configure GPIO for minimal power consumption

// Set unused GPIO to INPUT to prevent current leakage

pinMode(PA_2, INPUT);

pinMode(PA_3, INPUT);

// 3. Disable Serial before deep sleep

Serial.flush();

Serial.end();

delay(200);

// 4. Initialize Deep Sleep

// Parameters: mode, wakeup_source, retention, settings

// retention = 0 means minimum consumption (no SRAM retention)

PowerMode.begin(DEEPSLEEP_MODE, WAKEUP_SOURCE, 0, WAKUPE_SETTING);

// 5. Enter Deep Sleep

PowerMode.start();

// This code should not execute

while(1);

}

void loop() {

// Not used

}

```

## Key Settings for Minimal Power Consumption

### 1. Wake Up Source

```cpp

#define WAKEUP_SOURCE 0 // AON Timer

```

- **AON Timer** provides the lowest power consumption

- Other options (GPIO, RTC, etc.) may consume more power

### 2. Clock Frequency

```cpp

#define CLOCK 0 // 0: 100kHz (minimum), 1: 4MHz

```

- **100kHz** is the minimum frequency and provides lowest consumption

- 4MHz consumes more power but allows faster wake-up

### 3. Retention Setting

```cpp

PowerMode.begin(DEEPSLEEP_MODE, WAKEUP_SOURCE, 0, WAKUPE_SETTING);

// ^

// retention = 0

```

- **retention = 0**: No SRAM retention (minimum consumption)

- Higher values retain more SRAM but increase power consumption

### 4. GPIO Configuration

```cpp

pinMode(PA_2, INPUT);

pinMode(PA_3, INPUT);

```

- Set all **unused GPIO pins to INPUT** (high-impedance state)

- This prevents current leakage through GPIO pins

- Floating pins can cause significant current draw

### 5. WiFi Disconnection

```cpp

WiFi.disconnect();

delay(200);

```

- **Always disconnect WiFi** before entering deep sleep

- WiFi radio consumes significant power even when idle

- Add a delay to ensure complete shutdown

### 6. Serial Disconnection

```cpp

Serial.flush();

Serial.end();

delay(200);

```

- **Disable Serial** before deep sleep

- UART interface consumes power even when not transmitting

- Flush buffers before disabling

## Power Consumption Results

:white_check_mark: **Successfully achieved minimal power consumption** (measured with external multimeter)

The actual consumption depends on:

- Power supply method (USB vs direct 3.3V)

- Board components (some components may remain active)

- GPIO configuration

- Retention settings

## Cycle Test Implementation

For testing and verification, here’s a cycle version that alternates between awake and sleep modes:

```cpp

/*

* DEEP SLEEP CYCLE TEST

* Cycle: 5 seconds awake → 5 seconds deep sleep

*/

#include “PowerMode.h”

#include <WiFi.h>

#define WAKEUP_SOURCE 0

#define CLOCK 0

#define SLEEP_DURATION 5 // 5 seconds

uint32_t PM_AONtimer_setting[2] = {CLOCK, SLEEP_DURATION};

#define WAKUPE_SETTING (uint32_t)(PM_AONtimer_setting)

void setup() {

Serial.begin(115200);

delay(500);

pinMode(LED_G, OUTPUT);

digitalWrite(LED_G, HIGH);

Serial.println(“AWAKE MODE (5 seconds)”);

// Blink LED and count

for (int i = 0; i < 5; i++) {

digitalWrite(LED_G, HIGH);

Serial.print(i + 1);

Serial.print("… ");

delay(500);

digitalWrite(LED_G, LOW);

delay(500);

}

Serial.println(“\r\nPreparing for deep sleep…”);

// Prepare for deep sleep

WiFi.disconnect();

delay(200);

pinMode(PA_2, INPUT);

pinMode(PA_3, INPUT);

PowerMode.begin(DEEPSLEEP_MODE, WAKEUP_SOURCE, 0, WAKUPE_SETTING);

Serial.flush();

Serial.end();

delay(200);

digitalWrite(LED_G, LOW);

delay(100);

// Enter deep sleep

// After wake-up, device reboots and setup() is called again

PowerMode.start();

while(1);

}

void loop() {

// Not used - device reboots after deep sleep

}

```

**Note**: After waking from deep sleep, the device **reboots**, so `setup()` is called again. This creates a natural cycle.

## Important Notes

1. **Device Reboots After Deep Sleep**: The device performs a full reboot after waking from deep sleep. All variables are reset, and `setup()` is called again.

2. **Serial Must Be Re-enabled**: After wake-up, you need to call `Serial.begin()` again if you want to use Serial output.

3. **GPIO State**: GPIO pins return to their default state after reboot. You need to reconfigure them if needed.

4. **WiFi State**: WiFi is disabled after reboot. You need to reconnect if needed.

## Troubleshooting

### High Power Consumption

- Check that all unused GPIO pins are set to INPUT

- Ensure WiFi is disconnected

- Verify Serial is disabled

- Check retention setting (should be 0 for minimum)

- Verify clock is set to 100kHz (0)

### Device Not Waking Up

- Check wake-up source configuration

- Verify AON timer settings (clock and duration)

- Ensure device is not stuck in deep sleep

### Serial Not Working After Wake-up

- Serial is disabled after deep sleep

- Call `Serial.begin()` again in `setup()`

- Add delay after `Serial.begin()` for initialization

## Platform Details

- **Platform**: AMB82-MINI (Seeed Studio)

- **Chip**: RTL8735BDM

- **Arduino Core**: realtek:AmebaPro2 4.0.9

- **Board Package**: realtek:AmebaPro2:Ameba_AMB82-MINI

## References

- [Ameba Arduino SDK Documentation]( Welcome to Ameba AIoT Arduino Documentation! — Ameba Arduino AIoT Documentation v1.1 documentation )

- [Ameba FreeRTOS SDK Documentation]( Welcome to AmebaPro2’s Documentation! — AmebaPro2's Documentation v0.1 documentation )

- [Ameba SDK Summary]( Ameba Freertos Sum-en – Realtek IoT/Wi-Fi MCU Solutions )

## Conclusion

Using Arduino IDE with FreeRTOS API provides a reliable and straightforward way to implement deep sleep on AMB82-MINI. The key to achieving minimal power consumption is:

1. :white_check_mark: Use AON Timer as wake-up source

2. :white_check_mark: Set clock to 100kHz

3. :white_check_mark: Set retention to 0

4. :white_check_mark: Configure all unused GPIO to INPUT

5. :white_check_mark: Disable WiFi and Serial before sleep

I hope this helps others who are working on battery-powered applications with AMB82-MINI.

1 Like