← Projects
electronics intermediate 1 days ago ◑ 3 views ◯ 4 min read

Building an ESP32 Pool and Spa Monitor: pH, ORP, and Temperature Sensing with Automated Alerts

Build time: A weekend
Tools needed: Soldering iron, multimeter, drill for enclosure cable glands, basic hand tools
esp32pool monitorspa monitorpH sensorORP sensorwater chemistryhome assistantautomation
Parts List

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

SensorInterfaceESP32 Connection
pH probeAnalog voltage out (interface board)ADC1 channel, e.g. GPIO34
ORP probeAnalog voltage out (interface board)ADC1 channel, e.g. GPIO35
DS18B20 temp1-Wire digitalAny 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

  1. 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.
  2. 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.
  3. 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.
  4. 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:

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.