Open this lesson in your favourite AI. It'll walk you through the why, explain the demo, and quiz you on the try-it list.
Picking the wrong MCU is the single most expensive mistake in IoT product design: it sets your power budget, your toolchain, your radio options, and your unit cost for the next five years. The market today splits into four practical camps — AVR / PIC (legacy 8-bit, Arduino Uno class), ARM Cortex-M (STM32, NRF52, SAMD — the mainstream professional choice), ESP32 family (Wi-Fi + BLE on-die, dominant in maker and Asian consumer IoT), and RP2040 (Raspberry Pi's dual-core M0+, increasingly the hobby default). The way to choose isn't 'which one is best' — it's 'which one fits the four constraints my product cares about: cost, power, radio, ecosystem.'
Side-by-side spec sheet for the four families.
Use these three in order. Each builds on the one before.
In one paragraph, explain what a microcontroller is and how it differs from a general-purpose CPU like the one in a laptop.
Walk me through what happens when an ESP32 wakes from deep sleep, including which peripherals are still powered, where the program counter resumes, and how it re-establishes Wi-Fi.
Given a battery-powered asset tracker that must run for 3 years on a single CR2032 coin cell and report GPS location once a day over LTE-M, which MCU family would you choose and what compromise would you make on the other three constraints?
Family ATmega328P STM32F4 ESP32-WROOM-32E RP2040
(Arduino Uno) (Cortex-M4) (Tensilica LX6) (Cortex-M0+ x2)
─────────────────────────────────────────────────────────────────────────────────
Cores 1 1 2 2
Architecture 8-bit AVR 32-bit ARMv7E-M 32-bit Xtensa 32-bit ARMv6-M
Clock 16 MHz 84-180 MHz 240 MHz 133 MHz
Flash 32 KB up to 2 MB 4 MB (external) no on-chip
(uses ext. QSPI)
RAM 2 KB 128-256 KB 520 KB 264 KB
FPU ✗ single-precision ✗ (LX6) ✗
Wi-Fi ✗ ✗ (add module) ✓ (built-in) ✗ (add module)
Bluetooth ✗ ✗ (add module) ✓ BLE 4.2 ✗
ADC 10-bit 12-bit 12-bit (noisy) 12-bit
USB ✗ (need FTDI) USB FS/HS ✗ (need bridge) ✓ FS device + host
Cost (chip, 1k) ~$2 ~$5-15 ~$2-4 ~$1
Toolchain Arduino IDE, STM32CubeIDE, Arduino, ESP-IDF, Arduino, Pico SDK,
avr-gcc arm-none-eabi-gcc PlatformIO CircuitPython
Sleep current 0.1 µA 0.3-2 µA ~10 µA deep ~1 mA (no deep
~150 µA modem sleep on chip)
Killer use case Teaching; Real industrial Wi-Fi/BLE-needed Hobby, USB devices,
simple sensors / safety / RT consumer IoT PIO state machines
DECISION MATRIX
───────────────
Need Wi-Fi or BLE on the chip itself? → ESP32, NRF52 (BLE), or add a module
Need very low sleep current (years on battery)? → STM32L, NRF52, ATmega328P
Need professional ecosystem (debugger, RTOS)? → STM32 (Cortex-M)
Cheap and good enough? → RP2040 or ESP32
Safety-critical / regulated industry? → STM32 / NXP / TI (mature M-class)