Back to projects

System Level Design · Embedded Systems

Embedded Systems Applications

Six Arduino sensor-kit applications, each driven by a hand-designed state machine, built for McGill's Embedded Systems (ECSE 421) labs.

Status
January–March 2024 · McGill ECSE 421 · Solo
Stack
Arduino IDE · Arduino Sensor Kit · C++ · State-diagram-driven design

Overview

A set of six applications built on the Arduino Sensor Kit for McGill’s Embedded Systems (ECSE 421) labs, each implemented from an explicit state diagram:

What I did

Approach and key decisions

State diagrams as the design language. The recurring theme across all six is that the behavior was specified as a finite-state machine first. For the hot-tub controller, that meant states like Idle, SetTemp, Heating, Hot, Cooling, and ShutDown with guarded transitions (e.g. temp < tempSelect / temp := temp + 0.2); for the elevator, it meant decomposing the system into communicating components, button panel, door system, controller, elevator car, accessibility chime. Designing at this level made the firmware a near-mechanical transcription of the diagram and the behavior easy to reason about and test.

Figures

Hot-tub controller built on the Arduino sensor kit. Hot tub controller (Fig. 27).

Plant watering system on the Arduino sensor kit. Plant watering system (Fig. 28).

Elevator controller on the Arduino sensor kit. Elevator controller (Fig. 29).

State diagram of the hot-tub controller with Idle, SetTemp, Heating, Hot, Cooling, and ShutDown states and guarded transitions. Hot-tub controller state diagram, the design was drawn before any code was written (Fig. 30).

High-level component state diagram of the elevator controller: button panel, door system, controller, elevator car, and accessibility chime. Elevator controller modeled as communicating components (Fig. 31).