ESP32

Installing ESP32 Board in Arduino IDE 2 (Windows, Mac OS X, Linux)

There is a new Arduino IDE—Arduino IDE 2. In this tutorial, you’ll learn how to install the ESP32 boards in Arduino IDE 2 and upload code to the board. This tutorial is compatible with Windows, Mac OS X, and Linux operating systems.

Installing Programming ESP32 Board in Arduino IDE 2.0 Windows Mac OS X Linux

According to the Arduino website: “The Arduino IDE 2.0 is an improvement of the classic IDE, with increased performance, improved user interface and many new features, such as autocompletion, a built-in debugger and syncing sketches with Arduino Cloud“.

If you want to install the ESP32 boards on the “classic” Arduino IDE, follow the next tutorial instead: Installing the ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)

If you prefer programming the ESP32 using VS Code + PlatformIO, go to the following tutorial:

You might also like reading the ESP8266 Guide: Installing ESP8266 NodeMCU Board in Arduino 2 (Windows, Mac OS X, Linux)

Prerequisites: Arduino IDE 2 Installed

Before proceeding make sure you have Arduino IDE 2 installed on your computer.

Go to the Arduino website and download the version for your operating system.

Arduino IDE 2 Software Install Download
  • Windows: run the downloaded file and follow the instructions in the installation guide (for Windows, we recommend the first option).
  • Mac OS X: copy the downloaded file into your application folder.
  • Linux: extract the downloaded file, and open the arduino-ide file that will launch the IDE.
Arduino IDE 2.0 installation successful Windows Mac OS X Linux

If you have doubts, you can go to the Arduino Installation Guide.

Do you need an ESP32 board? You can buy it here.

Recommended reading: ESP32 Development Boards Review and Comparison

Install ESP32 Add-on in Arduino IDE

To install the ESP32 board in your Arduino IDE, follow these next instructions.

Open the Boards Manager. You can go to Tools Board Boards Manager… or you can simply click the Boards Manager icon in the left-side corner.

Arduino IDE 2 - Boards Manager

Search for ESP32 and press the install button for esp32 by Espressif Systems version 3.X.

Install ESP32 Arduino IDE 2 board add-on version 3

That’s it. It should be installed after a few seconds.

Testing the Installation

To test the ESP32 add-on installation, we’ll upload a simple code that blinks the on-board LED (GPIO 2).

Copy the following code to your Arduino IDE:

/*********
  Rui Santos
  Complete project details at https://RandomNerdTutorials.com/vs-code-platformio-ide-esp32-esp8266-arduino/
*********/

#include <Arduino.h>

#define LED 2

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(LED, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED, HIGH);
  Serial.println("LED is on");
  delay(1000);
  digitalWrite(LED, LOW);
  Serial.println("LED is off");
  delay(1000);
}

View raw code

Uploading the Sketch

Select your board before uploading the code. On the top drop-down menu, click on “Select other board and port…

A new window, as shown below, will open. Search for your ESP32 board model.

Select ESP32 board Model Arduino IDE 2

Select the ESP32 board model you’re using, and the COM port. In our example, we’re using the DOIT ESP32 DEVKIT V1. Click OK when you’re done.

Now, you just need to click on the Upload button.

Arduino IDE 2 Upload Button

After a few seconds, the upload should be complete.

Arduino IDE 2 - upload code success ESP32

Note: some ESP32 development boards don’t go into flashing/uploading mode automatically when uploading a new code and you’ll see a lot of dots on the debugging window followed by an error message. If that’s the case, you need to press the ESP32 BOOT button when you start seeing the dots on the debugging window.

The ESP32 on-board LED should be blinking every second.

ESP32 board Built in LED turned on HIGH Arduino IDE 2.0 demonstration

Serial Monitor

You can click on the Serial Monitor icon to open the Serial Monitor tab. Make sure you select the 115200 baud rate.

Open Arduino IDE Serial Monitor Arduino IDE 2.0 ESP32

That’s it! You’ve installed the ESP32 Boards successfully in Arduino IDE 2.

Troubleshooting

1) If you try to upload a new sketch to your ESP32 and you get this error message “A fatal error occurred: Failed to connect to ESP32: Timed out… Connecting…“. It means that your ESP32 is not in flashing/uploading mode.

Having the right board name and COM por selected, follow these steps:

  • Hold-down the BOOT button in your ESP32 board
  • Press the Upload button in the Arduino IDE to upload your sketch
  • After you see the  “Connecting….” message in your Arduino IDE, release the finger from the BOOT button
  • After that, you should see the “Done uploading” message

You’ll also have to repeat that button sequence every time you want to upload a new sketch. But if you want to solve this issue once for all without the need to press the BOOT button, follow the suggestions in the next guide:

2) If you get the error “COM Port not found/not available”, you might need to install the CP210x Drivers:

If you experience any problems or issues with your ESP32, take a look at our in-depth ESP32 Troubleshooting Guide.

ESP32 Filesystem Uploader Plugin

After installing the ESP32 boards on the Arduino IDE 2, you may also want to install the filesystem uploader plugin to easily upload files to the ESP32 filesystem (LittleFS)—check the following tutorial:

Upcoming Course
Upcoming Course
Learn More
Instructor Tips
Instructor Tips
View Tips
Join Community
Join Community
Join Now