-
-
Beat the Shutdown: an operator console that catches water-facility failures early and plans the cheapest fix.
-
Three pump failures at once: each shows a countdown to shutdown and the cheapest plan, e.g. $968 instead of $6,308.
-
Early detection: a leak and a worn pump flagged with confidence, time since onset and plain-English evidence.
-
What-if replay: the recommended plan keeps the tank under the shutdown line; doing nothing trips at 11:56.
-
NVIDIA Nemotron writes the shift handoff via 5 tool calls; every time and dollar figure is checked against the tools.
-
Scored on EOG’s answer keys: 23/23 events, 0 false alarms, leaks flagged in a median 30 min, 20/20 reference plans matched.
-
Live hardware twin: an ESP32 tank and pump stream to the console, which catches a stall and plans before the tank trips.
Inspiration
Behind every barrel of oil is salt water that has to go somewhere. When a pump fails at 3am, a night-shift operator has minutes to figure out what broke, how long until the tank forces a shutdown, and whether to call trucks, shut in wells, or let it trip. I wanted to build the console I'd want in that seat: alarms you can trust, a clear countdown, and a plan that shows its reasoning. I asked EOG's team what mattered most, and built around their answer: catch problems early, optimize cost, hand off clearly.
What it does
- Catches problems early, straight from telemetry. Pump failures, pipeline leaks and worn pumps, each with an onset time, a confidence level and plain-English evidence. Pump failures are flagged the moment they happen, leaks a median of 30 minutes after onset, and worn pumps start as a low-confidence early flag that firms up as the decline continues. Nothing is hardcoded: every threshold is relative to each asset's own healthy behavior, so it carries over to an unseen network.
- Counts down to shutdown for every failed pump, from the live tank level and inflow.
- Finds the cheapest response. It searches every combination of trucks, trips, and immediate or delayed well shut-ins, and plans multiple failures in the same system jointly, because they share one truck fleet. Every plan explains what to do, when trucks arrive, and what doing nothing would cost.
- Is honest about uncertainty. If a leak was repaired while its pump was off, the data can't show it yet, so the alert says "Unverified" and explains when it can be re-checked, instead of guessing.
- AI shift handoff (NVIDIA Nemotron). An agent that plans its own steps, calling the console's tools (get_alerts, optimize_plan, what_if) to write a 30-second handoff for the next operator. A safety check verifies every time and dollar figure against the tool results and flags anything the model invented. Without a key, it falls back to a template, so the console never breaks.
- Operator console. Alerts in priority order, a map of every system with leaking pipelines highlighted, facility trends with fault onsets marked, and a what-if chart comparing the plan with doing nothing. Time travel replays any moment of the week. It has a dataset switcher, a phone layout and light/dark themes.
- Live hardware facility twin. An ESP32-S3 with a water level sensor as the tank and a TT motor as the pump, driven through an L298N, runs the pump at the same setpoints as the real network. An IMU on the motor detects a stall from loss of vibration. The board streams over Wi-Fi into the same detection, countdown and optimizer, so you can stall the pump by hand and watch the console react live.
How we built it
- Backend: Python, pandas and FastAPI, split into modules for loading, detection, forecasting, optimization, alerts and the agent.
- Frontend: React, TypeScript and Vite, with Leaflet for the map and Recharts for charts.
- AI: NVIDIA Nemotron through NVIDIA's API, as a tool-using agent on top of the same functions the console uses.
- Firmware: Arduino on an ESP32-S3: analog tank sensing, PWM motor control through an L298N, I2C vibration sensing with automatic calibration, and Wi-Fi posting every 2 seconds.
- Validation first: before building any UI, I wrote a scorer that grades the detector and optimizer against every EOG answer key, then iterated until everything matched. I used Claude Code as my coding partner, with the scorer as the bar every change had to pass.
Challenges we ran into
- Leaks are invisible while a pump is off. Pipeline readings look identical with or without a leak when nothing is flowing, so I chose transparency over guessing.
- Worn pumps are slow. Flow drops only about 0.4% an hour. Detecting them faster without false alarms on an unseen network meant trading a little speed for a safer margin.
- Shared trucks make it a scheduling problem. A truck sent to one tank can't help another, so plans are made jointly per system.
- Hardware: reliable uploads on the ESP32-S3, keeping motor power from resetting the board, and mounting and calibrating the IMU so "running" and "stalled" separate cleanly.
- Keeping the AI honest: early Nemotron runs got clock times wrong, which led to the number-checking safety guard.
Accomplishments that we're proud of
- Detection: 23/23 events on the full week and every snapshot. 0 missed, 0 false alarms, onset error about 3 minutes on average.
- Speed: pump failures at onset, leaks a median of 30 minutes after onset, worn pumps a median of 150 minutes with rising confidence.
- Robustness: replayed the week every 15 minutes (624 points in time) with 0 misses and 0 false alarms, and still 23/23 with 3% of readings randomly dropped.
- Optimization: all 20 reference plans matched on trucks, trips and wells, every cost within $19, including the cases where every truck is busy and the right answer is shutting in one well partway through the repair.
- A working AI agent and a live hardware twin, built solo in 24 hours.
What we learned
Test against ground truth before building the UI. Design alerts for a tired operator at 3am. On the hardware side, sensing is half physics: power, mounting and calibration matter as much as the code. And an AI agent is only useful if you can verify what it says.
What's next for Beat the Shutdown
- Catch worn pumps sooner without adding false alarms.
- Real uncertainty ranges on the countdown when inflow varies.
- A fleet-size what-if: how many trucks a system really needs.
- A flow meter on the hardware twin, so it can show leaks and wear too.
Built With
- arduino
- esp32
- esp32-s3
- fastapi
- l298n
- leaflet.js
- nvidia-nemotron
- pandas
- python
- react
- recharts
- typescript
- vite