ESP32 Starter
Understand the ESP32 board, the wiring, the code and what it does, no hardware needed. Every lesson has a 3D scene you can turn and click, and every example compiles with arduino-cli.
Basics
- Lesson 1 · Meet the ESP32
What is on this board and what each part does.
- Lesson 2 · Light an LED
Use GPIO2 to blink an LED on and off.
- Lesson 3 · Press a button
Read a button: hold it and the LED lights, let go and it goes out.
- Lesson 4 · Breathing LED
Use PWM to fade an LED slowly up and slowly down.
- Lesson 5 · Turn a knob
Read a potentiometer’s voltage with the ADC; turn it and the serial readings follow.
- Lesson 6 · Touch sensing
No button needed: touch a piece of copper and the board notices.
- Lesson 7 · Make a sound
Use tone to play notes on a buzzer: a bit of “Twinkle, Twinkle”.
- Lesson 8 · Color LED strip
One data wire drives 8 WS2812s: a flowing rainbow.
Sensors & actuators
- Lesson 9 · Temperature & humidity
Read temperature and humidity from a DHT11 and print them every 2 seconds.
- Lesson 10 · Ultrasonic distance
An HC-SR04 sends out ultrasound and times the echo to work out the distance.
- Lesson 11 · Swing a servo
Drive an SG90 with 50 Hz PWM, sweeping back and forth between 0° and 180°.
- Lesson 12 · OLED display
Drive a 0.96″ screen over I2C to show text, a number and a progress bar.
ESP32 specials
- Lesson 13 · Join Wi-Fi
The ESP32 joins your router and serves a web page; tap buttons on your phone to switch the LED.
- Lesson 14 · Bluetooth LE
The ESP32 acts as a BLE peripheral; write a characteristic from your phone to switch the LED.
- Lesson 15 · Deep sleep
Put the ESP32 to sleep to save power, and wake it on a timer or a touch.
- Lesson 16 · Connected weather station
Temperature and humidity on the OLED, and on a web page you can open from your phone.
The 3D scenes need JavaScript and a browser with WebGL 2 (a recent Chrome, Edge, Firefox or Safari). Without 3D, the lesson list below is still readable.