Last checked: 7 November 2026.
The current Arduino code is public: github.com/Jozwolf/ARMAC-fire-defence (CC0, public domain; use at your own risk - see What isn't this?).
| Sketch | Board | Lines | Job |
|---|---|---|---|
| AR1 | Arduino UNO R4 WiFi, house (Module 2) | 3,462 | MQTT link to Home Assistant; RS-485 and backup link to AR3; manual sprinkler and shed-cooling cycles; heartbeat; LOCK |
| AR2 | Arduino UNO R4 WiFi, shed (Module 4) | 994 | Reads every sensor; broadcasts readings by UDP over its own WiFi; test scenarios |
| AR3 | Arduino UNO R4 WiFi, shed (Module 4) | 3,050 | Relays and pump latch; Autonomous mode and fallbacks; pump start sequence; RS-485 telemetry; LCD; test button |
To build: copy config_example.h to config.h in each sketch folder and fill in your own WiFi, MQTT and access-point details (see Security measures and credential management); open the sketch in the Arduino IDE; board type Arduino UNO R4 WiFi. Each sketch begins with a dated change log.
Settings worth knowing
| Setting | Where | Committed value | Meaning |
|---|---|---|---|
| FRAME_REJECT | AR1 and AR3 | 0 | 1 = drop messages with a bad checksum (see Communication protocols) |
| FS_POLARITY_INVERT | AR3 | 1 | Which latch-relay input means "pump on" |
| LATCH_FB_FITTED | AR3 | 0 | 1 once the latch read-back wire to D10 is fitted |
| SIMULATION_MODE and related flags | AR2 | 0 | Fixed simulated values for bench testing |
How the code is written
The sketches were written with growing help from AI tools, and in recent stages largely by Claude Code under the author's direction, then tested on TestSys before loading at Fairhaven (see TestSys). The private development repository holds the full history and the Home Assistant configuration.
The structure of each sketch is summarised in the system pages rather than in separate code summaries: Communication protocols, The Heartbeat System and Mode Transitions, Autonomous Fire Defence Algorithms, Output Control and Safety Interlocks and Sensors.
<< Multicore cables | | Appendices >> |Table of Contents>
