Table Of Contents :
- Watch the Video Tutorial
- About ESP32
- Requirement – Installing Arduino IDE
- Installing ESP32 Board Package In Arduino IDE
- Testing ESP32 With Arduino IDE
ESP32 series of modules are designed and developed by Espressif. ESP32 modules are small yet have the capability to serve the most demanding task for IoT applications.
It has WiFi+Bluetooth/BLE wireless capabilities, dual-core and single-core modules available, GPIO pins with capacitive touch capabilities, RTC timer block, inbuild hall effect sensor, and more to make this module an ideal choice for your IoT or IIoT projects.
Recently they have announced about there new ESP32-DA module with a dual antenna setup you can check our blog to know more about:
❑ New ESP32-WROOM-DA Module
Requirement – Installing Arduino IDE
Before getting started with this tutorial, you will require Arduino IDE installed on your computer.
If you have already installed the latest Arduino IDE, then skip this step.
Else you can follow our easy-to-follow guide on:
❑ Getting Familiar With Arduino IDE
Watch the Video Tutorial
This tutorial is available in video format (watch below) and written format (continue reading this page).
Installing ESP32 Board Package In Arduino IDE
To program ESP32 using Arduino IDE, we need to install the ESP32 board package provided by the official espressif.
Follow these simple steps-
- Open Arduino IDE. Now go to File → Preferences
- Copy-paste the below URL from espressif in the Additional Boards Manager URLs:
If you are new to ESP32 use
Stable release URL:
If you are familiar with ESP32 and want to test or want to help in a new development release then use
Development release URL:
Then hit the OK button to save the settings.
- Opening the board manager. Go to Tools → Board → Boards Manager. It will open a new board manager window, and it will load all contents from the added URLs in step 2. Wait till this process completes.
- Search for ESP32 in the search bar. You will see esp32 by Espressif Systems; select it.
Select the appropriate version number from the right bottom corner. We recommend installing the latest version.
Hit the Install button and wait.
- That’s all, ESP32 has been installed in your Arduino IDE.
- You can also confirm installation by going to Tools → Boards you will see ESP32 Arduino category has been added now.
Note:- If you don’t see ESP32 boards added then try restarting your Arduino IDE
Testing ESP32 With Arduino IDE
We will test your ESP32 board by programming an example sketch that comes with the ESP32 package.
We will upload a WiFiScan example to test everything is working perfectly on ESP32 with Arduino IDE.
WiFiScan example, will scan all WiFi networks in the range of your ESP32 and print their network SSID in the serial terminal. Additionally, it will also print the RSSI (signal strength) of the network.
Connect your ESP32 board with a micro USB data cable to your computer and follow the instructions for uploading the example to ESP32:
- Selecting proper board. Go to Tools → Board → ESP32 Arduino → ESP32 Dev Module. Leave all settings default.
- Selecting COM port. Go to Tools → Port → COM5 (select your ESP32 com port; in our case, it’s COM5).
If the COM port is not shown on your computer, you need to install CP2102 virtual COM port drivers.
CP2102 is a USB to UART chip from Silicon labs used for converting USB data to UART data, and it is taking care of uploading program in our ESP32 board.
- Opening the example. Go to File → Examples → WiFi (ESP32) → WiFiScan
A new Arduino project window will be opened named as WiFiScan.
- Press the upload button in Arduino IDE for uploading the example code in your ESP32 board.
Now time to hold your breath for a while until the code is compiled and uploaded.
- If all goes as per plan, you will see a Done uploading message.
- Open the Serial Monitor in Arduino IDE. Set the baud rate to 115200 as this baud rate is defined in the Example code.
- Now press the EN (Enable) button on the ESP32 board. It will reset the ESP32, and our example code will start from the beginning.
Now ESP32 will scan all available WiFi networks, and then it will print the list of their SSID name in the Serial Monitor.
Most commonly, you will end up in this error while uploading
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
This error is caused because your ESP32 board is not entering into bootloader mode. Mostly we have phased this problem in cheap Chinese boards of ESP32.
Follow the steps to encounter this error:
- Select the right COM port and board name.
- Press the upload button in Arduino IDE.
- When your code starts compiling, hold down the BOOT button on ESP32.
- When compiling is finished, you will see the Connecting……. message in Arduino IDE, Now you have to release the BOOT button.
If it works, you will see the uploading process started, and some numbers in percentages will be printed.
If you see the same pattern in Arduino IDE, Try holding the BOOT button again for a while and release it.
Note:- Timing is important for this; It may require few tweaks and little practice to solve this.
- After that, you will see the Done uploading message in Arduino IDE.
Now you can press the ESP32 onboard Enable button to restart the uploaded ESP32 code.
Note:- You will need to follow the same button sequence every time you start uploading your code.
We have learned how to start programming ESP32 boards using Arduino IDE. The process had become very simple compared to the initial days when espressif had started integrating ESP32 with the Arduino environment.
Now it’s time for building new projects based on ESP32.