Arduino IDE vs PlatformIO vs ESP-IDF vs MicroPython: Which ESP32 Environment Should You Use?

Last updated: 2026-11-22

Pick Arduino IDE if you are starting out and want the fastest first blink. Pick MicroPython if you know Python and want the fastest learning loop. Pick PlatformIO when your project grows past one board or one sketch. Pick ESP-IDF when you ship a product or need every feature the chip offers. The rest of this guide proves it: what each environment is, how setup, debugging, libraries, and speed compare, and the same blink and button program written in each one.

Table of contents

What is Arduino IDE?

Arduino IDE is the simplest way to program an ESP32: a free editor from Arduino, currently version 2.3.x, with one job: open a sketch, pick a board and a port, and upload. There is no project file, no build system, and no terminal to open. You write C++ with the Arduino functions you already know, and the IDE compiles it and flashes it.

Setup takes about ten minutes. Download Arduino IDE from the Arduino software page, then teach it about ESP32 boards: open File, Preferences, and paste Espressif's board manager URL, https://espressif.github.io/arduino-esp32/package_esp32_index.json, into the Additional boards manager URLs field. Open the Boards Manager, search for esp32, and install esp32 by Espressif Systems. Do not install Arduino ESP32 Boards by Arduino; that package only covers Arduino's own boards such as the Nano ESP32. The current Arduino-ESP32 core is 3.3.12, based on ESP-IDF 5.5.5. The full walkthrough, board by board, is in the Arduino IDE ESP32 setup guide.

Arduino IDE is best for a first board, a first sketch, a classroom, and any project that fits in one file. It holds one sketch per window and one board at a time, its Library Manager installs libraries globally, and there is no unit testing or per-project version pinning. When a library update breaks an old sketch, you find out at compile time.

What is PlatformIO?

PlatformIO is a professional build system that lives inside VS Code. It is free and open source, and the current release is PlatformIO Core 6.2.0. You still write Arduino C++ if you want to, but the project is defined by a text file called platformio.ini, which records the board, the framework, and every library version. The same project builds the same way on any computer, and you can keep the file in version control next to your code.

A minimal platformio.ini for a DevKit V1 looks like this:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200

Change framework = arduino to framework = espidf and the same project builds against Espressif's native framework instead. One project can hold several environments, so a DevKit V1, an S3 DevKitC-1, and a C3 SuperMini can all build from the same folder. Libraries are declared per project with lib_deps, and PlatformIO downloads the exact versions you named. The full walkthrough is in the PlatformIO ESP32 setup guide.

One version warning, because old tutorials get this wrong: before platform 8.x, the official PlatformIO platform topped out at 6.12.0 with Arduino core 2.0.17, and 3.x needed a community fork called pioarduino. Platform 8.0.0 ships Arduino core 3.3.12, and the sketch in this guide compiled against it. If a tutorial tells you to pin platform = [email protected], it is out of date.

PlatformIO is best when your project grows past one board, when you want reproducible builds or real debugging, or when you already live in VS Code. It costs about thirty minutes to set up the first time, and for a single blink sketch it is overkill.

What is ESP-IDF?

ESP-IDF is Espressif's own framework for the ESP32, written in C. It is the layer everything else sits on: the Arduino core is built on ESP-IDF, and PlatformIO can build ESP-IDF projects directly. With ESP-IDF you talk to the chip with no middleman, so every peripheral, every power mode, and every Wi-Fi and Bluetooth option is available, usually months before it reaches the Arduino core.

The current stable release is ESP-IDF 5.5. Install it with the ESP-IDF Installation Manager, or clone it with git clone -b v5.5 --recursive https://github.com/espressif/esp-idf.git and run ./install.sh. A project starts from the hello_world example, and the commands you will use most are idf.py set-target esp32, idf.py menuconfig, idf.py build, idf.py flash, and idf.py monitor. The menuconfig step opens a text menu for the chip, flash size, Wi-Fi settings, and hundreds of other options, and the VS Code ESP-IDF extension (version 2.0 or newer) finds your installation automatically. The full first project is in the ESP-IDF first project guide.

ESP-IDF is best for a product you will ship, for battery work where every milliamp matters, for code that needs the newest chip features, and for learning how the ESP32 really works. It is the hardest of the four: no single-click upload, no simplified pin functions, and a slower build. One measured comparison on an ESP32-S3 took 21.8 seconds for a clean ESP-IDF build against 5.9 seconds for the same blink in Arduino, but the firmware was the smallest of the four, 211,541 bytes against 288,426 for Arduino. Do not put spaces in your ESP-IDF project path; the build system does not support them.

What is MicroPython?

MicroPython is Python 3 running on the microcontroller itself. You flash the firmware onto the board once, and after that there is no compile step at all. You type Python at a live prompt called the REPL, and the board answers at once. You save your program as main.py, the board runs it at boot, and editing a line means copying the file again.

Setup takes about fifteen minutes. Download the firmware for your board from the MicroPython download page; the current release is 1.29, with 1.28 the release before it. Erase the flash with esptool.py erase_flash, then write the firmware with esptool.py --baud 460800 write_flash 0x1000 ESP32_GENERIC-20260406-v1.28.0.bin, using your own filename and port. Thonny can do the whole flash for you, and mpremote repl opens the prompt from a terminal. The full walkthrough is in the MicroPython ESP32 getting started guide.

