There is a new Arduino IDE (beta version) available. This tutorial will teach you how to install ESP32 boards in Arduino IDE 2.0 and upload code to the board. Windows, Mac OS X, and Linux operating systems are all compatible with this tutorial.
“The Arduino IDE 2.0 is an improvement of the classic IDE, with increased performance, an improved user interface, and many new features, such as autocompletion, a built-in debugger, and syncing sketches with Arduino Cloud”.
According to the Arduino website.
If you want to install the ESP32 boards on the “classic” Arduino IDE, follow the next tutorial instead:
You might also like reading the ESP8266 Guide: Install ESP8266 Board in Arduino IDE in less than 1 minute.
Prerequisites: Arduino IDE 2.0 Installed
Before you begin, ensure that you have the Arduino IDE 2.0 installed on your PC.
Go to the Arduino website and download the version that corresponds to your operating system.
- Windows: run the file downloaded and follow the instructions in the installation guide.
- 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.
If you have any questions, you can go to the Arduino Installation Guide.
Do you need an ESP32 board? You can buy it here.
Install ESP32 Add-on in Arduino IDE
Follow these next steps to install the ESP32 board in your Arduino IDE:
1. In your Arduino IDE 2.0, go to File > Preferences.
2. In the Additional Boards Manager URLs field, copy and paste the following line:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Note: If you already have the URL for the ESP8266 boards, you may separate them with a comma as follows:
http://arduino.esp8266.com/stable/package_esp8266com_index.json, https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
3. 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.
4. Search for “ESP32” and press the install button for ESP32 by Espressif Systems.
That's all. After a few seconds, it should be installed.
Testing the Installation
We'll upload a simple code that blinks the on-board LED (GPIO 2) to test the ESP32 add-on installation.
Copy the following code to your Arduino IDE:
/*********
LEDEdit PRO
How to Install ESP32 Boards in Arduino IDE 2.0
*********/
#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);
}
Uploading the Sketch
Select “unknown” board from the top drop-down menu. A new window will open, as shown below.
You must first select your ESP32 board model and COM port. We're using the DOIT ESP32 DEVKIT V1 board In our example. When you're finished, click “OK“.
Now, you just need to click on the “Upload” button.
The upload should be finished in a few seconds.
Note: When you upload new code to some ESP32 development boards, they do not instantly enter flashing or uploading mode, and you will see a bunch of dots on the debugging window followed by an error message. If this is the case, you need to press the “ESP32 BOOT” button when you see the dots on the debugging window.
The ESP32's on-board LED should be blinking every second.
Serial Monitor
To open the Serial Monitor tab, click on the Serial Monitor icon.
That's all! You have successfully installed ESP32 Boards in Arduino IDE 2.0.
Conclusion
This guide shows how to Install ESP32 Boards in Arduino IDE 2.0 on a Windows PC, Mac OS X, or Linux PC.
If you like ESP32, you may also like:
- Install ESP32 Board in Arduino IDE in less than 1 minute
- Get MAC Address of ESP32/ESP8266 and Change It (Arduino IDE)
- Getting Started with MicroPython on ESP32 and ESP8266
- How to Flash MicroPython Firmware to ESP32 and ESP8266
We hope you find this tutorial useful. Thanks for reading.