Lesson plan

Build a smart home hub lesson plan

A web dashboard on an ESP32-C3 that switches relays, reads sensors and runs schedules from a clock.

2 chapters, 3 lessons, about 3 hours, on the ESP32-C3-DevKitM-1. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • Serve a dashboard and switch real loads through relays and PWM.
  • Let sensors, then a clock, decide when things switch.

Materials for the whole unit

  • Character LCD with I2C backpack
  • DC motor
  • ESP32-C3-DevKitM-1
  • Filament lamp
  • Full-size breadboard
  • LED
  • Motion sensor
  • Real-time clock, DS3231
  • Relay board, two channels
  • Resistor
  • Temperature and humidity, DHT22

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h

Control

Serve a dashboard and switch real loads through relays and PWM.

LessonTimeWhat students do
A dashboard that switches real thingsServe a web page from the ESP32-C3 and use it to switch a lamp and a fan through relays, and to dim a porch light. Why a relay, and why it is wired the way it is.60 min
  1. Your own web server
  2. Switch on the lamp
  3. And the fan
  4. Dim the porch

Materials

  • DC motor
  • ESP32-C3-DevKitM-1
  • Filament lamp
  • Full-size breadboard
  • LED
  • Relay board, two channels
  • Resistor

Check for understanding

Each student finishes "A dashboard that switches real things" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Dim the porch".

Chapter 2. About 2 h

Automation

Let sensors, then a clock, decide when things switch.

LessonTimeWhat students do
Sensors and automatic modesAdd a DHT22 and a motion sensor, and give each switch an auto mode: the fan follows the temperature and the lamp waits for someone to walk by.60 min
  1. Two sensors, two supplies
  2. A fan that thinks
  3. Hello, is anyone there?
  4. Humidity
Schedules and a status screenFinish the hub: a DS3231 clock that turns the porch light on at dusk and off at bedtime, and an LCD that shows the time, the climate and every switch.60 min
  1. A screen on the wall
  2. Dusk
  3. Bedtime
  4. Everything at a glance

Materials

  • Character LCD with I2C backpack
  • DC motor
  • ESP32-C3-DevKitM-1
  • Filament lamp
  • Full-size breadboard
  • LED
  • Motion sensor
  • Real-time clock, DS3231
  • Relay board, two channels
  • Resistor
  • Temperature and humidity, DHT22

Check for understanding

Each student finishes "Schedules and a status screen" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Everything at a glance".

Your class

Teach this unit as a class

Start a class from this course and its 3 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.