Arduino IDE vs PlatformIO for ESP32: Which to Use

Arduino IDE 2 or PlatformIO for ESP32? Compare library pinning, Arduino-ESP32 3.x, debugging and tests, with the real platformio.ini of Gizmo Ticker.

Published
Reading time
9 min
Category
Comparisons
An infographic comparing Arduino IDE and PlatformIO, with their development interfaces and an ESP32 board.

In short

Use Arduino IDE 2 for one board and one sketch. Use PlatformIO when libraries, targets or tests need pinning: its platformio.ini keeps every version in the project, not on your machine.

For one board and one sketch, use Arduino IDE 2. For an ESP32 project with several libraries, more than one build target or tests, use PlatformIO. Both compile your code against Espressif's Arduino-ESP32 core, so the real difference is where versions live: on your machine in the IDE, in a platformio.ini file inside the project in PlatformIO.

I build OpenGizmo's three firmwares (Gizmo Ticker, Gizmo Reolink Switch and Gizmo Camera) with PlatformIO, so this comparison leans on their real config files and on the official docs of both tools, with the date each fact was checked: November 2026. It also covers the awkward parts, namely the Arduino-ESP32 3.x gap that pushed people to a fork, and a numbered path to move a sketch over.

Which should you pick for an ESP32 project?

Pick by what the project needs to repeat. If someone else (or you, in a year) must rebuild the same firmware from a clean machine, versions have to be written down in the project. If you only need to see an LED blink tonight, they don't.

A maker coding an ESP32 sketch in PlatformIO inside VS Code, with main.cpp open next to the Home, Libraries and Debug sidebar

TopicArduino IDE 2PlatformIO
Project fileA sketch folder with a .ino fileplatformio.ini plus src/, test/ and lib/ folders
Where libraries liveInstalled once through Library Manager, shared by every sketchDownloaded per project from lib_deps into the libdeps folder
Pinning versionsNot in the IDE; Arduino CLI sketch profiles canplatform and lib_deps lines, with exact versions, ranges or Git tags
Several targetsOne board menu at a timeOne [env:name] section per target, selected with -e
Command lineArduino CLI is a separate toolpio run, pio test and pio device monitor are the core tool
Unit tests on your computerNo test runner that I found in the docspio test with the native platform and Unity
Frameworks for ESP32Arduino-ESP32 coreArduino and ESP-IDF
Where the ESP32 core comes fromEspressif's Boards Manager indexThe espressif32 platform's bundled core

Arduino IDE 2.3.11 was the latest release on 12 November 2026, and PlatformIO's Visual Studio Code extension includes PlatformIO Core, so you don't install the command line separately. Both facts come from the Arduino IDE releases and the PlatformIO VS Code docs.

What does a real platformio.ini look like?

A platformio.ini is the one file that says which board, which platform version and which libraries a project builds with. Here is the firmware config of Gizmo Ticker, copied from microcontroller/platformio.ini with its comments trimmed:

microcontroller/platformio.ini
microcontroller/platformio.ini
[platformio]
default_envs = release

[env:release]
extra_scripts = pre:firmware_version.py
board = seeed_xiao_esp32s3
platform = espressif32 @ 8.0.0
framework = arduino
board_build.partitions = huge_app.csv
build_src_flags = -Wformat
monitor_speed = 115200
lib_deps = 
    majicdesigns/MD_Parola@3.7.5
    majicdesigns/MD_MAX72XX@3.5.1
    esp32async/ESPAsyncWebServer@3.12.1
    esp32async/AsyncTCP@3.5.0
    bblanchon/ArduinoJson@7.2.2
    bblanchon/StreamUtils@1.9.2
    https://github.com/open-gizmo/gizmo-common.git#v2.5.1

[env:debug]
extends = env:release
build_unflags = -DCORE_DEBUG_LEVEL=0
build_flags =
    -D PIO_DEV_MODE=1
    -D CORE_DEBUG_LEVEL=3

[env:native]
platform = native@1.2.1
test_framework = unity
test_build_src = yes
build_src_filter = -<*> +<server/settings_json.cpp> +<api/market_refresh.cpp> +<api/market_data.cpp>
build_flags =
    -std=gnu++17
    -D UNITY_INCLUDE_DOUBLE
lib_deps =
    throwtheswitch/Unity@2.6.1
    bblanchon/ArduinoJson@7.2.2
Ln 38, Col 1UTF-8ini

