HydroSense Documentation

v1.6

How the system works, hardware options, and how to read the data

Overview

HydroSense is a low-cost remote monitoring system for rural handpumps and boreholes. A small battery-powered logger sits at each pump site, takes readings every morning, and uploads them to a central server for analysis and visualisation.

The system answers three practical questions for field teams:

  • Is the pump being used? — A temperature drop during the morning window means cold groundwater is flowing, which means the community is collecting water.
  • Is the water table recovering? — The depth probe tracks seasonal groundwater level, showing whether the rainy-season recharge cycle is healthy.
  • Is the logger still alive? — Battery voltage, reading frequency, and time since last upload reveal whether a device needs attention.
Design philosophy. Every component was chosen to be repairable or replaceable in a rural Malawi context. Total cost per logger site is under $80 including sensors, solar charging, and enclosure. No proprietary data formats or cloud subscriptions are required.

The logging cycle

Each logger wakes at 6:00 am local time, records temperature and depth every 5 minutes for three hours until 9:00 am, then sleeps for the rest of the day. This produces 36 readings per morning — enough to trace the community's morning collection pattern in detail while keeping energy use very low.

At the end of the logging window the logger attempts to upload the day's CSV file to the server. Depending on the hardware option, this happens automatically over WiFi, cellular GPRS, or LoRa radio. If connectivity is unavailable the logger stores readings in flash memory and retries on the next day. A field worker can also connect a phone to the logger's hotspot and relay data manually.

Why 6–9 am?

Community pumping at rural boreholes in Malawi is concentrated in the early morning — people collect water before the school day and farm work begin. By logging only during this window the system captures the most information-rich period while minimising battery and storage use.

At 6 am the sensor is at overnight equilibrium. As the sun rises, ambient temperature climbs slowly and predictably. Any sudden temperature drop against that background is unambiguous: cold groundwater is flowing through the pump.

Temperature sensing

The physics

A DS18B20 digital temperature probe (1-Wire, ±0.5 °C, ~$2) is fixed inside the pump head — the metal casing that sits on top of the riser pipe. Two thermal bodies interact at this point:

Ambient air

Temperature at 6 am in the cool dry season (June–August): 11–14 °C. Rises at about 0.5–1.5 °C per hour as the sun comes up. This is the baseline the sensor follows when the pump is idle.

Groundwater

Borehole water temperature: stable 18–22 °C year-round, insulated from surface seasons by the soil column. In the cool dry season this is warmer than the air; in the hot dry season it is cooler.

When the community pump is working, cold (relative to the morning air in June–August) or cool groundwater flows up through the riser pipe and through the pump head. The metal casing conducts heat rapidly, and the sensor reading swings toward groundwater temperature within one or two 5-minute readings — a change of 3–8 °C. When pumping stops, the sensor climbs back toward ambient over the next two or three readings.

Reading the signal

The two trace shapes are visually distinct:

PUMP IDLE — sensor follows rising morning air temperature

  °C
  22 ┤                                             ╭────
  20 ┤                                       ╭─────╯
  18 ┤                                 ╭─────╯
  16 ┤                           ╭─────╯
  14 ┤                     ╭─────╯
  12 ┤───────────────╮─────╯
     └───────────────────────────────────────────────────
     6:00   6:15   6:30   6:45   7:00   7:15   7:30   8:00

PUMP IN USE — sharp drops when community collects water

  °C
  22 ┤                                   ╭──╮
  20 ┤         ╭──╮                ╭─────╯  ╰──────
  18 ┤         │  ╰──╮      ╭─────╯
  16 ┤   ╭───╮ │     ╰──────╯
  14 ┤   │   ╰─╯
  12 ┤───╯
     └───────────────────────────────────────────────────
     6:00   6:15   6:30   6:45   7:00   7:15   7:30   8:00
             ↑               ↑           ↑
          pump on         pump off    pump on again

Ambient warming produces a change of roughly 0.1–0.2 °C per reading. A pump turning on or off produces 3–6 °C per reading. The two cases are separated by a factor of 20–30, making the detection robust even with significant sensor noise or partial shading.

