Clarity
Measure first. Make the next step clear.
Inspiration
How much do we actually know about the water we drink every day?
Growing up in India, Bharath Srividhya experienced skin irritation after showering for years, assuming it was normal until he moved abroad and the irritation largely disappeared. His experience made us reflect on the disparities in access to clean water around the world.
Coming from different universities, we also bonded over our shared complaints about campus drinking water. After reading articles by Princeton students, we decided to collect and test water samples around campus. We also drew inspiration from another teammate's experience with a logistics business, where filtration is essential for protecting equipment, providing clean drinking water to employees, and reducing plastic waste.
As traditional filters offer little transparency and comprehensive water testing being expensive, we built Clarity to make water testing, automatic filtration, and community-wide monitoring more accessible, even in areas without reliable internet or cellular infrastructure.
A night and a half later, we ended up with Clarity.
What it does
Clarity turns water measurements into a next step: select a filter, leave it unused, or investigate further.
The cup measures dissolved solids and transparency. Local rules handle clear-cut decisions; then the ambiguous cases go through an AI decision path. The dashboard brings together the latest reading, its history, the selected response, and filter-maintenance information.
Our investigator looks beyond the individual number. Is the sensor behaving strangely? Is this unusual for the location? Does the history suggest a persistent change? What does the maintenance guidance recommend?
The sustainability idea is simple: measure before spending filter life. Selecting no filter is a useful result, and it deserves a clear explanation.
How we built it
Hardware and autonomous filtration
We built Clarity using an Arduino Uno, ESP32 microcontrollers, water quality sensors, a 360-degree servo, a 16×2 LCD, commercial water filters, and custom 3D-printed components.
Our device measures three water quality indicators:
- TDS: Samples exceeding our configured threshold of 300 ppm are redirected toward a PUR Plus filter.
- pH: Readings outside the reference range of 6.5–8.5 are flagged.
- Optical clarity: A light sensor measures how much light passes through the sample. Readings below 70% of our clean-water baseline are redirected toward a Brita filter.
The Arduino handles sensor measurements, threshold evaluation, servo movement, and LCD output independently of the software backend. These measurements provide preliminary screening rather than definitive confirmation of drinking water safety.
Wireless infrastructure
We established a bidirectional ESP-NOW connection between the Arduino sensing node and a Raspberry Pi 4B base station using two ESP32 microcontrollers.
This allows the sensing node to transmit measurements and receive remote testing commands without relying on Wi-Fi or cellular infrastructure.
Our prototype simulates a larger Low Power Wide Area Network (LPWAN) deployment. Technologies such as LoRa, Wize, and Wi-SUN could eventually enable long-range, low-power monitoring across distributed communities. Clarity could leverage existing smart meter infrastructure in developed regions or decentralized, solar-powered networks in underserved areas.
Software and visualization
We built a Vite-powered dashboard featuring an interactive 3D map that combines locally collected sensor measurements with nearly 14,000 public USGS monitoring sites.
Our backend evaluates measurements against configured thresholds, tracks filter life using manufacturer-specific guidelines, and manages historical water quality data through Tiger Data.
Gemini API and Photon
Using Gemini, Deep Agents, LangGraph, and Photon, we built a two-way communication system that generates water quality reports and communicates with residents directly through iMessage.
Gemini interprets structured sensor measurements, answers residents' questions, and performs preliminary visual classification of submitted water photos. The initial water quality evaluation remains deterministic rather than relying on an LLM.
We also implemented a human-in-the-loop approval workflow that requires an operator to approve mass notifications before they are sent.
GoDaddy Registry
We registered a custom domain through GoDaddy Registry to make Clarity's dashboard easily accessible and establish an independent online presence for our project.
What it does
Clarity is an autonomous water quality monitoring and filtration system that tests water, selects a filter based on its measurements, and communicates potential water quality concerns to affected communities.
- Automated testing and filtration: Users pour a water sample into our hardware device, Clarity, which measures pH, total dissolved solids (TDS), and optical clarity before automatically redirecting the sample into a selected filter.
- Interactive 3D map: Users can explore building-level water quality measurements across Princeton alongside nearly 14,000 public USGS water monitoring sites nationwide.
- Community alerts: When concerning readings are detected, Clarity generates reports and prepares notifications for affected residents.
- Two-way communication: Residents can reply through iMessage with questions or submit photos of their water for preliminary visual assessment.
- Filter health monitoring: The dashboard tracks filter life and replacement recommendations based on manufacturer-specific guidelines.
- Offline operation: The hardware performs tests and communicates with a local base station without requiring Wi-Fi or cellular service.
Where the build stands
The physical prototype produces live dissolved-solids and transparency readings and local filter decisions. Its pH value is directly measured.
Challenges we ran into
- Sensor calibration: Establishing reliable baselines for TDS, pH, and optical clarity, particularly under changing lighting conditions.
- Mechanical design: Calibrating the servo's positioning and timing to redirect water into the appropriate filter.
- Power management: Preventing the servo from causing voltage drops that interfered with sensor operation by incorporating a 1000 µF capacitor.
- Wireless communication: Connecting components with different operating voltages and establishing bidirectional communication without internet access.
- Hardware and software integration: Bringing together several independently developed components within a single hackathon weekend.
Accomplishments that we're proud of
- Building a fully assembled, autonomous water testing and filtration device from scratch.
- Establishing bidirectional wireless communication without Wi-Fi or cellular service.
- Integrating nearly 14,000 public monitoring sites into an interactive 3D map.
- Implementing two-way community communication with human approval for mass notifications.
- Collecting real water samples around Princeton during the hackathon.
- Bringing together mechanical engineering, embedded systems, wireless networking, environmental data, and software development in one project.
We're especially proud that Clarity goes beyond simply displaying environmental data. It physically responds to its measurements and connects those findings with the people they affect.
What we learned
Working with hardware taught us how much even the smallest physical constraints can affect an entire system. From voltage differences and sensor calibration to servo positioning and water flow, we constantly had to test and adjust our design.
We also learned how complex water quality testing is. Clear-looking water does not necessarily mean safe water, and different contaminants require different testing and filtration methods.
Beyond engineering, we learned that building technology for underserved communities requires considering infrastructure, affordability, maintenance, and accessibility from the beginning.
Sponsor notes
LangChain: Best use of deepagents
Clarity uses DeepAgents to investigate a case through focused specialists.
Code identifies the checks the case needs; the lead delegates them through the task tool. Specialists retrieve evidence, examine their part of the problem, and return findings for the report.
We record handoffs, tools, and answers. Findings or actions containing untraced numbers are removed, and a rule-written report remains available if the model fails. The 57-check offline suite exercises this workflow through the actual framework.
Tiger Data: Best Use of Tiger Data
Tiger Data gives each reading a history.
The gateway records locally, then synchronizes through a durable outbox with idempotent upserts. Our existing database contains a readings hypertable, five-minute/hourly/daily continuous aggregates, and refresh, compression, and retention policies.
A read-only API supports dashboard summaries and aggregate-backed history, connecting an individual cup to longer-term trends.
Google: Best Use of Gemini API
We use Google’s API for structured filter recommendations and Gemini-backed investigation.
The investigator retrieves readings, history, filter information, and published guidance through tools, then explains the evidence and suggests follow-up. Local rules, bounded retries, and time limits keep the decision pipeline available when a model response fails.
Justin Bojarski: Best Physical AI Hack
Clarity starts with a physical sample.
We built the AI decision path around sensor readings, with communications designed to carry decisions back toward the hardware. The aim is a complete physical loop: measure, choose a response, and measure again to check the outcome.
Amazon: Best Practical AI Innovation
Clarity addresses the work that follows an unusual reading.
The software checks the sensor, compares the history, and brings in maintenance context. The investigator turns that evidence into an explanation and suggested next steps. The interface lets someone inspect the reasoning behind a decision—including the decision to leave the filter unused.
Photon: Build a Messaging Agent using Photon 2.0
We built a Photon bridge with spectrum-ts and its iMessage provider.
It supports site subscriptions, questions, acknowledgments, and STOP. A DeepAgents assistant retrieves readings, filter status, reports, and photo evidence before answering.
By default, alert distribution waits for an operator to approve, edit, or reject a preview. This brings monitoring information into a conversation people can access from their phones.
GoDaddy Registry: Best Domain Name
We registered wateramong.us through GoDaddy and made it Clarity’s public home.
The name fits the project: water connects people and places. Clarity helps explain the measurements behind that shared resource.
Peri: Forward Deployed Engineer
Clarity began with lived experience and became a practical engineering problem.
Calibration, connectivity, model reliability, and mechanical integration shaped what we built. Our next step is working with water-monitoring operators to understand their investigation process: what takes time, what evidence they trust, and where another measurement would help.
Built With
- arduino-uno
- deck.gl
- esp-now
- esp32
- fastapi
- gemini-api
- langchain-deepagents
- langgraph
- maplibre
- overture
- photon
- python
- raspberry-pi
- sensors
- sqlite
- three.js
- tiger-data/timescaledb
- vite
- water-filtration


