The garage probe hardware runs on Arduino-compatible microcontrollers. Firmware—commonly called a sketch—reads sensors on a timer, formats the results as JSON, and serves them over the network so the website and other clients can fetch live data without serial cables.
Sketch responsibilities
- Initialize sensor buses and the local 16×2 LCD for on-site readouts.
- Read each DHT22 probe with retry logic for transient bus errors.
- Compute an average across healthy probes for a quick summary value in JSON.
- Respond to HTTP requests with a compact JSON document via the Ethernet shield.
- Optionally log errors to serial for on-site debugging.
Typical JSON shape
Consumers expect a top-level temp object with numeric keys for each probe plus
avg. Humidity appears alongside temperature per probe. Keeping keys stable matters
more than pretty printing—dashboard mappings reference those keys directly.
{
"temp": {
"0": { "f": 38.2, "c": 3.4, "h": 41.0 },
"1": { "f": 36.8, "c": 2.7, "h": 43.5 },
"avg": { "f": 37.5, "c": 3.1, "h": 42.2 }
}
}
For push ingest, the same probe object can be
posted to /api/ingest/<key>. Optional top-level battery (or
battery_pct) and rssi fields update device health on the Devices page without
requiring extra sensor keys.
{
"temp": {
"0": { "f": 38.2, "c": 3.4, "h": 41.0 }
},
"battery": 87,
"rssi": -62
} Hardware wiring guides
The physical build uses an Arduino Uno, W5100 Ethernet shield, breadboard, contrast potentiometer, 16×2 LCD, and two DHT22 sensors. Three companion pages document the schematics and pin map in detail:
Arduino circuit wiring overview
How USB power, the breadboard, contrast pot, LCD, sensors, and Ethernet shield fit together.
Arduino pin-level wiring
Pin-by-pin map matching the LiquidCrystal constructor and sensor data lines in firmware.
DHT22 sensors and LCD display
Why two probes show separate readings on the LCD while JSON feeds expose both to the website.
Network stack choices
This revision uses an Ethernet shield on SPI. The sketch handles DHCP, reconnect loops, and JSON serving while the LCD continues to show live probe values. When TLS is too heavy for the MCU, a Python relay can terminate HTTPS—see Python scripts and feeds.
Development workflow
Sketches are edited in the Arduino IDE or PlatformIO, flashed over USB, then verified with serial logging before the board is mounted in the garage. Confirm JSON shape with curl before adding the feed URL to the website dashboard. Source firmware: arduino-network-json-temperature-sever.
Reliability tips
- Watchdog resets recover from rare network hangs without climbing a ladder.
- Separate sensor power noise from MCU power where long cable runs exist.
- Version your JSON schema in documentation when adding fields.
- Document which GPIO pins map to which physical probe labels—see the pin wiring guide.