ESP32 Starter

Loading…

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

  1. Lesson 1 · Meet the ESP32

    What is on this board and what each part does.

  2. Lesson 2 · Light an LED

    Use GPIO2 to blink an LED on and off.

  3. Lesson 3 · Press a button

    Read a button: hold it and the LED lights, let go and it goes out.

  4. Lesson 4 · Breathing LED

    Use PWM to fade an LED slowly up and slowly down.

  5. Lesson 5 · Turn a knob

    Read a potentiometer’s voltage with the ADC; turn it and the serial readings follow.

  6. Lesson 6 · Touch sensing

    No button needed: touch a piece of copper and the board notices.

  7. Lesson 7 · Make a sound

    Use tone to play notes on a buzzer: a bit of “Twinkle, Twinkle”.

  8. Lesson 8 · Color LED strip

    One data wire drives 8 WS2812s: a flowing rainbow.

Sensors & actuators

  1. Lesson 9 · Temperature & humidity

    Read temperature and humidity from a DHT11 and print them every 2 seconds.

  2. Lesson 10 · Ultrasonic distance

    An HC-SR04 sends out ultrasound and times the echo to work out the distance.

  3. Lesson 11 · Swing a servo

    Drive an SG90 with 50 Hz PWM, sweeping back and forth between 0° and 180°.

  4. Lesson 12 · OLED display

    Drive a 0.96″ screen over I2C to show text, a number and a progress bar.

ESP32 specials

  1. Lesson 13 · Join Wi-Fi

    The ESP32 joins your router and serves a web page; tap buttons on your phone to switch the LED.

  2. Lesson 14 · Bluetooth LE

    The ESP32 acts as a BLE peripheral; write a characteristic from your phone to switch the LED.

  3. Lesson 15 · Deep sleep

    Put the ESP32 to sleep to save power, and wake it on a timer or a touch.

  4. 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.

中文版