Lesson plan

IoT capstone: your own connected product lesson plan

Design and build a connected product of your own on the ESP32-C3, milestone by milestone: the brief, the data contract, firmware, a dashboard, failure handling, a security review and a demo.

4 chapters, 7 lessons, about 8 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

  • Pick a product, write requirements with numbers, and design the data before the code.
  • Firmware that never waits, and a dashboard served by the board itself.
  • Survive a bad network and a curious attacker.
  • A 60 second demo, a release, a README and a link to share.

Materials for the whole unit

  • ESP32-C3-DevKitM-1
  • Full-size breadboard
  • LED
  • Pushbutton
  • Resistor
  • Temperature and humidity, SHT31

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 2 h 20 min

Plan it

Pick a product, write requirements with numbers, and design the data before the code.

LessonTimeWhat students do
Pick a productThe brief for a connected product of your own, and FridgeWatch, the reference build: a shared-fridge monitor that has to do its one job before it ever touches a network.65 min
  1. The brief
  2. Predict the reading
  3. Someone left the door open
  4. A requirement with a number in it
  5. A button for right now
  6. Your version: the brief
Data and API designDesign the message before the code: a versioned JSON reading with units in its field names, a round trip through echo.mokxi to prove it parses, and a config pulled from api.mokxi that is checked before it is trusted.75 min
  1. A reading becomes a message
  2. Units in the names
  3. A round trip through echo.mokxi
  4. Settings come from the server
  5. Feed the parser by hand
  6. Add a field
  7. Your version: the data contract

Materials

  • ESP32-C3-DevKitM-1
  • Full-size breadboard
  • LED
  • Pushbutton
  • Resistor
  • Temperature and humidity, SHT31

Check for understanding

Each student finishes "Data and API design" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your version: the data contract".

Chapter 2. About 2 h 10 min

Build it

Firmware that never waits, and a dashboard served by the board itself.

LessonTimeWhat students do
FirmwareThe node as one loop that never waits: each job checks its own millis() clock and returns, so the LED keeps blinking while reports go out, and a serial console answers at any moment.65 min
  1. Run it: five jobs, one loop
  2. Predict the count
  3. The loop that never waits
  4. Report twice as often
  5. Ask it how it is
  6. Your version: the firmware
DashboardThe node serves its own dashboard and a JSON endpoint from a WebServer, with one setLimit() behind both the form and the Serial Monitor, and the status LED following whatever either one sets.65 min
  1. Run it: a page from the fridge
  2. Open it
  3. One door, two keys
  4. The LED agrees
  5. An endpoint for programs
  6. Your version: the dashboard

Materials

  • ESP32-C3-DevKitM-1
  • Full-size breadboard
  • LED
  • Pushbutton
  • Resistor
  • Temperature and humidity, SHT31

Check for understanding

Each student finishes "Dashboard" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

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

Chapter 3. About 2 h 20 min

Harden it

Survive a bad network and a curious attacker.

LessonTimeWhat students do
Failure handlingMake it expect trouble: WiFi as a state machine that names each failure and backs off, a weak-signal warning, a config fetch that survives errors and bad JSON, and readings buffered through an outage and sent when it ends.75 min
  1. A wrong password, named and retried
  2. A weak link
  3. A server that answers nonsense
  4. Back off from a broken server
  5. Lose the network, keep the readings
  6. Cap the backoff
  7. Your version: the failure table
Security reviewReview the node like an attacker: a token printed to the log, a limit that trusts any text, a name that could inject HTML into the dashboard, and a short threat model of who can reach what.65 min
  1. Read the log like an attacker
  2. Mask it
  3. Never trust input
  4. An allow list for names
  5. A threat model on one page
  6. Your version: the review

Materials

  • ESP32-C3-DevKitM-1
  • Full-size breadboard
  • LED
  • Pushbutton
  • Resistor
  • Temperature and humidity, SHT31

Check for understanding

Each student finishes "Security review" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

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

Chapter 4. About 1 h 15 min

Ship it

A 60 second demo, a release, a README and a link to share.

LessonTimeWhat students do
Demo and write-upThe finished build in a 60 second demo: it reports, it warns, it survives an outage. Then tag the release, write the README and share the project.75 min
  1. Run the release candidate
  2. Beat 1: it works
  3. Beat 2: it notices
  4. Beat 3: it survives
  5. Tag the release
  6. The write-up
  7. Your version: ship it

Materials

  • ESP32-C3-DevKitM-1
  • Full-size breadboard
  • LED
  • Pushbutton
  • Resistor
  • Temperature and humidity, SHT31

Check for understanding

Each student finishes "Demo and write-up" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

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

Your class

Teach this unit as a class

Start a class from this course and its 7 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.