How to Build a Pool Water Quality Monitor with OpenClaw on Raspberry Pi
Commercial pool monitors display readings on a screen. They tell you the pH is 7.1 but not what to do about it. This guide covers wiring pH, ORP, and temperature sensors to a Raspberry Pi, then using an OpenClaw agent to interpret chemistry trends, recommend dosing adjustments, and send alerts before conditions become unsafe for swimmers.
Why Commercial Pool Monitors Fall Short
The United States has roughly 10.7 million swimming pools, with 10.4 million of those in residential backyards. Every one of them requires regular chemistry maintenance to keep the water safe. pH drifts outside the 7.2 to 7.8 range and chlorine loses its disinfecting power. ORP drops below 650 millivolts and bacteria can survive long enough to cause illness. Most pool owners either test manually with strips and reagent kits or install a commercial monitor that displays current readings on a screen or phone app.
Commercial monitors like the Sutro, pHin, or iopool EcO do one thing well: they measure. They read pH, ORP, and temperature at regular intervals, log the data, and show it in an app. Some send push notifications when a parameter drifts out of range. But they stop at measurement. They do not tell you how much muriatic acid to add based on your pool's volume and current alkalinity. They do not distinguish between a pH spike caused by a rainstorm diluting your water (temporary, self-correcting once the rain stops) and one caused by a failing chlorinator (persistent, needs intervention). They do not recognize that ORP readings are meaningless without accounting for pH and temperature simultaneously.
A Raspberry Pi with the right sensors can match the measurement capability of a $300 to $500 commercial unit for under $150 in parts. What it adds, when paired with an OpenClaw agent, is the reasoning layer. The agent receives the same sensor readings a commercial monitor would display, but instead of just showing numbers, it interprets them in context, considers how parameters interact, and provides specific dosing recommendations based on your pool's volume and chemistry history.
The gap in the market is real. Commercial monitors show data. Pool service professionals interpret data. An AI agent on a Pi can bridge that gap for the 10 million pool owners who do their own maintenance.
Sensor Hardware for Pool Chemistry
Pool water quality depends on three primary measurements: pH (acidity), ORP (oxidation-reduction potential, a proxy for sanitizer effectiveness), and temperature. A complete monitoring setup adds a fourth, total dissolved solids (TDS), though pH, ORP, and temperature cover the critical safety parameters.
pH sensor: Atlas Scientific makes the reference-standard EZO pH circuit ($45.99) paired with their consumer-grade pH probe ($49.99). The EZO circuit communicates over I2C when configured in I2C mode (solid blue LED) or over UART via USB when using their Gen 2 Electrically Isolated USB Carrier Board ($34.99). For pool monitoring, the I2C path keeps wiring simpler since all your sensors share the same two-wire bus. Atlas Scientific's pH probes handle the 0 to 14 pH range with 0.01 resolution, more precision than pool chemistry requires. Calibrate with pH 4.0, 7.0, and 10.0 buffer solutions ($9.99 for a three-pack). Always start calibration at the midpoint, pH 7.0.
Budget alternative: DFRobot's Gravity Analog pH Sensor Kit ($30) outputs analog voltage that needs an ADC like the ADS1115 ($3 to 5). Less precise than Atlas Scientific, but adequate for residential pool ranges.
ORP sensor: Atlas Scientific's EZO ORP circuit plus a lab-grade gold ORP probe measures oxidation-reduction potential from -1100 to +1100 millivolts. For pools, you care about the 400 to 900 mV range. A healthy chlorinated pool reads between 650 and 750 mV according to the Association of Pool and Spa Professionals. Below 650 mV means insufficient sanitizer. Above 800 mV means the water may irritate skin and eyes.
Temperature sensor: A waterproof DS18B20 probe ($3 to 5) uses the 1-Wire protocol on GPIO 4 with a 4.7 kilohm pull-up resistor. Accuracy is 0.5 degrees Celsius. Temperature matters for pool chemistry because chlorine effectiveness drops as water warms. An Atlas Scientific PT-1000 RTD probe provides 0.1 degree precision if you need it, but the DS18B20 is sufficient for residential pools.
Electrical isolation matters: When running pH and ORP sensors on the same system, electrical interference between the probes can skew readings. Atlas Scientific's EZO circuits include built-in electrical isolation. If you use budget sensors, add an optocoupler or isolated carrier board between them. The Atlas Scientific documentation specifically warns that EC sensors discharge a small current that creates an interference field detectable by ORP probes.
Total hardware cost: $150 to $280 including a Raspberry Pi 4 or 5, depending on whether you choose Atlas Scientific or budget sensors. The Atlas Scientific Wi-Fi Pool Kit ($554.99) bundles pH, ORP, and temperature circuits with probes and an enclosure, but buying components individually and adding the OpenClaw reasoning layer gives you more capability for less money.
Setting Up OpenClaw for Periodic Sensor Reads
OpenClaw runs on a Raspberry Pi 4 or 5 with at least 1 GB of RAM, a 64-bit OS, and 500 MB of free disk space. The recommended setup is a Pi 5 with 2 GB or more of RAM and a USB SSD instead of an SD card. The official Raspberry Pi installation guide walks through flashing Raspberry Pi OS Lite, installing Node.js, and running the OpenClaw installer.
The sensor monitoring pattern follows a principle documented across multiple OpenClaw tutorials: keep hardware interaction in dedicated Python scripts, and let the agent handle decisions. Each sensor gets its own script that reads the hardware and returns a plain-text value. A read_ph.py script queries the EZO pH circuit over I2C and prints "7.34." A read_orp.py script queries the ORP circuit and prints "712 mV." A read_temp.py script reads the DS18B20 and prints "27.2°C." The agent never touches GPIO registers directly. It calls these scripts as system commands and receives the output as text it can reason about.
OpenClaw's cron scheduler handles the timing. Cron is the built-in scheduler for precise, repeating tasks. It persists jobs, wakes the agent at the right time, and can deliver output to a chat channel or webhook. For pool monitoring, a 15-minute interval balances data granularity against API costs if you are using a cloud LLM provider. During swim season, you might tighten that to every 10 minutes. In winter with the pool covered, every 30 minutes or even hourly is fine.
Each cron run triggers an isolated agent turn. The agent reads the sensor outputs, compares them against the ideal ranges you have defined, checks the trend from previous readings stored in a local log file, and decides whether to send an alert. OpenClaw's documentation recommends running monitoring tasks as isolated jobs that query a store of previous values and decide if an alert is worth sending. This prevents the agent from wasting tokens on readings that are within normal range.
LLM provider selection for always-on monitoring: Cloud APIs like Claude or GPT-4 provide the strongest reasoning for interpreting complex chemistry interactions. A 15-minute cron schedule means 96 agent turns per day. Most turns will be short, just confirming readings are normal, so token costs stay low. For fully offline operation, a local model through Ollama works on a Pi 5 with 8 GB RAM, though its ability to reason about multi-parameter chemistry interactions will be more limited.
Pool profile configuration: Before the agent can make useful recommendations, it needs your pool's specifics. Create a reference file listing pool volume in gallons, surface type (plaster, vinyl, fiberglass), sanitizer system (chlorine tablets, salt chlorinator, liquid chlorine), current chemical inventory, and any known issues. The agent loads this profile as context for every reading cycle and uses it to calculate specific dosing amounts rather than generic advice.
Store Your Pool Monitoring Data Where Agents and Humans Can Access It
Fast.io gives your OpenClaw pool agent persistent cloud storage with built-in AI search. Upload daily chemistry reports, share dashboards with your pool service, and query months of water quality history. 50 GB free, no credit card required.
How the Agent Interprets Chemistry
Pool chemistry is a system of interacting variables. pH affects chlorine effectiveness. Temperature affects pH stability. Alkalinity buffers pH. Calcium hardness affects surface scaling. A human pool professional evaluates all of these together when diagnosing a problem. An OpenClaw agent can do something similar by receiving multiple sensor readings simultaneously and reasoning about their relationships.
pH and ORP together: When pH rises above 7.8, free chlorine becomes less effective even if ORP looks acceptable. The agent recognizes that an ORP reading of 680 mV at pH 7.9 is not the same as 680 mV at pH 7.4. At the higher pH, the actual sanitizing power is lower despite the ORP number looking fine. Instead of just flagging "ORP is in range," it warns that effective sanitation is reduced and recommends lowering pH first.
Temperature compensation: pH readings shift with water temperature. The Atlas Scientific EZO circuits handle automatic temperature compensation in hardware when an RTD sensor is connected. But the agent adds a second layer of interpretation. When water temperature climbs above 84°F (29°C), it factors in that chlorine consumption increases roughly 10% for every 10 degree Fahrenheit rise. A reading that looks safe at 78°F may need attention at 88°F because the chlorine will deplete faster.
Trend analysis over time: The most valuable thing an AI agent provides over a threshold monitor is pattern recognition across readings. A pH that drops 0.1 per day for five days is a different problem than a pH that drops 0.4 overnight. The gradual drift suggests your alkalinity buffer is depleted and needs adjustment. The sudden drop might indicate acid rain, a chemical spill from nearby lawn treatment, or a malfunctioning chlorinator dumping too much sanitizer. The agent examines the stored reading history and identifies which pattern it is seeing before recommending action.
Dosing calculations: When the agent decides a chemical adjustment is needed, it calculates the specific amount based on your pool volume. Instead of "add muriatic acid," it says "add 12 ounces of 31.45% muriatic acid to lower pH from 7.9 to 7.5 in your 15,000-gallon pool." These calculations follow published pool chemistry formulas. For example, lowering pH by 0.1 in a 10,000-gallon pool requires approximately 3 ounces of 31.45% muriatic acid, though the exact amount varies with alkalinity and current pH.
Seasonal awareness: In winter, a covered pool has minimal evaporation and chemical demand. The agent adjusts its alert thresholds and reduces recommendation frequency. In peak summer with heavy swimmer load, it tightens monitoring. After a pool party with 15 swimmers, it recognizes that the spike in combined chlorine and drop in ORP is expected and recommends a shock treatment rather than troubleshooting the chlorinator.
Logging Data and Sharing Reports with Fast.io
Raw sensor readings become more valuable when they are stored, searchable, and shareable. A pool service professional visiting once a month wants to see three weeks of pH trends, not just today's number. A homeowner traveling wants to check the pool remotely and share the dashboard with a house sitter.
The simplest logging approach is a local CSV or SQLite database on the Pi. Each reading cycle appends a timestamped row with pH, ORP, temperature, and the agent's assessment. This gives you a local archive that survives internet outages. For pools in rural areas or vacation properties with unreliable connectivity, local-first logging is essential.
For remote access and collaboration, Fast.io provides persistent cloud storage that the OpenClaw agent can write to directly. The agent uploads daily summary reports, weekly chemistry trend charts, or raw data exports to a Fast.io workspace. Fast.io's free agent tier includes 50 GB of storage, 5,000 monthly credits, and five workspaces with no credit card required, more than enough for years of pool monitoring data.
What makes Fast.io particularly useful for this workflow is the ownership transfer model. A pool builder or maintenance company can set up the monitoring agent, configure the workspace, and then transfer ownership to the homeowner. The homeowner gets a branded portal with their pool's data. The builder retains admin access for remote troubleshooting. This handoff pattern, where the agent builds something and a human receives it, is a core Fast.io workspace capability.
Fast.io's Intelligence Mode auto-indexes uploaded files for semantic search. Upload six months of daily reports and you can ask questions like "when was the last time ORP dropped below 600?" or "show me all pH corrections in July" without writing database queries. The MCP server at mcp.fast.io gives the agent 19 consolidated tools for workspace, storage, and AI operations.
For multi-pool operations, like a vacation rental management company monitoring pools across a dozen properties, each property gets its own workspace. Granular permissions control who sees what. Audit trails track every reading and recommendation. This scales the single-Pi monitoring setup into a fleet management system without changing the agent's core logic.
Maintenance and Calibration Schedule
Pool sensors degrade. pH probes have a lifespan of 12 to 18 months in continuous-submersion applications. ORP probes last 12 to 24 months. Temperature sensors are more durable but should be verified annually against a reference thermometer. A monitoring system that does not account for sensor drift gives you false confidence, which is worse than no monitoring at all.
Monthly calibration: Remove pH and ORP probes from the pool. Rinse with distilled water. Calibrate the pH probe using a three-point calibration with pH 4.0, 7.0, and 10.0 buffer solutions, starting at the midpoint. Calibrate the ORP probe against a known reference solution. Most EZO circuits store calibration data on the circuit board, so you only need to run the calibration commands once per session. Teach the agent your calibration schedule and it will remind you when the next session is due.
Seasonal startup: When opening a pool for spring, recalibrate all sensors, verify wiring connections, and run a manual test against a reagent kit to confirm the Pi's readings match reality. Update the pool profile if you changed your sanitizer system, added a heater, or resurfaced the pool over the winter.
Probe replacement signals: The agent can detect degrading sensors by monitoring response time and reading stability. A healthy pH probe settles to a stable reading within 30 seconds. If it takes two minutes to stabilize or oscillates between values, the probe is nearing end of life. The agent flags this as a maintenance item rather than treating the unstable readings as real chemistry changes.
Backup testing: Even with continuous monitoring, keep a manual test kit on hand. Run a manual test weekly and compare the results to the Pi's readings. If they diverge by more than 0.2 pH or 50 mV ORP, recalibrate. The agent cannot detect a sensor that reads consistently wrong. Only comparison against a known reference catches systematic errors.
Winterization: For pools in freezing climates, remove all sensors before closing. Store pH and ORP probes in their storage solutions (typically KCl for pH probes). Shut down the OpenClaw cron schedule or switch it to a minimal "check temperature only" mode if you keep the Pi running to monitor freeze protection equipment.
Frequently Asked Questions
How do I monitor pool water quality with Raspberry Pi?
Connect pH, ORP, and temperature sensors to the Pi's I2C bus or GPIO pins. Atlas Scientific EZO circuits are the reference standard for water chemistry sensors on Raspberry Pi. Write Python scripts that read each sensor and output plain-text values. Then use an AI agent framework like OpenClaw to call those scripts on a schedule, interpret the readings together, and send alerts or dosing recommendations based on your pool's specific parameters.
Can AI manage pool chemistry?
AI can interpret sensor readings and recommend chemical adjustments, but it cannot physically add chemicals to your pool without additional hardware like automated dosing pumps. An OpenClaw agent on a Raspberry Pi reads pH, ORP, and temperature data, compares it against ideal ranges, analyzes trends over time, and calculates specific dosing amounts based on your pool volume. You still add the chemicals manually unless you wire peristaltic dosing pumps to the Pi's relay outputs.
What sensors does a smart pool monitor need?
At minimum, pH and temperature. A complete setup adds ORP (oxidation-reduction potential, which measures sanitizer effectiveness) and optionally TDS (total dissolved solids). pH tells you if the water is too acidic or basic. ORP tells you if your chlorine or other sanitizer is actually working. Temperature affects both pH stability and chlorine consumption rates. All three together give you a complete picture of water safety.
How much does a Raspberry Pi pool monitor cost compared to commercial options?
A Pi-based setup with Atlas Scientific sensors runs $150 to $280 for all components including the Pi itself. Budget sensors bring that down to $80 to $150. Commercial smart pool monitors like the Sutro or pHin cost $300 to $500 for the hardware plus ongoing subscription fees for the app. The Pi setup costs less upfront, has no subscription fees, and the OpenClaw agent provides AI-driven analysis that commercial monitors do not offer.
How often should the agent check pool water?
Every 15 minutes during swim season balances data granularity against computing costs. During off-season or when the pool is covered, every 30 to 60 minutes is sufficient. After heavy use like a pool party, you can temporarily tighten the schedule to every 5 minutes to watch the chemistry recover. OpenClaw's cron scheduler lets you set different intervals for different times of day or seasons.
Do I need an internet connection for the pool monitor?
Not for basic monitoring. The Raspberry Pi reads sensors and runs the OpenClaw agent locally. If you use a local LLM through Ollama, the entire system works offline. You only need internet for cloud LLM providers like Claude or GPT-4, for sending remote alerts via email or messaging, or for uploading data to a cloud workspace like Fast.io. Local logging to CSV or SQLite works without any connectivity.
Related Resources
Store Your Pool Monitoring Data Where Agents and Humans Can Access It
Fast.io gives your OpenClaw pool agent persistent cloud storage with built-in AI search. Upload daily chemistry reports, share dashboards with your pool service, and query months of water quality history. 50 GB free, no credit card required.