Firmware capstone: your own device lesson plan
Take your own device from an idea to a tagged release: a brief, testable requirements, a layered architecture, a driver from the datasheet, self-tests and unit tests, a watchdog and a power budget, then the write-up.
Objectives and materials
By the end, students can
- Choose the device, prove the parts, and write requirements you can test.
- Layers, a state machine, a command shell and a driver from the datasheet.
- Self-tests, unit tests, a watchdog, recovery and a power budget.
- A version, release notes, a demo and the write-up for your portfolio.
Materials for the whole unit
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED
- Piezo speaker
- Pressure, humidity and temperature, BME280
- Pushbutton
- Resistor
- Slide switch
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.
Plan it
Choose the device, prove the parts, and write requirements you can test.
| Lesson | Time | What students do |
|---|---|---|
| Pick a deviceThe brief, the reference device and the bring-up: scan the I2C bus, check the chip id, predict a reading, and prove the LED, the buzzer and the button all work before writing a single feature. | 65 min |
|
| RequirementsFive numbered requirements, each one testable: an alarm above a limit, hysteresis so it does not chatter, a button that silences the buzzer, and a change request handled by editing one constant. | 80 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED
- Piezo speaker
- Pressure, humidity and temperature, BME280
- Pushbutton
- Resistor
- Slide switch
Check for understanding
Each student finishes "Requirements" 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: write your requirements".
Build it
Layers, a state machine, a command shell and a driver from the datasheet.
| Lesson | Time | What students do |
|---|---|---|
| ArchitectureThree layers that only talk downward: drivers, a state machine with IDLE, ALARM and FAULT, and a serial command shell with a table of commands you extend with one of your own. | 65 min |
|
| DriversA BME280 temperature driver written straight from the datasheet: registers, calibration, the integer compensation formula, error codes instead of wrong numbers, a configurable address and a plausibility check that catches a chip that reset. | 65 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED
- Piezo speaker
- Pressure, humidity and temperature, BME280
- Pushbutton
- Resistor
- Slide switch
Check for understanding
Each student finishes "Drivers" 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: write a driver".
Prove it
Self-tests, unit tests, a watchdog, recovery and a power budget.
| Lesson | Time | What students do |
|---|---|---|
| TestsSelf-tests at boot that print PASS or FAIL, a test command for the bench, and unit tests of a pure state machine function that run on the chip, catch a real hysteresis bug, and grow by one case. | 65 min |
|
| Power and reliabilityA task watchdog that reboots a stuck loop and says why, a FAULT state that recovers by itself when the sensor comes back, and a battery budget worked out from the firmware's own measured awake time. | 65 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED
- Piezo speaker
- Pressure, humidity and temperature, BME280
- Pushbutton
- Resistor
- Slide switch
Check for understanding
Each student finishes "Power and reliability" 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: failure modes and a budget".
Ship it
A version, release notes, a demo and the write-up for your portfolio.
| Lesson | Time | What students do |
|---|---|---|
| Release and write-upGreenhouse guard 1.0.0: a version string, a version command, release notes with known issues, a version bump, a demo run, and the README, demo script and shared project link that make it a portfolio piece. | 65 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED
- Piezo speaker
- Pressure, humidity and temperature, BME280
- Pushbutton
- Resistor
- Slide switch
Check for understanding
Each student finishes "Release and write-up" 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: ship it and write it up".
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.