ESP32 vs STM32: choosing for a connected product
ESP32 vs STM32 for a connected product: how we weigh radio, power, analogue, security and supply before choosing a microcontroller.

Most connected products we scope end up on one of two microcontroller families, and the ESP32 vs STM32 question usually arrives early, often before anyone has written down what the device must actually do. Founders tend to come with a preference picked up from a dev kit or a previous team. That is a reasonable starting point, but it is not a decision.
This post is for founders, product managers and engineers who need to commit to a platform without regretting it at the prototype stage. We will walk through the trade-offs we weigh, where each family clearly wins, and the cases where the honest answer is both.
Start with the radio, not the chip
The single biggest factor is connectivity. Espressif’s parts are built around an integrated 2.4 GHz radio: Wi-Fi and Bluetooth LE on the ESP32-S3 and ESP32-C3, with the ESP32-C6 adding Wi-Fi 6 and an 802.15.4 radio for Thread and Zigbee. If the product talks to a home or office network, that integration is hard to beat on cost and board space.
The STM32 range covers connectivity differently. Most STM32 parts have no radio at all, which is exactly right for a device that reports over a cellular modem, RS-485 or a wired fieldbus. Where a radio is needed, there are dedicated families: the STM32WB for Bluetooth LE and 802.15.4, and the STM32WL with an integrated sub-GHz transceiver suitable for LoRa. If you have not settled the radio yet, our post on picking between BLE and LoRa before picking the chip covers that decision first.
A rough rule we use:
- Wi-Fi is required — an ESP32 variant is usually the default.
- Sub-GHz or LoRaWAN — STM32WL, or an STM32 with an external transceiver.
- BLE only, battery powered — both work; STM32WB and Nordic’s nRF52840 are often a better fit than an ESP32 for long battery life.
- Cellular or wired — a general-purpose STM32 with the modem or transceiver alongside.
Power budget: where ESP32 vs STM32 diverge most
Low-power behaviour is where the two families feel most different on the bench. An STM32L4 or STM32U5 in a Stop mode with the RTC running typically draws in the low single-digit microamps, and its deeper Standby and Shutdown modes go well below that, at the cost of losing most state. The chip can also wake, sample a sensor and go back to sleep in a few milliseconds while drawing modest current.
ESP32 deep sleep on the chip itself is typically in the order of ten microamps, depending on the variant and which RTC peripherals stay powered. The bigger issue is everything around it. Wi-Fi transmit bursts reach a few hundred milliamps, association with an access point can take hundreds of milliseconds to a few seconds, and many modules and dev boards add regulators and LEDs that dwarf the chip’s own sleep current. A Wi-Fi device can still run for months on batteries, but only if it connects rarely and the board is designed for it.
The numbers that matter are not the datasheet’s best-case figures but the average over a full duty cycle. We cover how to measure that properly in where the microamps really go in low-power design.
Peripherals, analogue and real-time behaviour
STM32 parts have a deep catalogue of peripherals: advanced timers for motor control and precise PWM, multiple ADCs, comparators, op-amps on some families, DMA everywhere, CAN and USB on many parts. The ADCs are well characterised, and on the L4 family hardware oversampling can extend effective resolution for slow signals. For measurement-heavy products, that analogue front end often decides the question on its own.
ESP32 parts have a capable but more general set: SPI, I²C, UART, I²S, a flexible GPIO matrix, an LCD and camera interface on the S3, and a USB interface on several variants. Their ADCs are usable with calibration, but we would not pick them for precision measurement; an external ADC is the usual answer if accuracy matters.
Timing is the other consideration. On an ESP32 the Wi-Fi and Bluetooth stacks run on the same cores as your application, so hard real-time work needs careful task priorities, interrupt placement or offloading to peripherals. On an STM32 without a radio, the timing is entirely yours, which makes deterministic control loops easier to reason about.
Firmware ecosystem and security features
Espressif’s ESP-IDF is a mature framework built on FreeRTOS, with Wi-Fi, BLE, TLS, OTA and provisioning components included. Getting a device onto a network and talking to a cloud backend is fast. The trade-off is that you work inside Espressif’s structure, and the binary sizes reflect a full network stack.
ST’s tooling is STM32CubeMX for configuration, HAL and LL drivers, and a range of middleware. It is closer to the metal and more work to bring up a network stack, but gives tighter control over memory and startup. Both families are supported by Zephyr, which can help if you want to keep the option of moving between vendors.
On security, both offer the fundamentals for a production device:
- ESP32: secure boot and flash encryption, with keys held in eFuses. These are one-way settings, so the production procedure must be tested on sacrificial boards first.
- STM32: readout protection and secure boot options across many families, with TrustZone on Cortex-M33 parts such as the STM32U5.
Whichever you pick, plan secure boot and OTA together from the start rather than bolting them on before launch.
Certification, cost and supply
Pre-certified ESP32 modules are a major practical advantage. Using a module with existing modular approvals reduces RF certification work under CE RED and FCC Part 15, though the finished product still needs its own assessment. Designing a chip-down radio on either family means more RF layout, tuning and test effort.
On unit cost, an ESP32 module that includes radio, flash and antenna is often cheaper than an STM32 plus a separate radio module. Without a radio requirement, a small STM32 is cheaper and simpler than either. On supply, ST publishes longevity commitments for many STM32 families, which matters for industrial products with long lifetimes. Whichever you choose, check availability and lifecycle status for the exact part number, not just the family.
| Factor | ESP32 family | STM32 family |
|---|---|---|
| Wi-Fi | Integrated | External module needed |
| Deep sleep current | Around 10 µA, board-dependent | Low single-digit µA or less |
| Analogue and timers | General purpose | Extensive, well characterised |
| Network stack | Included in ESP-IDF | Integrate yourself or via middleware |
| RF certification | Easier with pre-certified modules | Depends on radio choice |
When the answer is both
A common and sensible architecture uses an STM32 as the main controller and an ESP32 module as a Wi-Fi coprocessor, connected over UART or SPI. The STM32 handles sensing, control and low-power sleep; the ESP32 is powered down until there is something to send. This costs board space and a second firmware image, but it separates the timing-critical work from the network stack and lets each chip do what it is good at.
The same pattern works the other way round: an ESP32 running the user interface and connectivity, with a small STM32 handling a motor or precise measurement. Two chips mean two OTA paths, so plan how both get updated in the field.
What we would do
Before committing to a platform, we write down the answers to a short list of questions:
- Which radios are mandatory, and which are nice to have?
- What is the power source, and what is the target battery life at a realistic reporting interval?
- Are there precision analogue, motor control or hard real-time requirements?
- Which certifications are needed, and can a pre-certified module cover the radio?
- What is the expected production volume and product lifetime?
- Who will maintain the firmware, and which toolchain do they already know?
If Wi-Fi is central and power is not tight, we usually start on an ESP32. If battery life, measurement quality or long-term supply dominate, we start on an STM32. If the list points both ways, we prototype the two-chip architecture early, before the PCB layout fixes the choice for us.