Source: https://mokxi.com/teachers/plans/firmware-capstone
Updated: 2026-11-12

Lesson plan

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

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

Start a class from this course

The unit

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

Chapter 1. About 2 h 25 min

## Plan it

Choose the device, prove the parts, and write requirements you can test.

Lesson | Time | What students do

Pick a device The 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

- The brief, and the first scan
- Is it the chip you think it is?
- Predict the reading
- Every output, on purpose
- And the input
- Your version: pick your device

Requirements Five 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

- A requirement is a test you have not run yet
- Predict the alarm
- Hear it
- R4: silence, not cancel
- R3: why the alarm needs a gap
- A change request
- Your version: write your requirements

### 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".

Chapter 2. About 2 h 10 min

## Build it

Layers, a state machine, a command shell and a driver from the datasheet.

Lesson | Time | What students do

Architecture Three 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

- Three layers
- Ask it
- Change it from the shell
- The third state
- Add a command
- Your version: draw your architecture

Drivers A 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

- From the datasheet
- Predict the compensation
- Errors, not wrong numbers
- A board strapped differently
- Catch the chip that reset
- Your version: write a driver

### 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".

Chapter 3. About 2 h 10 min

## Prove it

Self-tests, unit tests, a watchdog, recovery and a power budget.

Lesson | Time | What students do

Tests Self-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

- Self-tests at boot
- Fail one on purpose
- The unit tests found a bug
- Fix it, and watch it go green
- Write a test for the edge
- Your version: a test plan

Power and reliability A 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

- Why did it start?
- Hang it on purpose
- Recover by itself
- Where the current goes
- Spend less on the LED
- Your version: failure modes and a budget

### 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".

Chapter 4. About 1 h 5 min

## Ship it

A version, release notes, a demo and the write-up for your portfolio.

Lesson | Time | What students do

Release and write-up Greenhouse 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

- One version, printed first
- Ask for it
- Release notes, with the bad news
- Cut 1.1.0
- Run the demo
- Your version: ship it and write it up

### 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".

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.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
