Vintage Machine Works

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

PatternWhere it applies
_poller private state keyHolding setInterval handle without broadcasting it
static configSchemaValidating pollInterval and pin at startup
emitError()Alerting consumers when temperature exceeds threshold
kill()Clearing the interval on shutdown

On this page