ESP32 Project: Led Blink

Rania Sasi Kirana
5 min readFeb 4, 2023

--

a step-by-step guide

Hello! Today I’m going to talk about my very first hands-on project on building an embedded system. First off, my name is Rania Sasi Kirana and this is a story about a project I did in my class, II2260 Embedded System in Bandung Institute of Technology.

What is an embedded system?

I bet you’re curious when I first mentioned an embedded system. An embedded system is a combination of software and computer-based hardware, where we will be using a microprocessor or a microcontroller as the hardware.

About this project

In this particular project, we will be using ESP32 microcontroller and Arduino IDE (Integrated Development Environment) as the programming environment. The reason why we’ll be using Arduino IDE is because it is compatible with the ESP32. Don’t start to panic now as I will show you how to install Arduino IDE and other things that we will need to kick start this project.

Step 1: Hardware Required

First things first, you’re going to need an ESP32 Development Board, specifically ESP32 with the ESP-WROOM-32 chip (DEVKIT) V1. You can easily find this on electronic stores or better yet, you can look it up online. There are tons of ESP32's on any online shopping platforms. While you’re at it, you’re also going to need a USB cable and breadboard. You don’t necessarily need the breadboard for this first project, it’s just better to have it so you can insert the ESP32 to the breadboard for a better grip and you might need it for future projects. On a side note, you should have a few extra USB cables to spare because some might not work to connect the ESP32 with your computer.

Step 2: Software Required

As I have mentioned before, you’re going to need to install Arduino IDE in your computer so that you’re able to program the ESP32. Don’t worry cause I’m going to show you how to install it.

First, install the Arduino IDE on https://www.arduino.cc/en/Main/Software. You can go ahead and click the download options accordingly. From that point on, you just follow all the steps to install the Arduino IDE on your computer. And then you’re going to run and configure the Arduino so that you can use it to program your ESP32 board by installing the ESP32 board package.

  1. Open the File window -> Preferences.

2. Insert the following link on Additional Board Manager and then hit “OK”.

URLs: https://dl.espressif.com/dl/package_esp32_index.json

3. Next, open Tools window -> Boards Manager. Type in “ESP32” on the Boards Manager search, then click “INSTALL”.

4. After installing the ESP32 package, open Tools window -> ESP32, then choose “DOIT ESP32 DEVKIT V1” to adjust to the type of board we’re using.

Lastly, you’ll need to install the driver USB to UART in order to enable communication to happen between your computer and the ESP32 board.

URLs: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads

Now, if you’re a Windows user like me, you’re going to want to install the latest version “CP210x Universal Windows Driver”. After finishing the installation, you’d have to extract the entire folder to your computer since it will be installed in ZIP.

Open the extracted folder -> click right on the silabser.inf file -> Show more options -> Install.

Step 3: You’re all set

We’re going to try the simple thing first, making the ESP32 board’s LED blink. There is a built-in example in the Arduino IDE to make the LED blink. You just have to open the File window -> Examples -> 01.Basics -> Blink.

You’ll need to select the port. Click Select Board -> Select other board and port. Search “DOIT ESP32 DEVKIT V1” for the board selection -> select the port -> click “OK”.

Click the button that looks like a checklist underneath the File window to verify, then the arrow button next to it to upload.

Now, this part is really important. I had a bit of trouble in this point of the project. Some computers will automatically select the port for you, but if your computer is like mine, you’ll need to select the port manually. I chose the COM3 Serial Port since I didn’t know which port to use at first and my friends told me to use the COM3. Unfortunately, that didn’t work, and an error message appeared.

I started to ask for my friend’s help but none of them knew the solution to my problem. Some didn’t have a problem with that, others have the exact same problem but didn’t know how to solve it. Then I noticed one of the ports had the word “(USB)” next to it, so I decided to verify and upload again and it worked. The serial port number is not all going to be the same between different computers, that’s why COM3 worked on my friend’s computer but not mine. The word “(USB)” shows which port you’re currently plugging the USB cable to.

Then, a different error message appeared. Luckily, one of my friends came across the same problem and was able to help me.

As it turns out, when the dot “…..____….__” following the word “Connecting” appeared, you have to hold the “BOOT” button on the ESP32 board as I have highlighted yellow in the picture below.

So, all you gotta do now is just verify and upload again, then hold the “BOOT” button, and voila! The ESP32 board’s LED will start blinking.

That’s all from me for this very first project. I hope you enjoy this article and you can learn something from it. I will be updating on future projects in this blog. Stay tune!

--

--