Home / Arduino & Microcontrollers / ESP32 vs STM32: Choosing Your Next Microcontroller

ESP32 vs STM32: Choosing Your Next Microcontroller

Arduino & Microcontrollers ✍ Oliver Adam ⏱ 9 min read August 20, 2026

The ESP32 wins prototypes with built-in WiFi and a joyful ecosystem. The STM32 line wins products with precise peripherals, deep datasheets and scalable power. Choosing between them is choosing what your project values most.
> At a glance: 9 minute guide · part of the Arduino complete guide track · worked example, quick-reference table and field notes included.

## Where the ESP32 shines

Dual-core 240 MHz, WiFi and Bluetooth included, Arduino and ESP-IDF toolchains. A hobby ecosystem that has solved almost every common problem already. For anything connected — sensors, dashboards, home automation — development speed is unmatched per dollar.

## Where STM32 earns its place

The family spans from 48 MHz workhorses to 480 MHz monsters, with genuinely superior timers, ADCs (12–16 bit), DACs, and communication peripherals. STM32Cube tools, exhaustive errata and long-term availability make it the default in industrial products where precision and supply certainty matter.

## Power, precision, product

ESP32 deep sleep is excellent but radio-off active draw still outpaces an STM32L ultra-low-power part by an order of magnitude. STM32 ADCs and analog peripherals deliver measurement quality the ESP32 cannot match. Conversely, adding WiFi to an STM32 means a module, cost and certification — the ESP32 carries its own.

| Aspect | ESP32 | STM32 |
| — | — | — |
| Wireless | Built-in WiFi/BT | External module needed |
| ADC quality | 12-bit, noisy | 12–16 bit, precise |
| Low power | Good deep sleep | Class-leading (L-series) |
| Ecosystem | Hobby-rich | Professional-grade |
| Best role | Connected prototypes | Precision products |

## How to apply this in your build

Work through the sequence below. Each step assumes the previous one passed. The numbers that need arithmetic are covered by the linked tools at the end of this guide.
1. List whether wireless, analog precision or ultra-low power leads
2. Prototype connected ideas on ESP32 without guilt
3. Move to STM32 when ADC quality or power budgets demand
4. Reuse architecture, not code, when migrating families

### Worked example

A battery soil node lasted 5 months on ESP32 deep sleep. The redesign on an STM32L0 with sub-µA stop mode projected 3 years — wireless was optional, so the family changed. Cross-check with the Battery Life Calculator and the result should agree to within rounding.

> Practical note from the bench. Our shelf rule: ESP32 for proving ideas fast, STM32 when the datasheet’s analog page becomes the product page.

## Who this guide is for

First-time readers get a single focused topic instead of a textbook chapter, with every term defined where it first appears. Returning readers use it as a reference. The table, the worked example and the mistake list answer the questions that come up mid-build. If you teach, the structure (theory, application, example, failure modes) maps cleanly onto a lab session.

## Prerequisites and preparation

Before starting. List whether wireless, analog precision or ultra-low power leads and prototype connected ideas on esp32 without guilt. Keep the [Battery Life Calculator](/tools/battery-life) open, every number in the worked example is reproducible. Total time including the bench steps: about 7 to 9 minutes.

## Common mistakes to avoid

Each of these has cost real hardware on someone’s bench, usually ours:
– Blaming the ESP32 ADC for noise in precision designs — pick the part for the measurement
– Assuming Arduino sketches port cleanly to STM32 HAL
– Certification-blind WiFi modules on STM32 products

## Key takeaways

Where the ESP32 shines — the foundation of this guide; revisit it if any measurement here surprises you.
Where STM32 earns its place — the foundation of this guide. Revisit it if any measurement here surprises you.
Power, precision, product — the foundation of this guide; revisit it if any measurement here surprises you.

### Quick reference card

| Aspect | Where to find it in this guide |
| — | — |
| Core theory | Where the ESP32 shines |
| Application steps | How to apply this in your build |
| Worked numbers | Worked example |
| Failure modes | Common mistakes to avoid |

## How this fits the Arduino complete guide track

This guide is one stop in a structured path. Start from the [Arduino complete guide](/tutorial/arduino-complete-guide) pillar page for the full map, or continue with [ESP32 first steps](/tutorial/esp32-getting-started) and [embedded fundamentals](/tutorial/what-is-embedded-system). For the arithmetic, open the [Battery Life Calculator](/tools/battery-life).

## Frequently asked questions

Which is better for beginners?
ESP32 — the wireless playground and tutorial depth shorten every learning loop.

Can STM32 do WiFi?
Yes, via modules (ESP32 co-processor, W-Fi modules) — factories do it daily, at integration cost the ESP32 already paid.

Is there a calculator for this?
Yes, the [Battery Life Calculator](/tools/battery-life) run the formulas from this guide instantly, client-side, no signup.

## Related guides and tools

– The complete arduino & microcontrollers guide: [Arduino & Microcontrollers complete guide](/tutorial/arduino-complete-guide)
– Read next: [what is an embedded system? microcontrollers in everything](/tutorial/what-is-embedded-system)
– Also in this track: [arduino ide 2 setup: from download to first upload](/tutorial/arduino-ide-setup-guide)
– Continue with: [arduino gpio: pin capabilities, limits and safe usage](/tutorial/arduino-gpio-pinout-guide)
– Calculate as you go: [LED series resistor finder](/tools/led-resistor) · [battery runtime estimator](/tools/battery-life) · [555 frequency calculator](/tools/timer-555-astable)
– From here, the natural continuation is the next guide in the track index. It assumes exactly the vocabulary this page built and adds the next layer of practice.

## Verification routine

The fastest way to internalise this topic is to change one variable deliberately and predict the result before measuring. Wrong predictions are the curriculum, they show exactly which mental model needs revisiting, and the bench grades honestly.

Component substitution is a legitimate experiment as long as it is deliberate. Swap one part, predict the effect, measure, and record. That single habit converts a parts bin into a teaching lab and makes every future guide in this track faster to absorb.
## Formulas and checks from this guide

Verification checklist for this track. Check pin assignments against the sketch header before wiring, confirm supply polarity twice. Serial-print one variable at a time when debugging. Keep each sketch’s pin map in a comment block so the next build inherits working documentation.

Bookmark this page against your next build in the track. The checklist above is the same one used across 15 guides in this series.

## Notes from the bench

Anything with motors, servos or many LEDs needs external supply with common ground. USB is for logic only.

Uninitialised variables and pins left floating. Set every pinMode and initial state in setup.