Installing ESP32 Board in the Arduino IDE

There are several development platforms available for programming the ESP32. You can go with:

  • Arduino IDE – intended for those who are familiar with Arduino
  • Espruino – JavaScript SDK and firmware closely emulating Node.js
  • Mongoose OS – An operating system for IoT devices that is recommended by Espressif Systems and Google Cloud IoT
  • MicroPython – Implementation of Python 3 for microcontrollers
  • SDK provided by Espressif – Official SDK to take advantage of all ESP32 features

When compared to other platforms, the Arduino IDE is the most user-friendly for beginners. While it may not be the ideal platform for working with the ESP32, it is a program that most people are already familiar with, which makes getting started much easier.

Before you can use the Arduino IDE to program the ESP32, you must first install the ESP32 board (also known as the ESP32 Arduino Core) via the Arduino Board Manager. This guide will walk you through the process of downloading, installing, and testing the ESP32 Arduino Core.

What is a Core?

The cores are required to make new microcontrollers compatible with your Arduino IDE as well as existing sketches and libraries. Arduino develops the cores for the microcontrollers (Atmel AVR MCUs) used on their boards, but anyone can develop a core for their own boards as long as they follow the rules and requirements set by Arduino.

Some development boards require the installation of an additional core; therefore, Arduino developed the Boards Manager as a tool to add cores to the Arduino IDE.

For more information on how to use the Arduino IDE Boards Manager, check out their tutorial.

Step 1: Installing or Updating the Arduino IDE

The first step in installing the ESP32 Arduino core is to have the latest version of the Arduino IDE installed on your computer. If you haven’t already, we recommend that you do so right away.

Latest Arduino IDE

Step 2: Installing the USB-to-Serial Bridge Driver

There are numerous ESP32-based development boards available. Depending on the design, you may need to install additional drivers for your USB-to-serial converter before you are able to upload code to your ESP32.

For example, the ESP32 DevKit V1 uses the CP2102 to convert USB signals to UART signals, whereas the WeMos ESP32 Lite uses the CH340G. The ESP32-CAM, on the other hand, lacks an onboard USB-to-serial converter and requires a separate module.

cp2102 on esp32 dev kit v1
ch340g on wemos esp32 lite

Make sure to inspect your board carefully to identify the USB-to-serial converter that is present. You’ll probably have either CP2102 or CH340 populated on the board.

If you’ve never installed drivers for these USB-to-serial converters on your computer before, you should do so right now.

CP210x USB to UART Bridge VCP Drivers

CH340 drivers

Step 3: Installing the ESP32 Arduino Core

Launch the Arduino IDE and navigate to File > Preferences.

Arduino IDE Preferences

Fill in the “Additional Board Manager URLs” field with the following.

Then, click the “OK” button.

Arduino IDE ESP32 Json URL

If you have already entered the URL for the ESP8266 boards or any other board, you can click on the icon to the right of the field to open a window where you can add additional URLs, one for each row.

esp32 and esp8266 board manager urls

Now navigate to Tools > Board > Boards Manager…

Arduino IDE Boards Manager

Filter your search by entering ‘esp32‘. Look for ESP32 by Espressif Systems. Click on that entry, and then choose Install.

Arduino IDE ESP32 Package

Step 4: Selecting the Board and Port

After installing the ESP32 Arduino Core, restart your Arduino IDE and navigate to Tools > Board to ensure you have ESP32 boards available.

Arduino IDE Boards Manager ESP32 Option

Now select your board in the Tools > Board menu (in our case, it’s the DOIT ESP32 DEVKIT V1). If you are unsure which board you have, select ESP32 Dev Module.

Arduino IDE Boards Manager ESP32 Boards

Finally, connect the ESP32 board to your computer and select the Port.

Arduino IDE ESP32 Port Selection

That’s it! You can now begin writing code for your ESP32 in the Arduino IDE.

You should make sure you always have the most recent version of the ESP32 Arduino core installed.

Simply navigate to Tools > Board > Boards Manager, search for ESP32, and verify the version you have installed. If a newer version is available, you should install it.

Step 5: Testing the Installation