Why this is valuable. Conventional approaches to monitoring pump usage require flow meters ($150–400), accelerometers on the pump handle, or community self-reporting. A $2 temperature sensor clipped inside the pump head gives equivalent usage data automatically, with no moving parts, no calibration, and no community intervention.

Depth sensing

The wet-cable resistivity probe

The depth probe is two insulated wires lowered side-by-side down the borehole. The insulation is stripped from both conductors over the bottom section of cable, leaving bare copper exposed. When those bare conductors are submerged in groundwater, the water bridges between them and closes an electrical circuit. The length of submerged bare conductor determines the resistance: more wire in water = lower resistance.

The logger measures voltage across a known 10 kΩ reference resistor in series with the probe, then uses Ohm's law to calculate the probe resistance, and converts that to a wet-cable length in centimetres.

Cross-section of borehole with wet-cable probe

  ┌──────────────────────────────────────────────────┐
  │  Ground surface                                  │
  │     │                                            │
  │     │  Two wires (insulated) ───────────────┐   │
  │     │  run to logger                        │   │
  │     │                                       │   │
  │  ───┴───────────────────────────── casing   │   │
  │                                             ↓   │
  │     ║ ║   ← insulated section               │   │
  │     ║ ║                                     │   │
  │     ║ ║                                     │   │
  │  ───╫─╫──────────────────── water table ───┘   │
  │     ║ ║   ← bare copper exposed               │   │
  │     ║ ║     water completes circuit           │   │
  │     ║ ║     resistance ∝ submerged length     │   │
  │     ║ ║                                           │
  │  ═══╩═╩═════════════════════════════════════     │
  │           borehole bottom                         │
  └──────────────────────────────────────────────────┘

Circuit (inside logger enclosure)

  3.3V ──┬── 10kΩ ──┬── probe (+) ══ water ══ probe (−) ── GND
         │          │
         │        ADC pin (reads voltage here)
         │
  Depth = f(V_adc)   →   lower V = lower R = more wire submerged = deeper water table

Groundwater in Malawi aquifers contains dissolved minerals (conductivity typically 200–600 μS/cm) which provide sufficient electrical conductivity for reliable measurement. The seasonal trend — the slow rise and fall of the water table over months — is clearly visible even with the probe's ±10–20 cm measurement noise.

Why not a pressure sensor?

The wet-cable approach was chosen over commercial alternatives for four reasons:

Factor Wet-cable probe (DIY) Pressure transducer Ultrasonic sensor
Cost~$2–3$150–400$200–500
RepairabilityReplace wire; no toolsFactory serviceFactory service
Accuracy±10–20 cm (sufficient for seasonal trend)±1–5 cm±1–5 cm
Failure modesWire breaks (visible), corrosionSeal failure, foulingFoam, turbulence, condensation
What depth does and does not tell you. The wet-cable probe tracks the seasonal rise and fall of the water table over weeks and months. It does not reliably show short-term drawdown during individual pumping events — Malawi's well-recharged aquifers respond very slowly. For pump-activity detection, use the temperature trace.

Logger hardware & costs

All four logger options use identical sensors and power components. The difference is in the main board and how data reaches the server.

Shared components (all options)

ComponentPurposeApprox. cost
DS18B20 temperature probeMorning temperature trace / pump detection~$2
Wet-cable depth probe (DIY, 2-core cable)Seasonal groundwater level~$2–3
10 kΩ resistorVoltage divider reference for depth circuit<$0.10
3.7 V LiPo / 18650 battery packOvernight and cloudy-day storage~$5–8
5 V / 1 W solar charging panelDaily recharge in full sun~$5–10
IP65 weatherproof enclosureProtection from rain, dust, insects~$5–10
Subtotal~$19–33

Per-option board & connectivity costs