MicroPython is best if you already know Python, if you are teaching, if you are prototyping a sensor or a web page, or if you want to test hardware by typing commands. It is not for hard real-time work or code that must run at full speed: Python on the board is interpreted, so tight loops run roughly 10 to 20 times slower than the same logic in C, and one benchmark measured a GPIO toggle at about 50 kHz in MicroPython against about 1 MHz in C++. The interpreter also takes RAM and flash, so big buffers and camera frames run out sooner, though boards with PSRAM give MicroPython far more headroom. For reading a sensor every few seconds or sending an MQTT message, the speed never matters. For bit-banging a fast protocol, it does.

The four environments at a glance

Arduino IDE PlatformIO ESP-IDF MicroPython
Language C++ (Arduino functions) C++ (Arduino or ESP-IDF) C Python 3
Editor Arduino IDE 2.3.x VS Code VS Code or terminal Thonny or VS Code
Setup time, first time About 10 minutes About 30 minutes About 30 to 60 minutes About 15 minutes
First blink Board URL, install core, upload New project, platformio.ini, upload Install IDF, set target, build, flash Flash firmware, save main.py
Debugging Serial Monitor, exception decoder Breakpoints, JTAG, variable watch Breakpoints, JTAG, GDB REPL, print, Thonny debugger
Libraries Global Library Manager Per-project lib_deps, pinned versions Components, IDF Component Manager micropython-lib, frozen modules
Multi-board projects One sketch, one board Several environments in one project One target per build One board per session
Unit tests No Yes, built in Yes, with Unity No, test by hand
Code speed Full speed Full speed Full speed, smallest firmware 10 to 20 times slower in tight loops
Learning curve Easiest Medium Steepest Easiest if you know Python
Best for First board, classroom Growing projects, teams Products, low power, new features Learning, prototyping, sensors
Not for Multi-board or versioned work A single quick blink A first project Hard real-time, fast bit-banging

How does debugging compare?

Debugging is where the four environments split most clearly. Arduino IDE gives you the Serial Monitor and the exception decoder, which prints a readable stack trace when your sketch crashes. Its built-in debugger exists, but for ESP32 it is limited: it is built on Cortex-Debug, which targets ARM Cortex cores, while the ESP32 uses Tensilica cores and the C3 and C6 use RISC-V. The ESP32-S3 can debug over its built-in USB JTAG connection, but the support that landed in Arduino IDE 2.3.0 was rough at first and still needs a compatible board definition. In practice, most ESP32 work in Arduino IDE is still Serial.print debugging.

PlatformIO and ESP-IDF debug properly. Both use OpenOCD and GDB over JTAG, so you can set breakpoints, step through code, and watch variables change. On the S3 the built-in USB JTAG works with no extra probe; on the original ESP32 you need an external JTAG adapter such as an ESP-Prog. This is the single biggest reason to move a stubborn project from Arduino IDE to PlatformIO: when Serial.print stops telling you enough, a breakpoint will.

MicroPython debugs differently. There is no compiled firmware to step through, so you debug by talking to the board: type a line at the REPL and see the answer, print values as the program runs, and use Thonny's debugger to step through Python lines. For sensor work this is often faster than a breakpoint.

How does library management compare?

Arduino IDE installs libraries globally through its Library Manager. That is simple until two projects want two versions of the same library, and then it is a problem, because there is only one installed copy. The library install guide shows both sides of this: the Arduino IDE steps and the PlatformIO steps, side by side.

PlatformIO pins every library in platformio.ini with lib_deps, so each project carries its own exact versions and a teammate gets the same build. ESP-IDF does the same with components and the IDF Component Manager, versioned against the ESP-IDF release you use. MicroPython has the smallest library story: the micropython-lib collection covers the common drivers, and anything unusual you write yourself in Python. For a project with more than a handful of dependencies, per-project pinning is the difference between a build that works twice and a build that works once.

How fast is the code in each environment?

Arduino, PlatformIO with the Arduino framework, and ESP-IDF all compile to native code, so they run at full speed. The difference between them is firmware size and build time, not runtime speed. One measured comparison on an ESP32-S3 built the same blink program three ways: Arduino took 5.9 seconds and produced 288,426 bytes, ESP-IDF took 21.8 seconds and produced 211,541 bytes, and MicroPython had no compile step, copying a 217-byte main.py onto a 1,783,296-byte firmware image.

MicroPython is the slow one at runtime, and you should know the size of the gap before you choose it. In tight loops it runs roughly 10 to 20 times slower than the same logic in C, and one benchmark measured a GPIO toggle at about 50 kHz in MicroPython against about 1 MHz in C++. Reading a temperature sensor every five seconds, serving a small web page, or sending an MQTT message never notices the gap, because the waiting time dwarfs the compute time. Bit-banging a fast protocol, driving WS2812 LEDs by hand, or sampling an ADC at high speed does notice it. MicroPython has two escapes for hot code: the @micropython.native and @micropython.viper decorators compile a function to machine code, and the hardware peripherals (PWM, SPI, I2C, UART, RMT) run at full speed in any language.

Memory follows the same pattern. The MicroPython interpreter and its heap take a share of the ESP32's RAM, so large buffers and big JSON documents run out sooner than in C. Boards with PSRAM give MicroPython far more headroom. The garbage collector can also pause your program briefly, which is one more reason MicroPython is not for hard real-time work.

Which one should you pick?

