How to Set Up an ESP32 in the Arduino IDE

The ESP32 is a powerful board with built-in Wi-Fi and Bluetooth, which is why it shows up in so many connected projects. It does not appear in the Arduino IDE by default, so the one extra step is adding the ESP32 boards URL. This guide covers the whole process. If you are weighing the ESP32 against other boards, Compoden's AI build assistant can read your project idea and recommend the right board, parts, wiring, and code as a kit shipped to you.

1. What you need

You need an ESP32 development board, a Micro-USB or USB-C cable depending on your board, and a computer. Most ESP32 dev boards use the CH340 USB chip, while some use the CP2102 chip. There is a built-in LED on many ESP32 boards, usually on GPIO 2, so you can test without extra parts.

2. Install the Arduino IDE and add the ESP32 boards URL

Install the Arduino IDE from arduino.cc if you have not already. Then open File, then Preferences, and find the field labelled "Additional Boards Manager URLs." Paste this URL: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json and click OK. Next open Tools, then Board, then Boards Manager, search for esp32, and install the "esp32 by Espressif Systems" package. This teaches the IDE how to compile for the ESP32.

3. Install the CH340 driver

Your computer needs the right USB driver to see the board. If your ESP32 uses the CH340 chip, install the CH340 driver, then unplug and replug the board so a serial port appears. If your board uses the CP2102 chip instead, install the CP210x driver from Silicon Labs. On Windows you can check Device Manager to see which chip your board uses. On macOS, allow the driver in System Settings under Privacy and Security if prompted.

4. Select your board and port

In the Arduino IDE, open Tools, then Board, then esp32, and choose a common option such as "ESP32 Dev Module." Then open Tools, then Port, and select the port that appeared, such as COM6 on Windows or a /dev/cu.wchusbserial entry on macOS. Leave the other settings at their defaults for your first upload.

5. Upload your first sketch

Open File, then Examples, then 01.Basics, then Blink, and change the LED pin to 2 if needed. Click the Upload arrow. Some ESP32 boards require you to hold the BOOT button while the upload begins, then release it once you see "Connecting," so watch for that. When you see "Done uploading," the onboard LED should blink, confirming your setup works.

6. Troubleshooting

If the IDE cannot connect, hold the BOOT button during the "Connecting" stage, as this puts the board into upload mode. If no port appears, install or reinstall the CH340 or CP210x driver and use a data USB cable. If the compile fails, confirm the esp32 package finished installing in Boards Manager. A weak USB port can also cause resets, so try a different port or a powered hub.

Build it with Compoden's AI

With the ESP32 online, you can build Wi-Fi projects like a home sensor that reports to your phone or a small web-controlled relay. Describe your idea to Compoden's AI build assistant and it recommends the components, shows the wiring, and supplies starter code that uses the ESP32's wireless features. It then ships the matching kit. For a board with built-in wireless in a smaller footprint, the Arduino Nano 33 IoT is another option worth comparing. Browse everything at /collections/all.

The ESP32 setup is straightforward once you add the boards URL and the right driver. Add the URL, install the package, sort out the driver, select the board and port, and upload Blink. Then let the AI assistant plan and ship your connected build from Compoden.

Why is the ESP32 not in my board list? Because it is not included by default. Add the ESP32 boards URL in Preferences, then install the esp32 package in Boards Manager, and it will appear.

The upload keeps failing at "Connecting." What do I do? Hold the BOOT button on the board as the upload reaches the "Connecting" stage, then release it. This forces the board into upload mode.

Which driver does an ESP32 need? It depends on the USB chip. CH340-based boards need the CH340 driver, while CP2102-based boards need the Silicon Labs CP210x driver.

Back to blog