Embedded System
PROJECT 1: LED Blink Utilizing ESP32
Hello readers! As of today, I will be sharing my experience throughout this semester about embedded systems utilizing ESP32. Each week, I will be posting every project assignment I’m doing.
ESP32 model that I’m using is ESP32-DevKitM-1. Further information are shown in the link below.
To get started, I need to install Arduino IDE through this link https://www.arduino.cc/en/software.
As well as the software needed to detect my ESP32 board. I found a similar article that shows us very clear steps to install all initial environments required. Here is what it says:
- 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
src : https://medium.com/@fernaldifz/embedded-system-project-1-led-blink-utilizing-esp32-f102fc1f147e
The Arduino IDE should look like this.
Next up, we can try making the ESP32 blink by applying the basic example provided inside the IDE.
- Go to File > Example > Basics > Blink
- A new window will pop up, it contains code to make the ESP32 blinking effect
- Click verify, and you’re good to go.
Unfortunately, it doesn’t go that well on my first try.
I tried uploading by clicking the upload button beside the verify button, but it gives me an error with this message
Arduino: 1.8.19 (Mac OS X), Board: “DOIT ESP32 DEVKIT V1, 80MHz, 921600, None”
Sketch uses 198438 bytes (15%) of program storage space. Maximum is 1310720 bytes.
Global variables use 13248 bytes (4%) of dynamic memory, leaving 314432 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port /dev/cu.usbserial-0001
Connecting…….._____….._____….._____….._____….._____….._____….._____A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet headerThis report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
After failing countless time just to make the built-in LED blink, I accidentally found out that my ESP32 never had the ability to blink its light for an additional purpose other than being an indicator that it was working normally. I found an article stating such case where an ESP32 has no built-in LED to do tasks given from Arduino IDE.
update::
A friend of mine decided to lend me a hand by giving me his ESP32 to try experimenting with it.
If you noticed anything, I added an external LED to my ESP32. The routing for the cable will be as explained.
- gnd (Ground) -> negative row
- 3v3 (Voltage) -> positive row
- LED -> positive row
- d5 (Space that is available to use as an I/O) -> same row as the resistor
- resistor -> same row as LED