If you are… Pick… Because…
Holding your first ESP32 Arduino IDE Fastest first blink, most tutorials, least to learn; same functions if you come from an Uno
A Python programmer MicroPython No new language, instant REPL feedback
Teaching a class or a club Arduino IDE or MicroPython Both give a result in the first session
Prototyping a sensor or a web page MicroPython Edit and run in seconds, no compile wait
Growing past one board PlatformIO One project, several boards, pinned libraries
Working with a team PlatformIO Same build on every computer, version control friendly
Shipping a product ESP-IDF Every feature, smallest firmware, full control
Writing hard real-time code ESP-IDF or Arduino Native code, deterministic timing

If you are still unsure, start with Arduino IDE. It is the default for a reason, and everything you learn there transfers: the same sketch runs in PlatformIO, and the same C++ carries into ESP-IDF when you are ready.

Can you switch environments later?

Yes, and the cost depends on the direction. Arduino IDE to PlatformIO costs nothing: copy the sketch into a PlatformIO project, add a platformio.ini, and it compiles with the same core. An ESP-IDF project does not run in Arduino IDE, and a MicroPython script runs nowhere except on a MicroPython board. PlatformIO to ESP-IDF costs a rewrite, because ESP-IDF uses different APIs for Wi-Fi, GPIO, and tasks, although the C knowledge transfers. MicroPython to anything else costs a full rewrite in C or C++, because Python does not compile to native firmware.

The one switch to avoid is mixing environments in the same project without a plan. Pick one environment per project, keep its files together, and note the versions you used.

The same program in three environments

One program, three listings: it blinks the onboard LED on GPIO 2, watches a push button on GPIO 4, and prints a count each time the button is pressed. The button is wired from GPIO 4 to GND, with the internal pull-up holding the pin HIGH until the button pulls it LOW.

Arduino IDE and PlatformIO use the same C++ sketch. In Arduino IDE, save it as blink-button.ino and upload it. In PlatformIO, save it as src/main.cpp with #include <Arduino.h> at the top, plus the platformio.ini from the PlatformIO section above.

// Blink + button counter - Arduino-ESP32 core 3.x
// Board: ESP32 DevKit V1 (30-pin), onboard LED on GPIO 2, button on GPIO 4
// Wiring: one side of the push button to GPIO 4, the other side to GND.
const int LED_PIN = 2;      // onboard LED on the DevKit V1
const int BUTTON_PIN = 4;   // push button wired from GPIO 4 to GND
int pressCount = 0;
bool lastButtonState = HIGH;

void setup() {
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT_PULLUP);  // button pulls the pin LOW when pressed
  Serial.println("Blink + button counter ready. Press the button.");
}

void loop() {
  digitalWrite(LED_PIN, HIGH);
  delay(500);
  digitalWrite(LED_PIN, LOW);
  delay(500);
  bool buttonState = digitalRead(BUTTON_PIN);
  if (buttonState == LOW && lastButtonState == HIGH) {
    pressCount++;
    Serial.print("Button pressed. Count: ");
    Serial.println(pressCount);
  }
  lastButtonState = buttonState;
}

This sketch compiled in PlatformIO 6.2.0 (espressif32 8.0.0, Arduino core 3.3.12) in 24.92 seconds: 6.7 percent of RAM, 20.5 percent of flash.

MicroPython does the same thing in Python. Save it as main.py on the board; it runs at boot, after boot.py. The REPL stays live, so you can type led.value(1) at the >>> prompt and turn the LED on by hand. This listing was not run on a board during the draft check; it is the same logic as the compiled C++ program above.

# Blink + button counter - MicroPython 1.28+ on ESP32 DevKit V1
# Onboard LED on GPIO 2, button on GPIO 4 wired to GND.
from machine import Pin
import time

led = Pin(2, Pin.OUT)
button = Pin(4, Pin.IN, Pin.PULL_UP)
press_count = 0
last_state = 1

print("Blink + button counter ready. Press the button.")
while True:
    led.value(1)
    time.sleep_ms(500)
    led.value(0)
    time.sleep_ms(500)
    state = button.value()
    if state == 0 and last_state == 1:
        press_count += 1
        print("Button pressed. Count:", press_count)
    last_state = state

ESP-IDF has no listing here: its version needs a full project with a CMake file and a sdkconfig, not a single pasted file. That is the point: ESP-IDF is a project, not a sketch. The ESP-IDF first project guide walks through its hello_world example.

What goes wrong?

Mistake What happens Fix
Installing "Arduino ESP32 Boards" in Arduino IDE Your DevKit board never appears in the board list Install "esp32 by Espressif Systems" from Espressif's board manager URL
Old core 2.x code on core 3.x "invalid conversion" and missing function errors Update the code to the 3.x APIs, or pin core 2.0.17 in a separate install
Forgetting erase_flash before MicroPython Old firmware or settings fight the new flash Run esptool.py erase_flash before the first flash
Overwriting boot.py in MicroPython The board can stop responding and need a reflash Leave boot.py alone; put your program in main.py
Spaces in an ESP-IDF project path The build fails with a path error Move the project to a path with no spaces
Expecting C speed from MicroPython A fast loop or bit-banged protocol misses timing Use hardware peripherals, @micropython.native, or switch to C
Using a charge-only USB cable The board powers on but the port never appears Use a data cable; the upload failed guide covers this

Frequently asked questions

Which environment is best for an ESP32 beginner?

Arduino IDE, unless you already know Python, in which case MicroPython. Both give you a blinking LED in the first session. Arduino IDE has the most tutorials written for it, and the skills transfer directly to PlatformIO later. MicroPython has the fastest feedback loop, because there is no compile step at all.