Option A
ESP32 WiFi
Option B
ESP32 + SIM800L
Option C
Heltec LoRa
Option D
RAK4631 LoRa
Main board ESP32 dev board
~$6
ESP32 dev board
~$6
Heltec WiFi LoRa 32 V3
~$18
RAK4631 + RAK19003 base
~$40
Extra module — SIM800L GSM module
~$6
— —
Connectivity Site WiFi or phone-relay hotspot GPRS (any GSM network) LoRa radio → Heltec gateway LoRa radio → Heltec gateway
Gateway required No No Yes — Heltec WiFi LoRa 32 V3 (~$20, shared across many loggers) Yes — Heltec WiFi LoRa 32 V3 (~$20, shared across many loggers)
Configuration Web portal (browser, 192.168.4.1) Web portal (browser, 192.168.4.1) Web portal (browser, 192.168.4.1) BLE app (nRF Toolbox)
Running costs None SIM card ~$1–2/month data None None
Battery life advantage Good Good Good Excellent (nRF52840 ultra-low sleep)
Total per site
(incl. shared components)
~$25–39 ~$31–47
+ data
~$37–51
+ share of gateway
~$59–73
+ share of gateway
Choosing an option. If the pump site has reliable WiFi, Option A is the simplest choice. If there is cellular coverage but no WiFi, Option B avoids the need for regular field visits. For truly remote sites where neither applies, Options C or D cover up to ~8 km from a gateway installed at any building with WiFi (office, clinic, school).

System architectures

Option A — ESP32 WiFi (direct upload)

  Pump site                           Server (VPS)
  ────────────────────────            ──────────────────
  ESP32 logger
    ├─ DS18B20 temperature      WiFi  ┌─ Flask app
    ├─ Wet-cable depth probe   ─────► │  ├─ /api/upload
    ├─ Battery monitor                │  ├─ Dashboard
    └─ Web portal (192.168.4.1)       │  └─ SQLite database
                                      └──────────────────
  If no site WiFi: field worker connects phone to logger hotspot → relays CSV manually

Option B — ESP32 + SIM800L (cellular GPRS)

  Pump site                           GSM Network      Server (VPS)
  ─────────────────────────           ─────────        ──────────────────
  ESP32 + SIM800L logger
    ├─ DS18B20 temperature      GPRS  ┌─ Tower  ──────► ┌─ Flask app
    ├─ Wet-cable depth probe   ─────► │                  │  ├─ /api/upload
    ├─ Battery monitor                └─────────         │  ├─ Dashboard
    ├─ SIM card (any GSM)                                │  └─ SQLite
    └─ Web portal (192.168.4.1)                          └──────────────
  No site WiFi or gateway needed — works anywhere with mobile signal

Option C — Heltec logger + Heltec gateway (LoRa, no site connectivity)

  Pump site (remote)            Office / clinic       Server (VPS)
  ───────────────────           ─────────────────     ──────────────────
  Heltec logger                Heltec gateway
    ├─ DS18B20 temperature        (WiFi LoRa 32 V3)   ┌─ Flask app
    ├─ Wet-cable depth probe LoRa► ├─ Receives packet  │  ├─ /api/upload
    ├─ Battery monitor        ────► ├─ Decodes + POST  ─►  │  ├─ Dashboard
    └─ Web portal                   └─ Has WiFi         │  └─ SQLite
       (192.168.4.1)                                    └──────────────
  One gateway covers all loggers within ~8 km open field (LoRa SF10, 915/868 MHz)

Option D — RAK4631 logger + Heltec gateway (LoRa, ultra-low power)

  Pump site (remote)            Office / clinic       Server (VPS)
  ───────────────────           ─────────────────     ──────────────────
  RAK4631 logger               Heltec gateway
    ├─ DS18B20 temperature        (WiFi LoRa 32 V3)   ┌─ Flask app
    ├─ Wet-cable depth probe LoRa► ├─ Receives packet  │  ├─ /api/upload
    ├─ Battery monitor        ────► ├─ Decodes + POST  ─►  │  ├─ Dashboard
    └─ BLE config                   └─ Has WiFi         │  └─ SQLite
       (nRF Toolbox app)                                └──────────────
  nRF52840 chip: deepest sleep draws <5 µA — extends battery life significantly over ESP32

Fault detection & health scoring

The server automatically assesses each logger's health every time the dashboard loads. The score is based on the last 7 days of morning readings only. A score of 0–100 is computed from two components:

Score breakdown

Temperature pulse score
0 – 70 pts

For each morning, the server finds the largest absolute temperature change between any two consecutive readings within a 10-minute window. This "pulse" value is averaged across all mornings in the last 7 days.

Avg pulsePointsMeaning
≥ 2.0 °C70Clear pump activity
1.0 °C35Intermittent use
< 0.8 °C0 – 28No pump signal
Data coverage score
0 – 30 pts

Expected: 36 readings per morning (one every 5 minutes over 3 hours). The coverage fraction (actual ÷ expected) determines the score. Gaps from battery issues, reboots, or missed upload days all reduce this component.

CoveragePointsMeaning
≥ 85 %26 – 30Good coverage
50 – 84 %15 – 25Partial — some gaps
< 50 %0 – 14Low — battery or outage

Health status labels

LabelScoreTypical situation
Active ≥ 70 Regular pumping detected, good data coverage. Pump and logger are both working.
Uncertain 40 – 69 Either weak pumping signal or incomplete data coverage. Investigate — could be low usage, infrequent uploading, or early battery decline.
Inactive < 40 No pump signal and/or very sparse data. Pump is likely broken, abandoned, or the logger has a hardware problem.
No data — No readings in the last 7 days. The logger has stopped uploading — battery dead, device stolen, or no connectivity.

Common failure patterns

The combination of health label, battery voltage, last-seen time, and temperature trace reveals specific failure modes:

What you seeLikely causeAction
Inactive + flat temperature trace (no drops) + logger uploading fine Pump handle broken or removed. Logger is healthy; pump is not. Field visit to inspect and repair pump mechanism.
No data + last battery reading was low (< 3.4 V) Battery exhausted. Solar panel may be shaded, damaged, or disconnected. Check panel orientation and connection. Replace battery if swollen or old.
No data + last battery reading was healthy (> 3.8 V) Sudden device failure or theft. No warning signs in the data. Site visit. Check for tampering; replace device if missing.
Uncertain + many missing days (sparse readings) Intermittent power (loose solar connector, partial shade) or connectivity problems. Inspect solar panel and wiring. Check WiFi / SIM coverage.
Active + depth readings drifting up over weeks Seasonal drawdown — normal end-of-dry-season behaviour. No action. Compare to previous year to confirm expected pattern.
Active + depth reading jumps suddenly and stays high Probe cable may have slipped further into borehole, or water table is unusually high. Field visit to check probe position.

Reading the dashboard

Map markers

Each coloured circle on the map represents one logger site. The default colour shows pump health score:

  • Green — Active (score ≥ 70). Pump is being used regularly.
  • Amber — Uncertain (40–69). Possible issue; worth monitoring.
  • Red — Inactive (<40). Pump or logger needs attention.
  • Grey — No data in last 7 days. Logger offline.

Use the Colour metric selector to switch the map to show last temperature reading, groundwater depth, or battery voltage instead of health score.

Health table

Below the map, the health table lists every logger with:

  • Health badge — colour and label from the scoring above.
  • Score — the numeric 0–100 value.
  • Last reading — timestamp and temperature from the most recent upload.
  • 7-day mornings — how many morning readings were received in the last week.

Click Detail on any row to see the full chart, morning pattern, and API key management for that logger.

Multi-logger chart

The main chart overlays readings from multiple loggers on the same time axis. Use the Logger dropdown to select which sites to compare (hold Ctrl / Cmd to select several). Switch between Temperature, Depth, Battery, EC, and Salinity using the metric checkboxes.

The smoothing selector reduces noise: Raw shows every 5-minute reading; EWMA applies exponential smoothing (α = 0.3, best for trend-following); 1-hour average applies a symmetric moving average centred on each point.

Uploading data from the field. If a logger is configured for manual relay, the field worker connects their phone to the logger's hotspot (192.168.4.1), downloads the CSV, then uses the Upload to server button on the dashboard to push it directly from the browser. The server deduplicates on (device_id, epoch) so re-uploading the same file is safe.
Source code and firmware documentation: github.com/washways/hydrosense