Line by line, this is what each part does:

  • board = seeed_xiao_esp32s3 selects the Seeed Studio XIAO ESP32-S3 board definition: 240 MHz, 8 MB of flash, 320 KB of RAM. It is not the generic esp32dev board, which is the ESP32 Dev Module profile with 4 MB of flash. Each ESP32 variant needs its own ID.
  • platform = espressif32 @ 8.0.0 pins the toolchain and the Arduino-ESP32 core it bundles. More on that below.
  • board_build.partitions = huge_app.csv gives the app one 3 MB slot, which I use in every OpenGizmo firmware because none of them does wireless updates. The partition table post explains the trade.
  • lib_deps lists every library with an exact version. The last line points at a Git tag of our shared gizmo-common library.
  • [env:debug] copies release with extends and turns the core's log level up from 0 to 3. The same code, a different build, selected with pio run -e debug -t upload.
  • [env:native] builds three source files for your computer instead of the board, to run tests. The -<*> +<file> filter says "nothing except these files".

The same three sections (release, debug, native) sit in the Reolink Switch and Camera configs. The camera uses board = esp32cam, which turns on its PSRAM for the frame buffers.

One platformio.ini with three environments: release builds the XIAO ESP32-S3 firmware, debug adds core logs, native runs Unity tests on the computer

Where do libraries live, and how do you pin their versions?

Pinning means writing the exact version you built with next to the code, so that a build next year uses the same library and core. The two tools differ in where that record can live.

Arduino IDE 2: installed once, shared by every sketch

You add the ESP32 core by pasting Espressif's package index URL into the IDE's preferences, then installing the esp32 platform from the Boards Manager, as the Arduino-ESP32 installation guide describes. Libraries come from the Library Manager. Both are installed on the machine, once. Update a library for one sketch and every other sketch gets the new version too, and nothing in the sketch folder records which version it was written against.

A maker writing a sketch.ino in Arduino IDE next to an Arduino board and a breadboard

That is fine for a sketch you finish in an evening. It hurts when a library update changes an API and you must remember which of your projects uses which version.

Arduino CLI sketch profiles: the Arduino-side answer

The Arduino side has an answer, but it lives in the command line tool. In Arduino CLI, a sketch profile in a sketch.yaml file lists the board, the core platform version and the library versions. Arduino's docs say a profile build "is isolated from the system and will rely only on the resources specified in the profile". An illustrative profile for the XIAO ESP32-S3:

sketch.yaml
sketch.yaml
profiles:
  release:
    fqbn: esp32:esp32:XIAO_ESP32S3
    platforms:
      - platform: esp32:esp32 (3.3.12)
        platform_index_url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
    libraries:
      - ArduinoJson (7.2.2)
default_profile: release
Ln 9, Col 1UTF-8YAML

Build it with arduino-cli compile --profile release. That page documents the CLI; I could not confirm from it that the Arduino IDE 2 window exposes profiles, so treat the IDE itself as global-install-only.

PlatformIO: versions in the project

PlatformIO downloads what lib_deps lists into the project's libdeps folder (the default value of the libdeps_dir option is workspace_dir/libdeps), so two projects never share a library. The lib_deps docs show registry names (owner/name), SemVer ranges such as bblanchon/ArduinoJson @ ~5.6,!=5.4, and Git URLs with a tag (...git#v2.0). OpenGizmo uses exact versions and a Git tag; the release workflow even installs a fixed PlatformIO Core (platformio==6.2.0), so CI and a fresh clone resolve the same set.

Does PlatformIO support the latest Arduino-ESP32 core?

Yes, as of November 2026, but it took a while. PlatformIO's espressif32 platform bundles an Arduino-ESP32 core, and the platform releases page shows which one:

espressif32 releaseDateArduino-ESP32 core
6.13.026 Feb2.0.17
7.0.0 to 7.1.030 Apr to 31 Aug2.0.17
8.0.019 Oct3.3.12

So through the 7.x line the official platform stayed on core 2.0.17, while Espressif's own Boards Manager index moved on to 3.x. That gap is why the community pioarduino platform, a fork of the official one, got popular. You use it by replacing the platform line with a URL:

Code
Code
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
Ln 1, Col 1UTF-8ini

Its stable release also provides Arduino 3.3.12 now, and it adds extras such as a hybrid compile mode for chips the Arduino core does not cover. Since the official 8.0.0 caught up, I would stay on the official platform unless you need one of those extras. The 8.0.0 release notes also warn that Arduino-ESP32 3.x lacks the full Bluetooth refactoring planned for v4.0.

Two practical rules follow. Pin the platform (espressif32 @ 8.0.0, or ~8.0.0 to accept patch releases), because a platform bump is a core bump and core 2 to core 3 changes APIs. And read the release page before upgrading. All three OpenGizmo repositories pin espressif32 @ 8.0.0, so they build on core 3.3.12.

How do debugging options compare?