Can I use Arduino libraries in PlatformIO?

Yes. PlatformIO uses the same Arduino core, so Arduino libraries work unchanged. You declare them in platformio.ini under lib_deps instead of installing them through a Library Manager, and each project pins its own versions.

Can I use Arduino code in ESP-IDF?

Not directly. ESP-IDF has its own APIs for GPIO, Wi-Fi, tasks, and timers, so an Arduino sketch needs rewriting, though the concepts transfer. PlatformIO lets you mix the two in one project with framework = arduino, espidf, which is the usual halfway step.

Is MicroPython too slow for a real project?

For most sensor, display, and network projects, no. MicroPython runs 10 to 20 times slower than C in tight loops, but reading a sensor every few seconds or serving a web page never notices the gap. It is too slow for hard real-time work, fast bit-banging, and large camera frames. If your program spends its time waiting, it is fast enough; if it spends its time computing, use C.

Do I need to pick one environment and stay in it?

No, but pick one per project. Arduino sketches move to PlatformIO for free, and MicroPython prototypes tell you exactly what the C version needs to do. Note the environment and versions you used when you start, so a switch mid-project does not break the build.

Which environment works on the ESP32-C3, S3, and C6?

All four. Arduino IDE, PlatformIO, ESP-IDF, and MicroPython all support the C3, S3, and C6, with board-specific firmware for MicroPython and board entries for the rest. The ESP32-H2 has no Wi-Fi radio, so it cannot run Wi-Fi code in any environment.

Parts used in this guide

Shipped fast and securely from our secure facility in New York, providing fast, high quality USA shipping.

In this series

Sources

Raspberry Pi Pico Pinout: RP2040 GPIO, ADC, and Power

Raspberry Pi Pico board with 40-pin edge and USB port. Caption: Raspberry Pi Pico board with 40-pin edge. Description: Top view of the Raspberry Pi Pico board used in this pinout guide.

Raspberry Pi Pico Pinout: RP2040 GPIO, ADC, and Power

Answer in brief: The Raspberry Pi Pico has 26 GPIO pins, 3 ADC inputs, and PWM on every GPIO pin. It runs the RP2040 chip at a 133 megahertz clock and 3.3 volt logic. This guide maps each pin, the power pins, and the debug pins. It also covers the pins that are not general GPIO.

Quick Facts

Item Detail Source
Chip RP2040, dual-core Cortex-M0+ Raspberry Pi Pico Datasheet
Clock speed 133 megahertz Raspberry Pi Pico Datasheet
Logic voltage 3.3 volts, not 5 volt tolerant Raspberry Pi Pico Datasheet
Board edge 40 pins Raspberry Pi Pico Datasheet
GPIO pins 26 pins: GP0 to GP22 and GP26 to GP28 Raspberry Pi Pico Datasheet
ADC inputs 3 inputs: GP26, GP27, GP28, 12-bit RP2040 Datasheet
ADC range 0 counts to 4095 counts, 0 volts to 3.3 volts RP2040 Datasheet
Onboard LED GP25 Raspberry Pi Pico Datasheet
VSYS input range 1.8 volts to 5.5 volts Raspberry Pi Pico Datasheet
VBUS pin Pin 40, USB 5 volt input Raspberry Pi Pico Datasheet
3V3 output, max 300 milliamperes Raspberry Pi Pico Datasheet
PWM Every GPIO pin, 8 slices RP2040 Datasheet

Raspberry Pi Pico Pinout Table

This table is an original pinout table built from the Raspberry Pi Pico Datasheet. It is not a copied image. The GP names are the printed pin names on the board. The pin numbers are the board edge numbers.

Edge pin GP name Main function Notes
1 GP0 GPIO UART0 TX default
2 GP1 GPIO UART0 RX default
3 GND Ground Common ground
4 GP2 GPIO I2C1 SDA option
5 GP3 GPIO I2C1 SCL option
6 GP4 GPIO UART1 TX, I2C0 SDA default
7 GP5 GPIO UART1 RX, I2C0 SCL default
8 GND Ground Common ground
9 GP6 GPIO I2C1 SDA default
10 GP7 GPIO I2C1 SCL default
11 GP8 GPIO SPI1 RX default
12 GP9 GPIO SPI1 CSn default
13 GND Ground Common ground
14 GP10 GPIO SPI1 SCK default
15 GP11 GPIO SPI1 TX default
16 GP12 GPIO General use
17 GP13 GPIO General use
18 GND Ground Common ground
19 GP14 GPIO General use
20 GP15 GPIO General use
21 GP16 GPIO SPI0 RX default
22 GP17 GPIO SPI0 CSn default
23 GND Ground Common ground
24 GP18 GPIO SPI0 SCK default
25 GP19 GPIO SPI0 TX default
26 GP20 GPIO General use
27 GP21 GPIO General use
28 GND Ground Common ground
29 GP22 GPIO General use
30 RUN Reset Active low, pull low to reset
31 GP26 ADC0 Analog input, 12-bit
32 GP27 ADC1 Analog input, 12-bit
33 AGND Analog ground Ground for ADC use
34 GP28 ADC2 Analog input, 12-bit
35 ADC_VREF ADC reference 3.3 volt reference input
36 3V3(OUT) 3.3 volt output 300 milliamperes max
37 3V3_EN 3.3 volt enable Pull low to disable the regulator
38 GND Ground Common ground
39 VSYS Power input 1.8 volts to 5.5 volts input
40 VBUS Power input USB 5 volt input

