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

52 reviews
Write a review
85%
(44)
4%
(2)
2%
(1)
4%
(2)
6%
(3)
21
48
L
MotorCell
Lennart Lange

Nice packaging, good follow up on the delivery, need to look up some online resources now for my first actual project wiht the cell

B
CodeCell C6 Drive
Brandon

Awesome product with great tutorials and example code

G
MotorCell
Gerald Kendrick

Very happy with my MotorCell. I'm incorporating it into a prototype project that will hopefully result in me needing a few more!

User picture
A
CodeCell C6 Drive
Anonymous

Great product! Having the IMU, motor driver, and battery management directly on the board is incredibly handy for quick prototyping. Love it!

Improvement ideas:
- using an ESP32 other than the C6 to get more cores. On a single-core chip, WiFi tasks often interfere with real-time applications.
- adding two more motor drivers (with a slightly higher current rating) would be awesome for drone projects!
- I know the compactness of the board is a huge selling point and really optimised, but exposing a few more pins would be great. With the motor drivers already occupying 4 pins, having only 4 GPIOs left can be tight for complex projects (though I’m nitpicking, I’m really pushing this board to its limits!).

A
CodeCell C6
Anonymous

I use CodeCell C6, like all the Features, and compactness. The remote Link to the iPhone with some Controls for 2 Motors is just perfect for the job.

123