Introduction
I recently started learning embedded systems and robotics using an ESP32-S3 starter kit. My first project was to make an LED blink. Although it sounds simple, it turned out to be a valuable introduction to how hardware and software interact.
The Goal
The objective of this project was:
- Connect an LED to the ESP32
- Write a simple program
- Make the LED turn ON and OFF repeatedly
Components Used
- ESP32-S3 board
- USB cable (for power and programming)
- LED
- Resistor
- Breadboard or extension board
- Jumper wires
Understanding the Circuit
To light an LED, you need a complete electrical loop:
GPIO โ LED โ Resistor โ GND
- GPIO provides controlled power
- The LED emits light when current flows
- The resistor limits current to prevent damage
- GND completes the circuit
The Code
Here is the MicroPython code used:
from machine import Pin
import time
led = Pin(4, Pin.OUT)
while True:
led.value(1)
time.sleep(0.5)
led.value(0)
time.sleep(0.5)
This program continuously turns the LED ON and OFF every half second.
Challenges Faced
1. Running Code in the Wrong Environment
Initially, I tried running the code using standard Python on my computer, which resulted in:
ModuleNotFoundError: No module named 'machine'
This happened because MicroPython code must run on the ESP32, not on a regular Python interpreter.
2. Confusion Between Arduino and MicroPython
I switched between Arduino IDE and Thonny, which caused confusion. Each uses a different programming language and workflow. Choosing one environment and sticking with it resolved this issue.
3. Breadboard Misunderstanding
At first, I did not understand how breadboard connections work. The key realization was:
- Rows are connected horizontally
- The center gap separates the two sides
My initial wiring did not form a complete circuit.
4. Unstable Connections
At one point, the LED only turned on when I manually touched wires together. This indicated that the circuit worked, but the connections were not properly secured.
5. Invalid GPIO Pins
Using certain pins resulted in errors such as:
ValueError: invalid pin
This showed that not all GPIO pins are available or usable on every ESP32 board.
6. Physical Layout Constraints
The ESP32 board covered many breadboard rows, limiting access to certain pins. I had to adjust my wiring and choose accessible GPIO pins.
The Breakthrough
The project worked when I:
- Used a valid GPIO pin
- Connected the LED correctly:
- Long leg to GPIO
- Short leg to resistor and GND
- Ensured all connections were firm and properly placed
The LED finally blinked as expected.
Key Learnings
This project helped me understand:
- How GPIO pins control hardware
- The importance of GND in completing a circuit
- How current flows in a loop
- Why resistors are necessary
- The need for alignment between software and hardware
Conclusion
Although simple, this project provided a strong foundation in embedded systems. It highlighted the importance of careful wiring, correct configuration, and systematic debugging.
Next Steps
- Control the LED using a button
- Read input from sensors
- Connect the ESP32 to WiFi
Advice for Beginners
- Focus on one tool at a time
- Test small parts of the system incrementally
- Expect errors and use them as learning opportunities
- Pay close attention to wiring and connections
This project marks the beginning of my journey into embedded systems and robotics.