Power Pins

Power the Pico through USB, the VBUS pin, or the VSYS pin. USB gives 5 volts to VBUS. VBUS is pin 40 on the board edge. VSYS is pin 39 on the board edge. VSYS accepts 1.8 volts to 5.5 volts. That range covers a battery pack and a 5 volt supply.

Use VSYS for battery power. A 3-cell pack or a single lithium cell with a boost stage can feed VSYS. Check the Pico Datasheet power section before you pick a battery. A battery above 5.5 volts can damage the board. A battery below 1.8 volts will not run the regulator.

The 3V3(OUT) pin is pin 36. It gives 3.3 volts at a max of 300 milliamperes. That value comes from the Raspberry Pi Pico Datasheet. Use it for sensors and small loads. A part that needs more current needs its own regulator.

Pin 37 is 3V3_EN. It enables the 3.3 volt regulator. Leave it alone for normal use. Pull it low only when you want to shut the regulator down. Pin 35 is ADC_VREF. It sets the ADC reference. Leave it at 3.3 volts for normal use.

Boot and Reset Pins

The Pico has a BOOTSEL button for firmware loading. Hold BOOTSEL while you plug in USB. The board then appears as a USB drive. Drag a UF2 file onto that drive to load new firmware. Release BOOTSEL after the drive appears. That path loads MicroPython, CircuitPython, or a C build.

Pin 30 is RUN. It resets the chip when pulled low. It is active low. Connect a button from RUN to ground for a manual reset. Release the button to let the chip run again. Do not hold RUN low for normal use.

ADC Pins

The Pico has 3 ADC inputs on the board edge: GP26, GP27, and GP28. They are ADC0, ADC1, and ADC2. Each input reads 12-bit values from 0 counts to 4095 counts. A 0 volt input reads 0 counts. A 3.3 volt input reads 4095 counts. That step size is about 0.8 millivolts per count at the default reference.

ADC3 is an internal channel. It reads VSYS through GP29. It does not appear on the board edge. Use ADC3 in code to check the supply voltage. That read helps a battery project track its own power.

PWM Pins

PWM works on every GPIO pin on the Pico. The RP2040 chip has 8 PWM slices. Each slice drives 2 pins. That gives 16 PWM channels across the 26 GPIO pins. The Pico Datasheet and the RP2040 Datasheet both list this layout.

PWM drives a signal, not a load. Use a transistor or a driver for a motor. Use a series resistor for an LED. RP2040 GPIO pins have four drive-strength settings, nominally 2, 4, 8, and 12 mA, per the RP2040 Datasheet, section 5.5.3.5. The highest setting is 12 mA per pin. The total current sourced by all GPIO and QSPI pins together must not exceed 50 mA, and the total sunk must not exceed 50 mA, per the same datasheet (IIOVDD_MAX and IIOVSS_MAX). Those are drive-strength modes, not hard per-pin limits, and the pin voltage sags as the load rises. Keep LED current low with a resistor.

I2C Pins

I2C0 uses GP4 for SDA and GP5 for SCL by default. I2C1 uses GP6 for SDA and GP7 for SCL by default. Those defaults are the common pin choices in Pico examples. The RP2040 chip can route I2C to many other pins. Check the RP2040 Datasheet pin function table before you move the bus.

I2C runs at 3.3 volt logic on this board. Check the device voltage before you connect it. A 5 volt I2C device needs a level shifter. A direct 5 volt connection can damage the Pico.

SPI Pins

SPI0 uses GP16 for RX, GP17 for CSn, GP18 for SCK, and GP19 for TX by default. SPI1 uses GP8 for RX, GP9 for CSn, GP10 for SCK, and GP11 for TX by default. Those defaults are the common pin choices in Pico examples. The RP2040 chip can route SPI to many other pins.

SPI runs at 3.3 volt logic on this board. Check the device voltage before you connect it. A 3.3 volt SPI device connects directly. A 5 volt SPI device needs a level shifter.

UART Pins

UART0 uses GP0 for TX and GP1 for RX by default. UART1 uses GP4 for TX and GP5 for RX by default. Those defaults are the common pin choices in Pico examples. The RP2040 chip can route UART to many other pins. Check the RP2040 Datasheet pin function table before you move the port.

The USB port carries a separate serial link for MicroPython and for debug output. That link does not use GP0 or GP1. You can use GP0 and GP1 for a device while the USB console stays open. That split is handy for GPS logging.

USB and SWD Debug Pins

