databot™ Basic Training
Want to explore IoT projects? Then learning ESP32 is a great starting point. In this tutorial, you will learn how to install ESP32 in Arduino IDE. We will use Windows for this tutorial, but the same steps can be used for, mac and Linux OS.
To program ESP32, we have to add an addon package in Arduino IDE.
Content by TechTOnions.com
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.
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
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
If you are new to ESP32 use
Stable release URL:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.jsonIf 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.
Please 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.
We are using a generic ESP32 development board easily available everywhere.
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.