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.
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.
Control
Serve a dashboard and switch real loads through relays and PWM.
| Lesson | Time | What 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 |
|
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".
Automation
Let sensors, then a clock, decide when things switch.
| Lesson | Time | What 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 |
|
| 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 |
|
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".
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.