For a Pico comparison, see the live post Raspberry Pi Pico vs Pico W vs Pico 2: Chip, Wireless, and Headers (live post #20577). For starter kit options, see the live post Raspberry Pi Pico Starter Kits Compared: SunFounder, LAFVIN, and More (live post #20579).

Pins to Avoid

Avoid GP23, GP24, GP25, and GP29 as general GPIO. They are internal pins. GP25 is the onboard LED on the Pico. Use it only for the LED. GP24 senses VBUS. GP29 monitors VSYS. GP23 controls power save.

On the Pico WH, GP23, GP24, GP25, and GP29 are used by the onboard wireless chip instead, per the Raspberry Pi Pico W Datasheet. The onboard LED on the Pico WH is driven by the wireless chip, not by GP25, so the GP25 LED blink in the sketch below works on the Pico only, not on the Pico WH. In MicroPython, use Pin(“LED”, Pin.OUT) on the Pico WH.

Avoid 5 volt logic on any GPIO pin. This board uses 3.3 volt logic only. It is not 5 volt tolerant. A 5 volt signal needs a level shifter. A direct 5 volt input can damage the pin.

Max Current and Logic Voltage

Logic voltage is 3.3 volts on every GPIO pin. That value comes from the Raspberry Pi Pico Datasheet. Treat 3.3 volts as the high level. Treat 0 volts as the low level. The board is not 5 volt tolerant. That warning is in the datasheet.

The 3V3(OUT) pin gives 3.3 volts at a max of 300 milliamperes. That value comes from the Raspberry Pi Pico Datasheet. Treat 300 milliamperes as the working limit for that pin. A larger load needs its own regulator.

The RP2040 GPIO pins have four drive-strength settings, nominally 2, 4, 8, and 12 mA, per the RP2040 Datasheet, section 5.5.3.5. The highest setting is 12 mA per pin. The total current sourced by all GPIO and QSPI pins together must not exceed 50 mA, and the total sunk must not exceed 50 mA (IIOVDD_MAX and IIOVSS_MAX). Treat 12 mA per pin and 50 mA total as the working limits.

Use a driver for any load above a small LED. Keep LED current low with a series resistor. A 220 ohm resistor is a common bench value for a 3.3 volt LED test. Check the LED datasheet for its own forward voltage before you pick a resistor.

Wiring and Power Warnings

Power the board before you connect a sensor. Keep the USB cable short. Use a cable under 3 feet for bench tests when you can. Long wires pick up noise. Noise causes ADC jitter and I2C errors.

Do not feed 5 volts into a GPIO pin. Do not feed 5 volts into the 3V3(OUT) pin. Do not feed more than 5.5 volts into VSYS. Each of those mistakes can damage the board. Check the pin labels before every connection.

Pin Test Sketch

Language: MicroPython. Firmware: MicroPython version 1.22.2 for RP2040. No extra library install is needed for this test. Load the firmware with the BOOTSEL drive method. Code status: code not compiled. No arduino-cli or PlatformIO is installed in this environment.

# Raspberry Pi Pico pin test script
# Language: MicroPython version 1.22.2 for RP2040
# Board: Raspberry Pi Pico, RP2040
# Code status: code not compiled

from machine import Pin, ADC, PWM
import time

# Onboard LED is GP25 on the Pico. On the Pico WH the LED is on the wireless chip, not GP25.
led = Pin(25, Pin.OUT)

# ADC test uses GP26, which is ADC0.
adc = ADC(Pin(26))

# PWM test uses GP15 at 1000 hertz.
pwm = PWM(Pin(15))
pwm.freq(1000)  # Set PWM frequency to 1000 hertz.
pwm.duty_u16(0)  # Start with the output off.

# UART test uses UART0 on GP0 TX and GP1 RX.
# The USB console stays free for print output.
from machine import UART
uart = UART(0, baudrate=9600, tx=Pin(0), rx=Pin(1))

print("Pico pin test started")

while True:
    # Read the ADC value on GP26.
    # ADC range is 0 to 65535 counts in MicroPython.
    value = adc.read_u16()
    print("GP26 ADC value:", value)

    # Convert the ADC value to a voltage from 0 to 3.3 volts.
    volts = value * 3.3 / 65535
    print("GP26 volts:", volts)

    # Fade the PWM output on GP15 from off to full.
    for level in range(0, 65536, 4096):
        pwm.duty_u16(level)
        time.sleep(0.05)  # Wait 50 milliseconds per step.

    # Blink the onboard LED on GP25 once per loop.
    led.on()
    time.sleep(0.5)  # Wait 500 milliseconds.
    led.off()
    time.sleep(0.5)  # Wait 500 milliseconds.

Expected result: the console shows a GP26 ADC value and a voltage each loop. The value changes with the voltage on GP26. The PWM output on GP15 fades up in steps. The onboard LED blinks once per loop. If no console output appears, check the MicroPython firmware load and the serial port selection.

Frequently Asked Questions

How many GPIO pins does the Pico have?

It has 26 GPIO pins: GP0 through GP22, plus GP26, GP27, and GP28. GP23, GP24, GP25, and GP29 are internal pins. They do not appear on the board edge as general GPIO.

Which pins are ADC on the Pico?

GP26 is ADC0, GP27 is ADC1, and GP28 is ADC2. Each input reads 12-bit values from 0 counts to 4095 counts. ADC3 is an internal channel that reads VSYS.

Is the Pico 5 volt tolerant?

No, the Pico is not 5 volt tolerant. It uses 3.3 volt logic only. A 5 volt signal needs a level shifter. A direct 5 volt input can damage the pin.

How do I load MicroPython on the Pico?

Hold BOOTSEL while you plug in USB. The board appears as a USB drive. Drag the MicroPython UF2 file onto that drive. The board reboots with MicroPython running.

Boards That Match This Pinout

These boards use the pinout in this guide. Check the product page for current stock before you order. Stock changes over time.

Related reading: compare this board with ESP32 boards in the staged pillar RP2040 vs ESP32 (row 24, staged). For sibling pinouts, see Arduino UNO R3 Pinout and Nano V3.0 USB-C Guide: ATmega328P Board for Arduino IDE.

Sources

  • Raspberry Pi Pico Datasheet, https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf
  • RP2040 Datasheet, https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf
  • Raspberry Pi Pico W Datasheet, https://pip.raspberrypi.com/documents/RP-008312-DS-pico-w-datasheet.pdf
  • Raspberry Pi Pico pinout guide, https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html

Last updated 2026-11-21.

RP2040 vs ESP32: PIO, Radios, and Which Board to Pick

Microcontroller datasheet open beside an ESP32 board and a Raspberry Pi Pico

RP2040 vs ESP32: PIO, Radios, and Which Board to Pick

Pick the RP2040 when your project needs precise timing, custom protocols or deterministic I/O, and pick the ESP32 when your project needs Wi-Fi or Bluetooth. The RP2040 has no wireless radio at all on the base Pico, while the ESP32 has Wi-Fi and Bluetooth built in. The RP2040 wins on PIO, and the ESP32 wins on every wireless job.

RP2040 vs ESP32 at a glance

The table below uses the Raspberry Pi RP2040 Datasheet, build date 2025-02-20, build version 3184e62-clean, and the Espressif ESP32 Series Datasheet v5.3. The Pico W adds Wi-Fi, and that variant is covered in its own section below.

Spec (unit) RP2040 (Raspberry Pi Pico) ESP32 (DevKit V1)
CPU Dual ARM Cortex-M0+ Dual Xtensa LX6
Max clock (MHz) 133 240
SRAM (KB) 264 in six banks 520
Flash (MB) 2 on Pico, external QSPI, up to 16 supported 4 in package typical, up to 16 external
GPIO pins (count) 30, 26 on Pico header plus 4 ADC shared 34
Wi-Fi None on base Pico; Pico W adds 2.4 GHz Wi-Fi Wi-Fi 4, 2.4 GHz
Bluetooth None on base Pico; Pico W adds BLE 5.2 Classic plus BLE 4.2
ADC 4 external channels plus temperature sensor, 12-bit, 500 ksps 18 channels, 12-bit, two ADC units
DAC None 2 channels, 8-bit
PWM channels (count) 16, 8 slices with 2 outputs each 16 LEDC channels
PIO state machines (count) 8, in 2 blocks of 4 None
UART (count) 2 3
SPI (count) 2 2 usable
I2C (count) 2 2
USB USB 1.1 host and device with PHY None native, USB to serial chip on board
Logic voltage (V) 3.3 3.3
Production lifetime Until at least January 2041 per datasheet 15 year longevity commitment class

One row in that table decides most projects before any other spec matters: the base RP2040 has no radio, and the ESP32 has two. If your project must connect to Wi-Fi, the base Pico is out, and the choice becomes Pico W versus ESP32, which is covered below.

What is PIO and why does it matter?

PIO stands for Programmable Input Output. The RP2040 has two PIO blocks with four state machines each, for eight state machines in total. Each state machine runs a small program written in a nine-instruction assembly language, and each PIO block holds 32 instruction slots of shared memory for its four state machines. A state machine drives GPIO pins with precise timing without using either main CPU core. That makes PIO the RP2040 feature with no equivalent on the ESP32.

PIO programs implement protocols in software that would otherwise need dedicated hardware. Common uses are WS2812 LED strips, VGA output, I2S audio, custom serial protocols and precise pulse trains. A PIO state machine can bit bang a protocol at a fixed clock rate while both Cortex-M0+ cores run your application code. The timing stays deterministic because the state machine is not interrupted by Wi-Fi, USB or a scheduler.

The ESP32 has no PIO. It has an RMT peripheral for pulse trains and an I2S peripheral for audio, and those cover many of the same jobs, but they are fixed function blocks. When a project needs a protocol that no fixed peripheral speaks, the RP2040 implements it in PIO and the ESP32 needs bit banging on a core that is also running Wi-Fi. For a robotics project that drives a custom sensor bus or a precise stepper pulse train, PIO is a real advantage.

How do the radios compare?

The base Raspberry Pi Pico has no Wi-Fi and no Bluetooth. It is a wired microcontroller. The Raspberry Pi Pico W adds a 2.4 GHz Wi-Fi radio and Bluetooth 5.2, using an Infineon CYW43439 wireless chip connected over SPI. The Pico W is the board to compare with the ESP32 when wireless matters.

The ESP32 has Wi-Fi 4 and Bluetooth Classic plus BLE 4.2 on the same chip, with an antenna on the module. Its Wi-Fi stack is mature, its Arduino and ESP-IDF support is deep, and it handles a web server, an MQTT client and Bluetooth at once on two cores at 240 MHz. The Pico W handles Wi-Fi well for sensor posting and simple web serving, but its single SPI link to the wireless chip and its 133 MHz cores give it less headroom for a heavy network load plus application code.

Choose the ESP32 when the network is the project: a web dashboard, a camera stream, a Bluetooth link or an MQTT fleet. Choose the Pico W when the project is mostly local I/O with occasional Wi-Fi, such as a sensor that posts a reading every minute. Choose the base Pico when the project has no wireless need at all.

How do CPU, memory and GPIO compare?

The ESP32 is the faster chip on paper: two Xtensa LX6 cores at 240 MHz against two Cortex-M0+ cores at 133 MHz. The ESP32 also has twice the SRAM, at 520 KB against 264 KB. For number crunching, network stacks and displays, the ESP32 is faster. For deterministic I/O, the RP2040 closes the gap, because PIO and DMA move data without the CPU, and the six independent SRAM banks let both cores and the DMA controller work in parallel without bus contention.

GPIO counts are close: 30 multifunction pins on the RP2040 against 34 on the ESP32. The RP2040 puts every GPIO on a flexible pin mux, so any peripheral can use almost any pin, and all 30 pins support PIO. The ESP32 has more fixed function pins and more ADC channels, at 18 against 4 external channels on the RP2040. If your project reads six analog sensors, the ESP32 fits and the RP2040 does not. If your project needs eight PWM outputs with precise timing, both fit, and the RP2040 PIO option is stronger.

Flash differs in form. The Pico carries 2 MB of external QSPI flash and supports up to 16 MB. The ESP32 DevKit V1 typically carries 4 MB in package. Both are ample for Arduino or MicroPython projects. The RP2040 has no on chip flash at all, so its program always lives in external flash, while the ESP32 executes from its own flash and PSRAM options.

Which is easier to program?

Both boards run MicroPython and Arduino, and both have a C SDK. The Pico is the simpler first board for MicroPython: hold BOOTSEL, plug in USB, drop the UF2 file on the drive that appears, and the board reboots into MicroPython. The ESP32 needs esptool or Thonny to flash MicroPython firmware over serial, which is one more step and one more driver.

For Arduino, the ESP32 has the larger example base, because it has been in the Arduino ecosystem longer and its Wi-Fi examples are everywhere. The Pico Arduino core is solid and growing, and it covers the same sensor and display libraries, but a search for a Pico Wi-Fi example returns fewer results than the same search for the ESP32. For C development, the Pico SDK is clean and well documented, and the ESP-IDF is more powerful and more complex.

Debugging favours the Pico. The RP2040 has a SWD debug port and the Pico exposes it on three pins, so a low cost debug probe gives breakpoints and single stepping. The ESP32 has JTAG debugging too, but on the DevKit V1 it goes through the same USB to serial path and is less direct for a beginner.

Which board should you pick for each project?

Project type Pick this board Why
Wi-Fi sensor dashboard ESP32 Native Wi-Fi, 520 KB SRAM, mature web server examples
Bluetooth link or beacon ESP32 Bluetooth Classic plus BLE on chip
WS2812 LEDs or custom protocol RP2040 PIO state machines drive timing without CPU load
Precise stepper or pulse train RP2040 PIO plus DMA gives deterministic timing
USB HID device or MIDI RP2040 Native USB 1.1 host and device with PHY
Many analog sensors ESP32 18 ADC channels against 4 on the RP2040
Low cost learning board RP2040 Simple MicroPython flash path, low price, PIO to explore
Camera or display plus Wi-Fi ESP32, or ESP32-S3 PSRAM and camera interface, see the ESP32 family post

The Pico W sits between the two columns: it is the RP2040 pick when a project needs PIO plus occasional Wi-Fi. It costs more than the base Pico and less than a full ESP32 setup in many builds, and it keeps the PIO advantage while adding a radio.

What about Pico W vs ESP32?

Pico W versus ESP32 is the fair wireless comparison. The Pico W has Wi-Fi and Bluetooth 5.2 through its CYW43439 chip. The ESP32 has Wi-Fi and Bluetooth on chip. The ESP32 wins on network headroom, on Bluetooth Classic support and on the size of its Wi-Fi example base. The Pico W wins on PIO, on native USB and on the simplicity of its MicroPython path.

For a battery sensor that wakes, reads a sensor and posts over Wi-Fi, either board works, and the Pico W often draws less power in the application because its cores run at 133 MHz. For a web server that serves a dashboard to several clients at once, the ESP32 is the safer pick. For a USB keyboard, a MIDI controller or a WS2812 project that also posts to Wi-Fi, the Pico W is the only board here that does both jobs well.

For the Pico pins behind this comparison, see the Raspberry Pi Pico pinout guide.

FAQ

Does the Raspberry Pi Pico have Wi-Fi?

No, the base Pico has no wireless radio. The Pico W adds 2.4 GHz Wi-Fi and Bluetooth 5.2. Check the board name before you buy, because the two boards look alike.

Is the RP2040 faster than the ESP32?

No, on raw CPU speed the ESP32 is faster, with two cores at 240 MHz against two cores at 133 MHz. The RP2040 is faster at deterministic I/O, because its eight PIO state machines handle timing without CPU load.

Can the Pico run Arduino code?

Yes. The Arduino Pico core supports the RP2040 in the Arduino IDE, and most sensor and display libraries work on it. Wi-Fi code for the Pico W uses different libraries from ESP32 Wi-Fi code.

Which is better for a robot car?

The ESP32 is better when the car needs Wi-Fi control or telemetry. The RP2040 is better when the car needs precise motor timing or a custom sensor protocol. A car with both needs is a Pico W or an ESP32 with a separate PIO style approach, and the deciding factor is which requirement is stricter.

What is PIO used for in practice?

PIO drives WS2812 LED strips, VGA output, I2S audio, custom serial buses and precise pulse trains. Each state machine runs a small program that drives GPIO pins at a fixed rate while the main cores run your code.

Parts used

Raspberry Pi Pico Development Board, 2-Pack: the base RP2040 board for PIO, USB and deterministic I/O projects. ESP32 DevKit V1 Development Board, 30-Pin WROOM-32: the ESP32 board for Wi-Fi, Bluetooth and networked projects.

Sources

Last updated: 2026-11-21. Search volume: not verified. Product links use the store short link form with the product ID; confirm the product slug at publish time.