Building an ESP32 Pool and Spa Monitor: pH, ORP, and Temperature Sensing with Automated Alerts
ESP32 dev board
Analog pH sensor kit with BNC probe
Analog ORP sensor kit with BNC probe
DS18B20 waterproof temperature sensor
pH 4.0/7.0 calibration buffer solution
IP65-rated junction box enclosure
Waterproof cable glands
4.7k ohm resistor pack
5V 2A USB power supply
Prices and availability as of Nov 22, 7:09 AM ET and subject to change. The price shown on Amazon at the time of purchase applies.
Pool and spa chemistry drifts fast — a sunny afternoon, a backyard party, or a few inches of rain can push pH and sanitizer levels out of range well before you'd normally think to test again. A dip-strip test twice a week catches the obvious problems after the fact; a networked ESP32 monitor catches them within minutes and can push an alert to your phone before algae gets a foothold or a chlorine spike irritates skin and eyes. This build walks through wiring pH, ORP (oxidation-reduction potential, the standard proxy for free sanitizer activity), and waterproof temperature sensing into one ESP32-based monitor with automated threshold alerts.
Why ORP Instead of Just Measuring Chlorine Directly
Consumer-grade chlorine sensors that read parts-per-million directly are expensive and finicky to maintain. ORP sensors are the industry-standard workaround: they measure the water's oxidizing potential in millivolts, which correlates closely with sanitizer effectiveness regardless of whether you're running chlorine, bromine, or a salt system. A well-maintained residential pool typically sits in the 650–750mV ORP range; spas, which run hotter and need more aggressive sanitizing, usually target somewhat higher. ORP won't give you an exact free-chlorine PPM figure, but it's a far more reliable continuous indicator than any sensor cheap enough for a DIY build.
Wiring Overview
| Sensor | Interface | ESP32 Connection |
|---|---|---|
| pH probe | Analog voltage out (interface board) | ADC1 channel, e.g. GPIO34 |
| ORP probe | Analog voltage out (interface board) | ADC1 channel, e.g. GPIO35 |
| DS18B20 temp | 1-Wire digital | Any GPIO (e.g. GPIO4) with 4.7kΩ pull-up to 3.3V |
Keep both analog probe interface boards powered from a clean 3.3V or 5V rail (check which your specific interface board expects) and route their analog leads away from the ESP32's WiFi antenna and any switching regulator — pH/ORP readings are low-level analog signals and pick up noise easily. A shielded cable for the probe runs from the enclosure to the water's edge pays for itself in stable readings.
Calibration — Don't Skip This
- Calibrate the pH probe two-point, using fresh 4.0 and 7.0 buffer solution, rinsing the probe with distilled water between each and letting the reading stabilize for a full minute before recording the ADC value at each point.
- Calibrate ORP against a known reference if you have one; if not, treat the first week of readings as a baseline and tune your alert thresholds relative to that baseline rather than an absolute textbook number — probe-to-probe variance is real.
- Re-calibrate the pH probe roughly monthly. Glass pH probes drift as the reference junction slowly degrades, and a probe that's drifted 0.3–0.5 pH units off will silently poison every alert threshold you've set until you catch it.
- Keep the pH probe tip wet between readings (a storage cap with a few drops of buffer solution works well) — letting the glass membrane dry out shortens probe life significantly.
Alerting Logic
A simple threshold check run every few minutes covers most of what you actually need:
- pH outside roughly 7.2–7.8 (pool) or 7.2–7.8 (spa, tighter in practice because of faster swings) → push notification via a free service like ntfy.sh, Pushover, or an MQTT message into Home Assistant
- ORP below your established low-sanitizer baseline for more than one consecutive reading (to avoid false alarms from a single noisy sample) → alert
- Temperature spike with no corresponding pump-run event in your pool controller → a useful secondary signal that a heater may be stuck on
Debounce every alert with a 2–3 reading confirmation window; a single noisy ADC sample is far more likely than an actual chemistry event, and nothing kills trust in a monitoring system faster than false alarms at 2am.
Safety Notes
Pool and spa chemicals are hazardous if mixed or stored carelessly — this project only reads chemistry, it doesn't dose anything automatically, which is the right scope for a DIY build. If you later add automated dosing pumps, that introduces real chemical-handling risk and liquid-chlorine/acid storage concerns that deserve their own dedicated safety review before you wire anything up. For this monitor-only build, the main electrical concern is standard outdoor-electronics practice: GFCI-protected power near water, a properly sealed enclosure, and cable glands tightened enough to actually keep splashing water out.
Once running, logging pH/ORP/temperature to Home Assistant or a simple InfluxDB/Grafana stack turns a twice-weekly test-strip chore into a real trend line — and catches the slow chemistry drift that a spot check on a Saturday morning usually misses entirely.