Intro to Embedded Systems with ESP32 [Getting Started — LED Blink]

Reinhart Lim
4 min readFeb 3, 2023

--

Hi, I’m an Information System and Technology student and this is my journey in Embedded Systems as I am taking II2260 this semester. In this blog, I want to share my experience using ESP32 and do some experiments with it.

Getting Started

ESP32 DOIT Devkit V1 Development Board

ESP32 is a low-cost and low-power SoC microcontroller that includes a dual-core 32-bit processor with WiFi and Bluetooth capabilities. In this project, I will be sharing how to set up the environment for ESP32 development and blinking ESP32 LED.

Hardware Required

  • ESP32 DOIT DEVKIT V1
  • MicroUSB to Type-A
  • PC/Laptop

Software Required

  • Arduino IDE

Setup Environment: Arduino IDE

https://www.arduino.cc/en/software

Download Arduino IDE then installs the software by following the installation guide. Follow the steps below after installing the IDE on your PC/Laptop :

  1. Configure Arduino IDE
Open File > Preferences (Ctrl+Comma)
Paste https://dl.espressif.com/dl/package_esp32_index.json to “Additional boards manager URLs”
Open Tools > Board > Board Manager
Filter ESP32 then install the package
Open Tools > Board > esp32 > Select DOIT ESP32 DEVKIT V1

2. Setting Communication Port

ESP32 uses UART to handle serial communication with the PC. Universal Asynchronous Receiver/Transmitter (UART) is a serial communication protocol that handles communication (transmit and receive serial data) using widely-adopted asynchronous serial communication interfaces. We need to download then install drivers for hosting communication between PC and ESP32.

Download CP210x Universal Windows Driver: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads

3. Connecting ESP32 Board

Select Board > Filter Board & Choose Port

Plug the MicroUSB (or your Android charger cable🤖) into your PC and ESP32. Then go to select board and choose DOIT ESP32 DEVKIT V1 and available port.

Blinking my first LED!!!

The Arduino IDE already had some built-in basic example codes for practicing and testing the development board. I’ll use the “Blink” example code from Arduino IDE for blinking ESP32 LED in this first test.

File > Examples > 01.Basics > Blink
// Blink
// This example code is in the public domain.
// https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

The first thing to do is verify the code.

Verify

Then Upload.

Upload

After uploading success, the ESP32 will be blinking repeatedly with a 1-second delay because of the loop() and delay(1000) function. The loop() function performs exactly like its name, looping consecutively and delay() function delaying the LED blink. Those two functions combined make the LED lights blink at the desired interval. To understand more about the Arduino Programming Language I suggest reading the documentation at:

https://www.arduino.cc/reference/en/

Result

This might be helping for some people that encounter some problems with the ESP32 when doing this project:

I hope this blog can be useful for those who are learning and getting started using ESP32. That’s all for this project, stay tuned for the next experiment with ESP32 !!

--

--

No responses yet