I'm a 4th-year Computer Science & AI (IoT) student at MNU, and I build ESP32 projects. This article is a reading review: four pieces of writing by senior embedded engineers, the lesson in each one, and where that principle shows up (or is still missing) in two prototypes I have published on GitHub.
Lesson 1: never trust a single reading
Jack Ganssle's classic A Guide to Debouncing is about switch contacts, but the core lesson is bigger: physical signals lie, briefly and often. Ganssle shows scope captures of buttons bouncing for milliseconds and walks through hardware and software ways to wait out the noise before believing an input.
The same idea shows up in analog sensing. In the ESP32 greenhouse controller prototype, the soil-moisture reading does not switch the pump directly. The firmware uses hysteresis bands (irrigate below 35%, stop above 55%; fan on at 30 C, off at 27 C) plus a minimum pump rest time, so one noisy sample at the threshold cannot chatter the relay. Different signal, same principle: give the system a memory so a single bad reading stays a non-event.
Lesson 2: a watchdog is a design decision, not a checkbox
Philip Koopman's Proper Watchdog Timer Use and his older Top two mistakes with watchdog timers state one warning very clearly: a watchdog that gets kicked blindly from a timer interrupt or the top of the main loop can keep a hung system running forever, because the kick proves the interrupt fires, not that the software is healthy.
In PulseLink, an Arduino + Android monitoring prototype, the AVR watchdog is used deliberately and explicitly: the phone can send a RESET command that reboots the board through the watchdog, and the phone then waits longer than usual (up to 12 s) for the board to come back. That is a remote operator reset, not autonomous hang recovery, which is exactly the distinction Koopman's essays insist on. The open design question they raise for this prototype: if the watchdog is ever armed for autonomous recovery, the kick has to be conditional on real task health, not on a timer that fires no matter what.
Lesson 3: expect the link to drop
Bluetooth and Wi-Fi links drop bytes, lines and whole connections. The PulseLink Android side treats this as normal: every command waits for an ACK line, with timeouts (3-3.5 s) and queued retries, and the parser refuses to treat unknown lines as data.
HiveMQ's MQTT Essentials series, especially Part 6 on Quality of Service levels, puts the same principle in protocol vocabulary. QoS 0 is fire-and-forget, QoS 1 guarantees at-least-once delivery at the cost of duplicates, QoS 2 costs more round trips for exactly-once. The greenhouse controller publishes its state over MQTT every 10 seconds, where a lost periodic update is harmless. Measured against those tradeoffs, the redesign candidate is clear: alerts are the messages that deserve QoS 1, routine telemetry can stay cheap.
Lesson 4: silence is also a signal
The flip side of lesson 3: when the sensor or the link goes completely quiet, a good system notices the silence itself. PulseLink's phone-side engine raises a SENSOR_DISCONNECTED alert if no valid reading arrives for 5 seconds, and the greenhouse firmware has a similar rule for acting safely when the soil sensor stops making sense. Designing for the absence of data is what turns a hang into a detected fault instead of a quiet wrong state.
Worth reading next
More of Koopman's writing on embedded safety, and the Interrupt blog by Memfault, where professional firmware engineers write up real debugging work. Recommendations for other authors on embedded reliability are welcome.
Projects referenced: smart-greenhouse-esp32 and PulseLink, both learning prototypes published on GitHub, not medical or production devices.
