Choosing Microcontrollers for IoT Projects
How to pick an MCU for an IoT build — radio first, then a real power budget, memory, toolchain, and certification — with sleep-current comparisons and worked battery math.
By Velloreth
The fastest way to choose the wrong microcontroller is to open a comparison table sorted by clock speed. IoT devices are rarely limited by compute. They are limited by radio availability, battery capacity, and the amount of RAM a network stack can eat — and those three questions usually point at a shortlist before you have compared a single core.
Here is the order that works: radio first, power budget second, then memory, peripherals, toolchain, and the production concerns nobody thinks about until the first order ships.
Start with the radio, because it decides the chip
The communication requirement eliminates most candidates immediately:
| Connectivity | Typical candidates | Notes |
|---|---|---|
| Wi-Fi | ESP32 family (S3, C3, original) | Only realistic option at this price point; needs a power supply or a large battery |
| BLE / Bluetooth Mesh | nRF52840, nRF52832, STM32WB | Built for coin cells; phone proximity is the use case |
| LoRa / sub-GHz | SX1262 or SX1276 paired with an STM32L or nRF52 | Long range, low data rate, duty-cycle limits |
| Thread / Zigbee | EFR32, CC2652, nRF52840 (Thread) | Mesh for home and building automation |
| LTE-M / NB-IoT | nRF9160, or a cellular modem module | No local gateway needed; the power budget is dominated by the modem |
| None (BLE provisioning, SD card, USB) | STM32L0/L4/U5, AVR, RP2040 | The cheapest and longest-lived option |
Note that “none” is a legitimate answer. A data logger that stores readings locally and is collected monthly needs no radio at all, and every component you remove is one less thing to power, certify, and debug.
If the device must talk to a phone, BLE is usually enough — most people reach for Wi-Fi out of habit. If it must reach a server directly and there is mains power, Wi-Fi is fine. If it is outdoors, battery powered, and far from infrastructure, sub-GHz or cellular, and the MCU should be chosen to match the radio’s host interface rather than the other way around.
The power budget: do the arithmetic early
Battery life is not a mystery; it is division. Take one duty cycle, cost each state, and average.
Say a sensor wakes every 60 seconds, measures for 10 ms at 5 mA, transmits for 10 ms at 40 mA, and sleeps the rest of the time:
sleep: (current_sleep * 59.98 s) / 60
measure: (5 mA * 0.010 s) / 60 = 0.83 uA
transmit:(40 mA * 0.010 s) / 60 = 6.7 uA
Now put three candidate sleep currents into that model, on a 220 mAh coin cell:
| Sleep current | Average current | Approximate life |
|---|---|---|
| 0.4 µA (nRF52-class, System OFF) | 8.5 µA | ~2.9 years |
| 10 µA (ESP32-class deep sleep) | 17.5 µA | ~1.4 years |
| 100 µA (poorly configured sleep) | 108 µA | ~84 days |
Two lessons hide in that table.
The sleep current decided the outcome — the MCU did nothing except sleep, and it determined whether the product lasts one year or three. This is the case for sensors, trackers, and meters, which spend over 99% of their lives asleep.
But radio bursts can dominate instead. Raise transmit current to 100 mA for those same 10 ms and the transmit term alone contributes 16.7 µA of average, more than doubling the total. At that point, dropping TX power by 3 dB or lengthening the reporting interval helps more than shaving another microamp off sleep. Run the numbers for your own duty cycle before optimizing the wrong term.
Typical sleep figures for orientation, straight from the families’ datasheet ranges:
| Part class | Sleep / standby | Notes |
|---|---|---|
| nRF52840, System OFF | ~0.4 µA | Rises to roughly 1.5–8 µA with RAM retention and wake sources enabled |
| STM32L4, Stop 2 | ~1–2 µA | Standby with RTC is sub-microamp |
| ESP32, deep sleep | ~10 µA | Some configurations and variants run higher; the Wi-Fi subsystem does not disappear |
| ESP32-S3, deep sleep | ~5–10 µA | Similar class to the original |
Treat these as order-of-magnitude guidance and read the datasheet for the exact part and mode — sleep current depends heavily on which clock, RTC domain, and wake sources you leave running.
Memory: the constraint people get wrong
Compute is rarely the problem. RAM is.
A TLS handshake plus an established connection can consume tens of kilobytes of RAM. An RTOS kernel, network buffers, and a small application stack add more. If you plan to run MQTT over TLS with room for your code, budget at least 128 KB of RAM and 512 KB of flash as a floor, then check your framework’s actual requirements — they vary.
The flash side has a second consumer: OTA updates need a second image slot. If your update mechanism requires a rollback image, the usable application space is roughly half the total flash. A 1 MB part with a 400 KB application and a filesystem has less headroom than it looks like.
A planning budget for a connected node on a 4 MB flash part:
| Item | Flash | RAM |
|---|---|---|
| Bootloader and partition table | small, fixed | — |
| Two OTA application slots | 2 x 512 KB – 1 MB | — |
| Configuration / key storage | 16–64 KB | — |
| Network stack, TLS buffers | — | 40–80 KB |
| RTOS kernel, idle, system tasks | — | 10–20 KB |
| Your application, queues, buffers | remainder | remainder |
Read it as a warning rather than a specification: the fixed overhead of a bootloader, a rollback slot, and a TLS stack consumes most of a modest part before your first line of application code runs. Doubling your initial RAM and flash estimate is a normal outcome, not pessimism.
Devices without connectivity are far more relaxed: a sensor that samples, filters, and logs can live comfortably in 16 KB of RAM and 64 KB of flash.
PSRAM (on ESP32-S3 and similar) sounds like an answer to tight RAM, but it is external, slower, and power-hungry relative to SRAM. It is useful for cameras and audio buffers, not a substitute for sizing the internal SRAM correctly.
Peripherals and silicon features worth checking
- ADC quality. The stated resolution is not the effective resolution. If you are measuring a battery or a sensor at low amplitude, check effective number of bits, reference options, and whether the ADC is usable while the radio is active.
- Hardware crypto and secure boot. Anything OTA-capable should verify signed images. Parts with a hardware crypto accelerator and a root of trust make that cheaper in both flash and power than a software implementation.
- RTC and low-power timers. These drive the wake-up schedule. A part that can run a periodic wake source while everything else is off is the difference between 1 µA and 100 µA.
- GPIO states during sleep. Pins float unless you configure them, and a floating input can sit at an indeterminate level that burns current through the input buffers. Check what happens to your board’s LED anodes and enable pins when the MCU sleeps.
- Brownout and power-on behavior. Coin cells have high internal resistance; a transmit burst can sag the rail enough to brown out the MCU. Check the brownout detector threshold against your cell’s behavior, and add bulk capacitance.
Interfaces and board integration
Before committing, check that the part has enough of the right buses for the board you intend to build:
- I2C for sensors and configuration devices: cheap in pins, slow in bandwidth, and easy to share — but every device on the bus needs a unique address, and address conflicts between two identical sensors are common. Verify you can change an address with a strap pin, or budget for an I2C multiplexer.
- SPI for displays, SD cards, and radio modules: fast, but each device needs its own chip-select line and its own set of pins. A display plus a radio plus a flash chip adds up quickly.
- UART for debugging and for a companion radio or cellular modem. Keep at least one free; it is the interface you will use when everything else has failed.
- ADC channels and PWM outputs for anything analog or motor-driven, with attention to whether the timer you need for PWM conflicts with the one driving your sample rate.
- Pin count with margin. The first board never has spare pins; the second revision always needs two more. Choose a package that leaves a few GPIOs free, and check which pins are boot-strapping pins — on ESP32-class parts, several GPIOs determine boot mode or voltage domains at reset, so tying them to a peripheral that drives the wrong level at startup produces a board that will not enter your firmware.
Also confirm the part’s operating voltage matches your sensors. A 1.8 V-only part will not talk directly to 3.3 V peripherals without level shifting, and mixing 1.8 V and 5 V logic on one board adds parts and failure modes you did not budget for.
Toolchain and ecosystem: the cost you pay daily
Specification sheets describe the chip. You will spend your days in the toolchain.
Questions that matter more than megahertz:
- Is there a vendor SDK with examples for your exact use case? ESP-IDF and the nRF Connect SDK (Zephyr) are both mature; smaller vendors may leave you writing register-level code.
- Can you debug? A proper SWD/JTAG probe with breakpoints and a live variable watch will save you more time than any feature on the datasheet. Bootloader-and-serial printf debugging does not scale past the first intermittent fault.
- Does the RTOS and library ecosystem support it? Check that the network stack, filesystem, and any drivers you need are supported on the target — not just ported by someone in 2021.
- Is there documentation for the parts you will actually touch? Reference manuals with working register examples beat community tutorials that reference an older silicon revision.
- How big is the community? For a solo project, a chip with thousands of working examples and answered questions is a real productivity multiplier.
For a first IoT prototype, an ESP32 variant with the Arduino or ESP-IDF toolchain is defensible purely on the strength of how much working code already exists. Move to a lower-power part when the power budget demands it, not before.
Production concerns: certification, supply, and modules
Three things that change the decision once you are shipping rather than prototyping.
Radio certification. A pre-certified module (FCC/CE modular approval) carries its own RF certification, and in many jurisdictions you can integrate it under that approval with far less testing than a custom PCB antenna and matching network. Designing RF from scratch means layout discipline, an antenna keep-out, impedance-controlled traces, and a test budget. For volumes under tens of thousands, the module usually wins on total cost regardless of the per-unit price difference.
Second sourcing. Chip shortages are not a hypothetical. Prefer parts and modules available from more than one distributor, with a pin-compatible alternative identified before you need it. A design locked to a single part with an eight-month lead time is a supply chain risk, not an engineering choice.
Lifecycle status. Check that the part is not marked NRND or nearing end of life before you commit a board to it. Migrating an MCU later is not a drop-in operation: different flash loaders, different clock trees, different errata.
Board-level power: where the microamps actually go
Teams agonize over MCU sleep current and then lose the gains on the board. The sleeping chip is often not the biggest load:
- Pull-up resistors. A 10 kΩ pull-up sitting at 3.3 V with its input low draws 330 µA — more than double the worst sleep figure in the table above. Inputs that idle low through a pull-up, LED indicators left enabled, and level-shifter pull-ups are classic offenders. Make sure every pull-up is doing work while the device sleeps, or gate them.
- Regulator quiescent current. A linear regulator costing 50 µA to stay enabled will dominate a 1 µA MCU. Choose a low-Iq part, or bypass it when sleeping.
- Sensor standby current. Many sensors advertise microamp standby and milliamp active; others advertise nothing and draw continuously. Power-gate sensors that lack a shutdown pin with a load switch.
- PCB leakage. Flux residue and humidity create leakage paths between rails. Clean the board, and do not route 3.3 V and ground in adjacent traces across a long span with residue between them.
Measure, do not assume. A cheap USB power meter cannot see microamps, but a bench supply with a current readout or a dedicated µA-range measurement tool will tell you what your sleeping board really draws — and the answer is frequently not what the datasheet promised.
Matching MCU to scenario
| Scenario | Sensible default |
|---|---|
| Mains-powered gateway or camera | ESP32-S3 (Wi-Fi), or an SBC if you need Linux |
| Coin-cell sensor reporting every minute | nRF52840 or STM32L4, with a sub-GHz or BLE radio |
| Outdoor LoRa node on solar | SX1262 + STM32L0/L4 or nRF52; size the panel for the transmit duty cycle |
| BLE beacon or wearable | nRF52840 |
| Cellular tracker with no local infrastructure | nRF9160 or a certified LTE-M module |
| Data logger with no connectivity | STM32L0/L4, AVR, or anything with enough flash and low sleep current |
| First prototype, deadline this week | ESP32 DevKit, Arduino or ESP-IDF |
The last row deserves emphasis: a prototype’s job is to answer questions quickly, and a board with abundant examples, USB, and Wi-Fi does that better than the theoretically optimal part. Design the power budget into the second revision, or design the node to accept either MCU if the layout permits.
Whichever chip you pick, write the power budget before the schematic — average current, battery capacity, and target life — and revisit it after the first board is measurable. That single document settles most microcontroller arguments, because it turns a preference into arithmetic.