Programming "Blinking Internal LED" on ESP32 using Arduino IDE

 Hello everyone!

This article contains step-by-step how to program on ESP32 using Arduino IDE. The example below will show the simplest program for ESP32, which is making it's internal LED blink with interval timing.

STEP 1: Required Hardwares

1. ESP32

I am going to use ESP32 Devkit V1 with 30 pins.

2. PC

To develop the code and power source.

3. Micro USB Cable

ESP32 uses micro USB cable to connect to it's power source and/or source code

4. Breadboard (optional)

I use breadboard to ensure ESP32's pin safety

STEP 2: Required Softwares

1. Installing Arduino IDE, you can download it from: https://www.arduino.cc/en/software


2. Installing the correct board you are using by going to File > Preferences. Insert this URL into "Additional Boards Manager URLs": https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

3. Go to Tools > Board > Boards Manager and then search and install esp32 module.

Thereafter, choose which board you are currently using. In my case, i choose "DOIT ESP32 DEVKIT V1".

4. Since ESP32 need USB to UART driver, you can install the driver here:  https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers

After installing the driver, choose the USB to UART Port under Tools > Port and select which port it is installed. In my PC, the port come as COM(number) as shown:


If all the requirement software already installed, the next step is making the source code.

STEP 3: Making the source code

Open the Arduino IDE. Then on the menu bar, open File > Examples > 01.Basics > Blink and soon a code will show on the IDE as shown:

Click the check list icon on top left of the IDE to compile the code. After it is done compiling, a message will show on the bottom of the screen.

STEP 4: Connecting and Uploading the Source Code

Connect the ESP32 to your PC USB port using the Micro USB cable. A red light should turn on indicating the board is powered. 

When the board is ready, click the arrow button beside the compiling button to upload the code into the ESP32 board.



STEP 5: Observe

After Arduino IDE done uploading the program, the Built in LED in ESP32 should blink with 1000ms interval. 


You can change the interval by inserting different number in the code. Before uploading the program, make sure to reset the ESP32 board by holding "Boot" when uploading the program then "Enable" after the program uploaded.

Comments

Popular posts from this blog

"Built-in Touch, Hall-Effect, and Temperature Sensor" on ESP32 using Arduino

Multiple I2C Devices using ESP32