Battery and sleep

Light Sleep

Faster wake than deep sleep, with more state kept.

Battery and sleep Light sleep ESP32 family

Official path: examples/system/light_sleep

01 Overview

Light sleep keeps more peripherals/RAM. Wake is faster; current is higher than deep sleep.

  • Use when: you need quicker response but still care about energy.
  • Skip when: a coin cell must last months — deep sleep usually wins.

02 Hardware

  • Wake levels still matter.
  • Measure on the real battery path; USB power lies.

03 Software flow

1. Configure wake sources.

2. Enter light sleep.

3. Resume tasks without a full app_main restart (unlike deep sleep).

04 Core points

  • Pick sleep class from the latency budget.
  • Custom work: sleep state machine, which peripherals stay on.

中文

电池与休眠

Light Sleep 浅睡

要比深睡更快醒来时用。状态可保留得更多。

电池与休眠 浅睡 ESP32 family

官方路径: examples/system/light_sleep

01 项目概述

浅睡保留更多外设/内存,唤醒更快,电流高于深睡。

  • 适用: 需要较快响应又想省一点电。
  • 不适用: 按月计的纽扣电池节点(通常深睡更合适)。

02 项目硬件描述

  • 唤醒源仍要注意电平。
  • 量电流要用真电池路径,USB 供电会骗你。

03 项目软件流程描述

1. 配置唤醒源。

2. 进入 light sleep。

3. 醒来后继续任务,不必整机重跑 app_main(与深睡不同)。

04 项目核心点

  • 先定延迟预算,再选深睡还是浅睡。
  • 可定制: 睡眠状态机、外设哪些保持。