Once you’ve finished the preceding steps, you are ready to test your first program with your ESP32! Launch the Arduino IDE. If you disconnected your board, plug it back in.

Let’s upload the most basic sketch of all – Blink!

This sketch uses the on-board LED that most ESP32 development boards have. This LED is connected to digital pin D2, and its number may vary from board to board.

int ledPin = 2;

void setup() {
	pinMode(ledPin, OUTPUT);

void loop() {
	digitalWrite(ledPin, HIGH);
	digitalWrite(ledPin, LOW);

If everything worked, the on-board LED on your ESP32 should now be blinking! To execute the sketch, you may need to press the EN button on your ESP32.

ESP32 Development Board Blink Sketch Working Arduino IDE

Congratulations! You have just programmed your first ESP32!

More ESP32 Examples

The ESP32 Arduino core includes several examples that demonstrate everything from scanning for nearby networks to building a web server. To access the example sketches, navigate to File > Examples > ESP32.

You will see a selection of example sketches. You can choose any of them to load the sketch into your IDE and start experimenting with it.

Arduino IDE ESP32 Package Examples

ESP32 Example: WiFi Scan

Let’s try to run one of the ESP32 example sketches, which demonstrates how to use the WiFi library to scan nearby WiFi networks and print the results.

You can find this example under File > Examples > WiFi > WiFiScan.

esp32 wifi scan sketch

Load the WiFiScan sketch from the example sketches into your Arduino IDE.

#include "WiFi.h"

void setup()

    // Set WiFi to station mode and disconnect from an AP if it was previously connected.

    Serial.println("Setup done");

void loop()
    Serial.println("Scan start");

    // WiFi.scanNetworks will return the number of networks found.
    int n = WiFi.scanNetworks();
    Serial.println("Scan done");
    if (n == 0) {
        Serial.println("no networks found");
    } else {
        Serial.println(" networks found");
        Serial.println("Nr | SSID                             | RSSI | CH | Encryption");
        for (int i = 0; i < n; ++i) {
            // Print SSID and RSSI for each network found
            Serial.printf("%2d",i + 1);
            Serial.print(" | ");
            Serial.printf("%-32.32s", WiFi.SSID(i).c_str());
            Serial.print(" | ");
            Serial.printf("%4d", WiFi.RSSI(i));
            Serial.print(" | ");
            Serial.print(" | ");
            switch (WiFi.encryptionType(i))
            case WIFI_AUTH_OPEN:
            case WIFI_AUTH_WEP:
            case WIFI_AUTH_WPA_PSK:
            case WIFI_AUTH_WPA2_PSK:
            case WIFI_AUTH_WPA_WPA2_PSK:
            case WIFI_AUTH_WPA2_ENTERPRISE:
            case WIFI_AUTH_WPA3_PSK:
            case WIFI_AUTH_WPA2_WPA3_PSK:
            case WIFI_AUTH_WAPI_PSK:

    // Delete the scan result to free memory for code below.

    // Wait a bit before scanning again.

Once you have uploaded the sketch, open the serial monitor at baud rate 115200 and press the EN button on the ESP32. You should see the SSID, RSSI, WiFi channel, and encryption for each discovered network.

esp32 wifi scan sketch output


Some ESP32 boards enter flashing mode automatically, and the code is uploaded successfully, while others do not, and you may receive the “A fatal error occurred: Failed to connect to ESP32… Timed out waiting for packet header…” error:

Failed to connect to ESP32 Error while Uploading Sketch in Arduino IDE

This is a common issue, and it indicates that your ESP32 is not in flashing or uploading mode. You can resolve this issue by following the steps outlined below.

  • Hold down the BOOT button on your ESP32 board.
  • Press the Upload button in the Arduino IDE to upload a new sketch.
  • Release the BOOT button when the Writing at 0x00001000… (100%) message appears in the Arduino IDE log after Connecting….
  • You should now see the “Done uploading” message.

That’s it. Now, press the EN button to restart the ESP32 and run the newly uploaded sketch.

Remember! You’ll have to repeat that button sequence every time you want to upload a new sketch.