Embedded System Project 1: LED Blink Utilizing ESP32

Fernaldi Fauzie
4 min readJan 29, 2021

--

My ESP32

Hi! At this point I am interested to share my beginner experience with ESP32 as I am taking II2260 Embedded System right now. This project is simple experiment to do blink toward ESP32 LED that make use of Arduino IDE software to verify and upload the code to blink LED in ESP32.

Getting Started

First of all, you need :

  • Microcontroller ESP32 Development Board
  • USB Type A Male to Micro USB
  • Arduino IDE installed in your computer.

You may get your latest Arduino IDE software from arduino.cc/en/Main/Software

arduino.cc/en/Main/Software

Next, we have to install ESP32 board in your Arduino IDE. Simply by :

  • Open your Arduino IDE, then go to File > Preferences
  • Enter https://dl.espressif.com/dl/package_esp32_index.json into the “Additional Board Manager URLs” field. Click OK
  • Go to Tools > Board > Boards Manager open the Boards Managers
  • Search “ESP 32” then press install button for “ESP32 by Espressif Systems
  • Yup, in the few seconds your ESP32 board installation should be done

Now, we can go to the next step which is setting communication port, as ESP32 board has USB to UART converter that needs to be installed for serial data communication between ESP32 and your computer. You may want to download it from https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers

Next, you should :

  • Plug ESP32 to your computer
  • Open your Arduino IDE, then go Tools > Board menu. In my case, I go for DOIT ESP32 DEVKIT V1
  • Then go Tools > Port. In my case, I go for COM3

If you are done with all of it, CONGRATULATIONS! Now we can finally begin my first project.

My First Project

Schematic (Pretty obvious? I know but I still want to share with you guys :D )
LED Blink Code

We can simply do this project by :

  • Plug ESP32 to computer
  • Open your Arduino IDE, then click verify
  • Upload your LED blink code
ESP32 connected with My Computer
My LED blink with ESP32 Project

Let’s go deeper to analyze the LED blink code

At the void loop function, basically we can control how long we want to turn on/off the LED by playing with the delay function. In my case, if I want to :

  • Change duration of my LED turned on, simply change the delay function before digitalWrite(LED_BUILTIN, LOW)
  • Change duration of my LED turned off, simply change the delay function before digitalWrite(LED_BUILTIN, HIGH).

Keep in mind that this function will keep looping, so pay attention with what I meant by “before”.

In conclusion, we can setup the frequency of blink by using delay function, as the frequency of blink depends on the delay. The higher the delay, the slower it blink, and vice versa.

Oh BTW, if you want to stop your ESP32 from blinking, you can simply do Ctrl + N in your Arduino IDE, then upload the new code.

For sure, not every experiment will go well with everyone. Some of you might find trouble in doing this very simple project, but no worries! I would like to give you guys link of pretty good website that troubleshooting common problem that found in ESP32 board.

Of course, all credit goes to randomnerdtutorials.com for it’s marvelous troubleshooting guide!

Don’t forget to have fun with your ESP32! My pretty first story might already ended here, but to be fair there are still many things to do with ESP32! I hope that this pretty basic but fun story can bring you guys more insight to stay curious with ESP32! See you guys in the next story!

--

--

No responses yet