Temperature Sensor
Reading thermocouple data over I²C and alerting on threshold breach.
This case study is a placeholder. Full content coming soon.
Overview
An industrial thermocouple sensor connected over I²C, deployed on a Raspberry Pi monitoring a heat treatment furnace. The machine polls the sensor at a configurable interval, exposes current temperature as state, and emits an error event when the reading exceeds a configurable threshold.
What this covers:
- Polling hardware on a timer inside
init() - Storing a timer handle in a
_-prefixed private state key - Emitting error events with
emitError() - Config-driven poll interval and threshold
- Graceful shutdown in
kill()
Machine design
Full walkthrough coming soon.
Key patterns
| Pattern | Where it applies |
|---|---|
_poller private state key | Holding setInterval handle without broadcasting it |
static configSchema | Validating pollInterval and pin at startup |
emitError() | Alerting consumers when temperature exceeds threshold |
kill() | Clearing the interval on shutdown |