Menu
Microbots
0
  • Learn
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • Modules & Parts
    • Tools & Gears
    • Robots & Displays
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Sign in
  • English
  • Your Cart is Empty
Microbots
  • Learn
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • Modules & Parts
    • Tools & Gears
    • Robots & Displays
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Language

  • 0 0

CodeCell - Going to Sleep


CodeCell supports low-power sleep using either a periodic RTC timer or sensor-driven interrupts. Each method has different power characteristics, so choosing the right wake strategy is essential for low-power applications.

Sleep Current by Board & Wake Source

Board RTC Timer Brightness Interrupt Proximity Interrupt Tap Interrupt
CodeCell C3 Light ≈ 476 µA — — —
CodeCell C3 ≈ 861 µA — — —
CodeCell C6 ≈ 40 µA ≈ 280 µA ≈ 425 µA ≈ 860 µA
CodeCell C6 Drive ≈ 40 µA ≈ 280 µA ≈ 425 µA ≈ 1730 µA

All official sleep examples are in the repo: examples/Sleep


RTC Timer vs Interrupt Wakeup - What’s the Difference?

CodeCell offers two different wakeup strategies, each for different power-use applications.

🔹 RTC Timer Wakeup (Lowest Power)

The device sleeps in deep-sleep mode and wakes periodically based on an RTC timer. While asleep, current is constant (≈ 40 µA on C6 / C6 Drive).

On each wake cycle, the firmware must:

  • Re-initialize the sensors
  • Check if the sensor condition was triggered
  • Return to sleep if nothing happened

Because the ESP32 is in deep-sleep and the sensors are fully off between timer events, this mode saves the most energy.

The longer the timer interval → the more time spent in deep sleep → the lower the average current.

But, long intervals increase response delay (e.g., motion change might only be detected instantly). The graph below shows how RTC sleep behaves: the device spends around 1 second in deep sleep and only wakes periodically to check the sensor readings.

RTC Sleep vs Wake Graph

On this graph:

  • The long flat sections show deep sleep (~40 µA).
  • The tall spikes represent wake cycles where the device re-initializes sensors.
  • Increasing the timer interval makes the sleep sections longer → reducing average energy use.

🔹 Sensor Interrupt Wakeup (More Reactive, Higher Current)

Sensors can stay partially powered to wake the ESP32 instantly on events like tap, proximity, or light changes. But part of their circuitry needs to remain active, so sleep current is higher.

  • Tap interrupt (BNO085): ≈ 860 µA (C6) · ≈ 1730 µA (C6 Drive)
  • Brightness interrupt (VCNL4040): ≈ 280 µA (C6 / C6 Drive)
  • Proximity interrupt (VCNL4040): ≈ 425 µA (C6 / C6 Drive)

This mode provides instantaneous wakeups, ideal for user interactions or immediate alarms at the cost of constant current draw.

Sleep Examples (Quick Navigator)

  • 1) Tap Interrupt Wakeup — C6 / C6 Drive
    Sleep on command; wake instantly on tap.
    tap_interrupt_wakeup.ino
    Est. sleep ≈ 860 µA (C6) · 1730 µA (C6 Drive)
  • 2) Brightness Interrupt Wakeup — C6 / C6 Drive
    Wake when light rises above a threshold.
    brightness_interrupt_wakeup.ino
    Est. sleep ≈ 280 µA (C6 / C6 Drive)
  • 3) Proximity + Timer + EEPROM Wakeup — C3 / C3 Light / C6 / C6 Drive
    Timed sleep with proximity re-check on wake.
    proximity_timer_eep_wakeup.ino
    Est. sleep ≈ 40 µA (C6) · 476 µA (C3 Light) · 861 µA (C3)
  • 4) Darkness Interrupt Wakeup — C6 / C6 Drive
    Wake when light falls below a threshold.
    darkness_interrupt_wakeup.ino
    Est. sleep ≈ 280 µA
  • 5) Motion (RTC Timer Poll) Wakeup — C3 / C3 Light / C6 / C6 Drive
    Lowest-power motion detection using periodic RTC wake.
    motion_timer_wakeup (folder)
    Est. sleep ≈ 40 µA (C6) · 861 µA (C3)
  • 6) Proximity Interrupt Wakeup — C6 / C6 Drive
    Instant wake when proximity crosses a threshold.
    proximity_interrupt_wakeup.ino
    Est. sleep ≈ 425 µA

Choosing a Strategy

  • Best battery life: Use RTC timer sleep (~40 µA on C6 / C6 Drive).
  • Instant reaction: Use interrupt-based wake (tap / proximity / brightness).
  • Share:

Follow

Github

  • About
  • Software
  • Education
  • Contact
  • FAQs
  • Terms
  • Refund Policy
  • Privacy Policy

Join our Community ~ Be the first to know about new products and get exciting deals!

© 2026 Microbots.

★ Reviews

Let customers speak for us

37 reviews
Write a review
143%
(53)
8%
(3)
3%
(1)
5%
(2)
8%
(3)
21
35
F
CodeCell C6
Francisco Estivallet

Amazing hardware, my go to for compact projects.

User picture
M
CodeCell C6 Drive
Mohamed Karkouchia

Very god product to buyand test

A
CodeCell C6 Drive
Anonymous

Module looks absoluty perfect and cute.So such a small device has so many funtions. Dont have time to test full pontencial but definitely will order again

N
CoilPad
NileshRahate

How can I order this to India ..
Or can I get ready gerber to load on pcb way...
Or if have to purchase .. can purchase , pls send the link how to purchase .

A
MotorCell
Anonymous

Integrated Driver in such small size, unbeatable.

123