Menu
Microbots
0
  • Learn
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • ProtoBot
    • Modules & Parts
    • Tools & Gears
    • Coming Soon
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Sign in
  • English
  • Your Cart is Empty
Microbots
  • Learn
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • ProtoBot
    • Modules & Parts
    • Tools & Gears
    • Coming Soon
  • 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

67 reviews
Write a review
85%
(57)
6%
(4)
1%
(1)
3%
(2)
4%
(3)
62
21
C
CodeCell C3
Cloke74

Great piece of kit, had just what i needed to complete the project i had in mind. Shame shipping to the UK is so expensive, but appreciate this isn’t necessarily in the hands of MicroBots

A
CodeCell C6
Anonymous

I had an issue, got a red light, I used too much flux. Support said clean it, then the one sensor worked fine. I got the help and answer same day I provided a foto.

A
CodeCell C6 Drive
Anonymous

I think this is the best of the ESP offered, most versatile.

User picture
P
CodeCell C6
Prudhvi tej Chinimilli

Been testing the Microbots CodeCell C6 and honestly impressed with how much functionality they packed into such a tiny module. Great form factor for rapid prototyping wearable/embedded sensing applications. ESP32-C6 + IMU integration makes development much easier compared to building everything from scratch.

Still exploring battery optimization and compact LiPo options for our use case, but overall the platform is promising for low-cost real-time sensing systems. Excited to keep building with it.

F
CodeCell C6
Francisco Estivallet

Amazing hardware, my go to for compact projects.

User picture
123