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