Inspiration
Over 300,000 rural residents in Iowa rely on private drinking wells. Unlike municipal city water, private wells are entirely unregulated by the EPA and the Safe Drinking Water Act. Most families test their well water only once a year, if at all.
Between intensive row-crop fertilizer application and millions of tons of liquid livestock manure, Iowa’s groundwater is among the most vulnerable in the nation. When heavy storm events sweep across the state, agricultural tile drainage flushes dissolved chemical nitrates and microbial pathogens (E. coli & Salmonella) into shallow aquifers overnight. In infants, nitrate spikes cause fatal "Blue Baby Syndrome" (methemoglobinemia), yet families remain unaware until symptoms appear. We built Nitrasensor to transform reactive annual testing into predictive early-warning intelligence.
What it does
Nitrasensor is a consumer-facing, mobile-first web app that predicts drinking water contamination before heavy storms push runoff into rural wellheads.
- One-Step Address Search: A homeowner enters their address or rural county road. Well depth is completely optional; if omitted, Nitrasensor automatically calibrates to the Iowa DNR rural state average (175 ft) or local hydrogeological quadrant.
- Real-Time Hydrological Telemetry: In seconds, the system queries live data from Open-Meteo 48-hour storm forecasts, the Iowa State University Soil Moisture Network (ISUSM), USGS River Basin nitrate sensors, and digital elevation models.
- Nitrasensor ML Inference: Runs a server-side GradientBoostingRegressor via ONNX Runtime to predict continuous nitrate concentrations (mg/L), confidence intervals, and bacterial infiltration probability.
- Nitrasensor AI Clinical Advisor: Translates technical hydrology into plain-language health guidance, breaks down feature attributions, clarifies critical water handling instructions (such as explaining why boiling water concentrates nitrates rather than removing them), and generates agricultural runoff holds for local growers.
How we built it
- Frontend & App Architecture: Built with Next.js, TypeScript, and Tailwind CSS, styled in an organic, high-contrast sage green aesthetic designed specifically for accessibility on mobile devices in rural areas.
- Machine Learning & Serverless Inference: Trained a
GradientBoostingRegressoron Iowa groundwater monitoring and certified well laboratory test datasets from the USGS / EPA Water Quality Portal (WQP). Exported viaskl2onnxto an ONNX model, executing sub-5ms server-side inference withonnxruntime-node. - Live Environmental Pipelines:
- Weather & Forecasting: Open-Meteo forward-looking 48-hour precipitation and soil moisture models.
- Agricultural Soil Saturation: Iowa Environmental Mesonet (ISUSM) real-time automated station currents.
- Surface Topography: Digital elevation API calculating local landscape slope percentage and runoff velocity.
- Ambient Watershed Baseline: USGS National Water Information System stream sensor monitoring.
- Hydrogeological Resolution & Geocoding: Multi-tier geocoding via US Census Bureau TIGER line parcel data, Komoot Photon (for rural routes), and Open-Meteo, cross-referenced with Iowa DNR water-well drilling records.
- Clinical AI Intelligence: Powered by the Google GenAI SDK (
@google/genai) to synthesize personalized precautions for infants, expectant mothers, and livestock.
Challenges we ran into
- Forecast vs. Observed Hydrology: Differentiating between past rain gauge history (antecedent soil wetting) and forward numerical weather prediction (incoming storm volume). We structured our pipeline to feed both antecedent soil saturation and upcoming storm surges into the model.
- The Private Well Data Gap: Private drinking wells sit on private land, meaning there is no public database connecting every residential street address to an underground drilled depth. Instead of blocking homeowners with mandatory technical inputs, we engineered regional hydrogeological defaults based on Iowa DNR drilling data (120 ft in Northeast Karst, 220 ft in Northwest Dakota sandstone, and 175 ft statewide average).
- Bundle & Serverless Compatibility: Overcoming Webpack bundling quirks when integrating native ONNX Runtime C++ binaries (
onnxruntime-node) inside modern Next.js server routes.
Accomplishments that we're proud of
- Seamless 2-Second Diagnostic: Bridging four disparate scientific APIs (USGS, Iowa Mesonet, Open-Meteo, US Census) and real ML inference into a frictionless, consumer-grade experience.
- Real Public Health Value: Creating clear, actionable communication around the counterintuitive "boiling water dilemma," preventing parents from inadvertently poisoning infant formula by concentrating dissolved nitrates through boiling.
What we learned
- Iowa Hydrogeology: How shallow alluvial deposits and karst limestone sinkholes in Northeast Iowa create rapid direct preferential flow paths compared to deep confined glacial drift aquifers.
- Model Portability: The efficiency of serializing Python scikit-learn models into ONNX for low-latency, deterministic Node.js runtime execution.
- Risk Communication: The importance of avoiding alarmist "critical warning" banners in favor of calm, clear, evidence-based clinical guidance that rural families can immediately act on.
What's next for Nitrasensor
- Mobile App with Automated SMS & Native Push Alerts: Enabling rural families to subscribe their well coordinates and receive automated text notifications 24 hours before a major rainfall event is projected to compromise their well.
- Hardware IoT Integration: Building an affordable open-source optical probe (spectrophotometric nitrate & turbidity sensor) that drops into the wellhead for continuous real-time calibration.
- Community Watershed Coordination: Expanding the agricultural mitigation module to enable voluntary coordination between upstream crop farmers (for timing fertilizer and liquid manure application) and downstream well owners.
Built With
- next.js
- python
- tailwind.css
- typescript
Log in or sign up for Devpost to join the conversation.