Configue ESP32 with arduino IDE
Undergraduate course, American University of Phnom Penh, 2026
βοΈ Configuring ESP32 with Arduino IDE
This guide explains how to configure and program an ESP32 using the Arduino IDE. It is intended for beginners and students who are starting embedded systems or robotics projects.
π― Objectives
By the end of this guide, you will be able to:
- Install Arduino IDE
- Add ESP32 board support
- Select the correct ESP32 board and port
- Upload a program to ESP32
- Verify successful communication
π§° Requirements
Hardware
- ESP32 development board
- USB cable (data cable, not charging-only)
Software
- Arduino IDE (latest version recommended)
- Internet connection
π₯οΈ Step 1: Install Arduino IDE
- Download Arduino IDE from:
π https://www.arduino.cc/en/software - Install using default settings
- Launch Arduino IDE
π Step 2: Add ESP32 Board Manager URL
- Open Arduino IDE
- Go to File β Preferences
- In Additional Boards Manager URLs, add:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Click OK
π‘ If there are existing URLs, separate them using a comma.
π¦ Step 3: Install ESP32 Board Package
- Go to Tools β Board β Boards Manager
- Search for ESP32
- Find βesp32 by Espressif Systemsβ
- Click Install
- Wait for installation to complete
π Step 4: Connect ESP32 to Computer
- Connect ESP32 using a USB cable
- Wait for the driver to install automatically
- If prompted, allow driver installation
π§ Step 5: Select ESP32 Board and Port
Select Board
- Go to Tools β Board
- Choose the correct ESP32 model, for example:
ESP32 Dev ModuleDOIT ESP32 DEVKIT V1
Select Port
- Go to Tools β Port
- Select the COM port associated with ESP32
β οΈ If no port appears, check the USB cable and drivers.
π§ͺ Step 6: Upload a Test Program (Blink)
Copy and paste the code below into Arduino IDE:
void setup() {
pinMode(2, OUTPUT); // Built-in LED (may vary by board)
}
void loop() {
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(2, LOW);
delay(1000);
}
π€ Upload the Program
- Click Upload.
- Wait for compilation and upload to finish.
- If required, press and hold the BOOT button during upload.
β Step 7: Verify Operation
- The LED should blink every second.
- Upload messages should show βDone uploadingβ.
- No error messages should appear.
π οΈ Common Issues & Fixes
β Port not found
- Try a different USB cable.
- Install CH340 or CP210x driver.
- Restart Arduino IDE.
β Upload failed
- Hold the BOOT button while uploading.
- Select the correct ESP32 board model.
- Lower upload speed (Tools β Upload Speed).
π Notes for Students
- ESP32 operates at 3.3V logic.
- Avoid connecting 5V signals directly to GPIO pins.
- Always verify pin mapping for your ESP32 board.
π Next Steps
After successful setup, you can:
- Read sensors
- Control motors and servos
- Use Wi-Fi and Bluetooth
- Build IoT and robotics applications
π References
ESP32 Arduino Core:
https://github.com/espressif/arduino-esp32Arduino Documentation:
https://docs.arduino.cc/