Most ESP32 debugging is Serial logging, and both tools do that. The difference with PlatformIO is that a log level is a build profile: pio run -e debug -t upload followed by pio device monitor gives you the ticker firmware with the core's own messages on, and release keeps the serial log off. The ticker README documents the three build profiles.

Hardware debugging (breakpoints and stepping) needs a probe. PlatformIO's XIAO ESP32-S3 page says the board has no on-board debug probe and is not ready for debugging, and lists external tools you select with the debug_tool option, esp-builtin among them. Arduino IDE 2 has its own debugger; I could not confirm in its docs that ESP32 boards are covered, so check before you buy a probe. I don't use a hardware debugger on the OpenGizmo firmware: it relies on the debug profile and the serial log.

Can you unit test ESP32 code without a board?

If the logic does not touch hardware, yes. PlatformIO's unit testing can run the same tests on your computer (the native platform) or on a connected board, with frameworks such as Unity. In the config above, [env:native] compiles only three files, and pio test -e native runs them:

  • server/settings_json.cpp, the mapping between settings and the web API's JSON
  • api/market_refresh.cpp, which decides when to fetch prices again
  • api/market_data.cpp, which reads the CoinGecko reply

Those tests live in microcontroller/test/, and the release workflow runs pio test -e native before it builds the firmware. The limit is real: native tests cover logic that compiles on a PC. Anything that talks to the matrix, Wi-Fi or flash still needs a board. I did not find a test runner in the Arduino IDE 2 documentation, so on that side you would test on the board by hand or script it with another tool.

How do you move an Arduino sketch to PlatformIO?

A sketch of one file converts in a few steps. The conversion rules come from PlatformIO's ino to cpp guide.

  1. Install Visual Studio Code, then the PlatformIO IDE extension from the Extensions view. It includes PlatformIO Core.
  2. In PlatformIO Home, choose New Project, pick your board (seeed_xiao_esp32s3 for a XIAO ESP32-S3, esp32dev for a classic ESP32 DevKit) and the Arduino framework. You get a platformio.ini and src/main.cpp.
  3. Paste your sketch into src/main.cpp. Add #include <Arduino.h> at the top, and declare every custom function before it is called. Don't declare setup and loop.
  4. Move each library to lib_deps. Search the PlatformIO Registry, copy the owner/name form, and add the version you used, for example bblanchon/ArduinoJson@7.2.2.
  5. Pin the platform: platform = espressif32 @ 8.0.0. Carry over any Tools menu choices that mattered, such as the partition scheme (board_build.partitions) and the serial speed (monitor_speed = 115200).
  6. Run pio run. Fix missing prototypes or includes until the build succeeds.
  7. Connect the board and run pio run -t upload, then pio device monitor to read the serial output.

Once it works, add a [env:debug] that extends your main environment, as in the example above. That is the cheapest improvement you get from the move.

Where does PlatformIO cost you, and when does Arduino IDE win?

The strongest objection to PlatformIO is its start-up cost. You learn an ini file, a folder layout and a few commands before the first blink, and the editor experience depends on a VS Code extension. Core and platform upgrades are explicit, which is good for repeatability and means you carry the work of reading release notes. For a single sketch, none of that pays back.

Arduino IDE 2 wins when the project is one sketch on one board, when you follow a tutorial written for it, or when you want Espressif's newest core straight from the Boards Manager index the day it ships. Its documentation is the better starting point for a first week.

There is also a third answer: skip both. OpenGizmo's projects ship prebuilt firmware that you flash from the browser, and the ESP Web Tools guide explains how. You only need a toolchain to change the code.

So which one should you start with?

Start with Arduino IDE 2 if you want a first upload today. Move to PlatformIO when you catch yourself wanting a second board profile, a test or the ability to rebuild an old version. The sketch conversion above is short, and lib_deps plus a pinned platform buy you builds that keep working.

What I checked: the config files of the three OpenGizmo firmware repositories, the espressif32 release notes and the official docs linked above, as of November 2026. What I did not check: whether Arduino IDE 2's debugger works with ESP32 boards, and whether its GUI exposes sketch profiles. Next, read the XIAO ESP32-S3 pinout guide for the board used in these configs, or the Gizmo Ticker build guide to see the whole project built with this setup.

Frequently asked questions

Find quick answers to the most common questions about this topic.

For projects with several libraries, more than one build target or tests, yes: PlatformIO keeps the platform, board and library versions in a platformio.ini file inside the project. For a single sketch on one board, Arduino IDE 2 is faster to start and has fewer moving parts.

Published Updated

Ready to build your own gizmo?

Pick an open-source ESP32 project and follow its step-by-step guide, from the parts list and wiring to the firmware and the first boot.

Read also

Explore categories