ESP32 · STM32 · IoT · Power
ESP32 vs STM32 for Battery-Powered IoT
If you're picking an MCU for a battery-powered IoT device, the ESP32 vs STM32 decision usually comes down to one question: do you need built-in wireless, or do you need the lowest possible sleep current?
Sleep current is the real dividing line
A stock ESP32 in deep sleep draws roughly 10-150µA depending on which peripherals stay powered (RTC memory, ULP coprocessor, etc). An STM32L-series (low-power line) in STOP mode can get down into the tens of nanoamps to low microamps range — an order of magnitude better.
For a device that wakes up once a day to report a value, that gap barely matters. For something sampling every few seconds over months on a coin cell, it's the whole design.
Wireless stack overhead
The ESP32's Wi-Fi/BLE radio is convenient but expensive to wake: association and TX can spike current into the 100-300mA range for tens to hundreds of milliseconds. If your duty cycle is dominated by radio wake events rather than sensor sampling, that spike — not the sleep current — usually dominates your battery budget. Run the numbers with something like a power budget calculator before committing to a wake interval.
STM32 has no built-in radio, so you pair it with a purpose-built low-power radio (LoRa, BLE module, sub-GHz) and get to choose exactly how much RF you're paying for.
Toolchain and development speed
- ESP32: Arduino-core or ESP-IDF, huge community, fast to prototype, OTA updates are well-trodden.
- STM32: HAL/LL or bare-metal register work, STM32CubeMX for peripheral config, steeper learning curve but tighter control over power states.
Recommendation
- Prototyping speed and built-in connectivity matter more than sleep current → ESP32.
- Multi-month-plus battery life on a coin cell or small LiPo, and you're willing to add an external radio → STM32L series.
I've shipped both. The ESP32 heat-stress monitor concept I originally prototyped on ATmega8 later moved to ESP32 once Wi-Fi reporting became a requirement — the sleep current tradeoff was worth it once the reporting cadence was hourly rather than continuous.
ESP32-WROOM-32 DevKit[aff] is what I reach for on most prototypes — cheap, well-documented, and the built-in USB-serial saves a programmer.
Disclosure: links marked [aff] are affiliate links. I only recommend parts I've actually used.