Index
What You Need:
- ESP32 or ESP32-C3 board
- Micro USB or USB-C cable
- Computer with internet access
- Software tools:
- Thonny IDE
- Python 3.x installed on your PC
esptool.py
to flash MicroPython- MicroPython firmware
.bin
file for ESP32
Step-by-Step Setup
๐ Step 1: Install Python & esptool
If Python is not installed: ๐ Download Python Then install esptool
:
pip install esptool
๐ฝ Step 2: Download MicroPython Firmware
Download the latest .bin
firmware for your chip from: ๐ https://micropython.org/download/esp32
๐ Step 3: Connect ESP32 & Identify COM Port
Plug the board in and find the COM port:
- Windows: Check in Device Manager > Ports
- macOS/Linux: Use
ls /dev/tty*
to find something like/dev/ttyUSB0
๐ฅ Step 4: Flash MicroPython to ESP32
๐น Erase existing firmware:
esptool.py --chip esp32 --port COMx erase_flash
๐น Flash MicroPython:
esptool.py --chip esp32 --port COMx --baud 460800 write_flash -z 0x0 firmware.bin
Replace COMx
with your actual port and firmware.bin
with your downloaded file name.
๐ป Step 5: Install & Set Up Thonny IDE
- Install from https://thonny.org
- Open Thonny โ Tools > Options > Interpreter
- Select:
- Interpreter: MicroPython (ESP32)
- Port: Your ESP32 COM port
Youโre now connected! ๐
๐งช Step 6: Try Your First Program
In Thonnyโs editor, type:
print("Hello ESP32!")
Click Run โ You should see the output in the shell. Try controlling a GPIO:
from machine import Pin
import time
led = Pin(2, Pin.OUT) # Onboard LED on many ESP32 boards
while True:
led.value(1)
time.sleep(0.5)
led.value(0)
time.sleep(0.5)
๐ What’s Next? โ Learning Path
โ Beginner Projects
- Blink LED
- Control LEDs with a button
- Read temperature with DHT11/DHT22 sensor
- Display text on OLED display
โ Intermediate
- Host a web server
- Connect to Wi-Fi
- Use I2C and SPI sensors
- Send data to cloud via MQTT
โ Advanced
- Dual mode networking (hotspot + Wi-Fi)
- OTA (Over-the-Air) updates
- Deep sleep & power optimization
- Captive portal for Wi-Fi config