First Time Getting My Hands On ESP32
Hello there, I’m Muhammad Rizki Pratama or you can call me Tama, I think that would be easier. I am on my second year studying Information System and Technology in Bandung Institute of Technology. This semester, I got Embedded System as one of the subject I’m studying. It requires me to have an ESP32 computer to learn the materials and the professor suggested us to buy ESP32 DEVKIT so that’s the ESP32 I’m using(specifically ESP32 DEVKIT V1) in this article and also in the upcoming articles.
The first project is to light and blink the internal LED of the ESP32 and (optional) light a blinking external LED. First time first, I installed Arduino IDE in my PC to write the code I’d upload to the ESP32. The installation did take a while since my internet connection speed was moderate-low. After installing the IDE, I then added the board package to the IDE so that my machine could recognize my ESP32 computer. Here is the board package link I added to the Additional Board field, https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json. Waited a while and I could select ESP32 DEVKIT V1 type on my machine. I then plugged my ESP32 with a type-B USB cable. At first I was so nervous of the LED not turning on, but as soon as I plugged the other end of the cable to my PC, the red light indicator lighted up. Really felt glad back there, but there was still one matter worried me. The internal LED. I and bunch of my friends purchased the ESP32 together from the same store in an e-commerce and one of us got his ESP32 internal LED not functioning. I wrote a simple code that lights the internal LED to test it. Bellow is the code I wrote:
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED_BUILTIN, HIGH);
}
Successfully compiled it and uploaded it to my ESP32. Bellow is an example of what’s showing in the Arduino IDE’s Terminal. However, this is the snapshot of compiled and uploaded code of the second code I wrote (the blinking code bellow this, not the code above this):
The blue LED turned itself on. I was really glad I didn’t get the ESP32 like the one my friend got. Here is a picture so you guys can see how It looked:
Proceed to the next step, I wrote the code to make the LED blink. Bellow is the code I wrote:
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED_BUILTIN, HIGH);
delay(499);
digitalWrite(LED_BUILTIN, LOW);
delay(499);
Hit the upload button and done uploading, The LED started blinking. Here is a GIF of how the LED blink:
By that, the mandatory task for this first project was completed. I couldn’t do the optional task because I haven’t get myself the components needed (LEDs and Capacitors). As for the breadboard and cables, I already got them with me, but as can be seen on the pic and GIF, I haven’t plugged my ESP32 into the breadboard yet because the breadboard wasn’t wide enough for the ESP32. What I mean by that is I got a breadboard with pin slot from a-j, but the ESP32 takes 9 out of 10 slots. It means I can only access pins on one side of the ESP32 and can’t access the pins on the other side. So I think I had to get a wider breadboard.
I think this first project is a good start for my ESP32 learning journey. I hope I can do more things and learn new things from the projects ahead. Thank you for reading this article and see you on the next one!