Open hardware · Reef chemistry · v2.0

Lab-grade alkalinity, nitrate and phosphate.
Every six hours, from your own bench.

OpenReef is an open-source analyzer you build from off-the-shelf parts for about $849. It titrates alkalinity the way oceanographers do, reads nitrate and phosphate by self-blanked colorimetry, and exposes every result through a full REST API.

Parts cost
$849
Alkalinity resolution
0.02 dKH
Phosphate resolution
0.01 ppm
API endpoints
40
WET BAY DRY BAY CELL A · pH titration CELL B · colorimetry 5 × SYRINGE PUMPS · acid + NP reagents REAGENTS · 0.02 N HCl RASPBERRY PI 4 TMC2209 ×5 · MCP23017 12 V · 5 A MOSFET ×8 · relay

How it measures

Three textbook methods, one small box.

Alkalinity by Gran titration

A 20 mL sample is titrated with 0.02 N HCl in 60 µL steps while a lab-grade electrode tracks pH. The excess-acid region is extrapolated to the equivalence point, with a DIC correction, so electrode offset drops out of the result.

Method & math →

Phosphate by molybdenum blue

The cell is read before and after reagent so turbidity and colour cancel. An 850 nm LED and an 11-channel spectral sensor resolve 0.01 ppm PO₄ in a 22 mm cuvette.

Optics & chemistry →

Nitrate by azo dye

Nitrate is reduced and coupled into a pink azo dye read at 540 nm. Reagent kinetics are characterised on your own standards, so any liquid kit — Trident NP or lab-mixed — can be profiled.

Reagent options →

Hardware

Five printed syringe pumps, two cells, one Pi.

Every part is something you can order today. The syringe pumps are a NEMA17, a T8 lead screw and a 5 mL glass syringe between two check valves — 0.07 µL per step. Six cheap peristaltic pumps move sample and waste; a dip tube sets the volume so no pump needs to be precise except the ones that are.

  • Raspberry Pi 4, Atlas Scientific EZO-pH, AMS AS7341
  • Finger-jointed laser-cut acrylic enclosure, 420 × 460 × 200 mm, wet and dry bays
  • Leak sensor, waste float, reagent accounting, dry-contact alarm
  • OpenSCAD sources with renders, parametric panel generator, wiring diagram, costed BOM
ParameterRangeResolutionCycle
Alkalinity4–14 dKH0.02 dKH6–8 min
Phosphate0–1.0 ppm0.01 ppm10–12 min
Nitrate0–50 ppm0.1 ppm15–30 min
Sample per alk test≈75 mL tank water, 1.5 mL 0.02 N HCl
Reagent autonomy60 days NO₃/PO₄ at 1/day (Trident NP kit) · 2+ months acid
Power12 V DC, <30 W peak

Parts

Everything printable or cuttable, rendered from the sources.

Software

A real API, not a web page with buttons.

One Python service runs the fluidics, the chemistry math, a scheduler, SQLite history and the dashboard. Every result keeps its raw titration curve or absorbance channels and a quality score. A hardware simulator with a carbonate-system model runs the whole stack on a laptop.

  • REST + WebSocket, OpenAPI schema, API-key auth
  • Hydros developer API rules and a hardware alarm contact
  • MQTT with Home Assistant discovery, webhooks, Prometheus
  • Calibration wizard: pH buffers, acid standardisation, curve fits, reagent characterisation
API reference
$ curl -s -H "X-API-Key: $KEY" http://openreef.local:8080/api/v1/results/latest
{
  "alkalinity": { "value": 8.29, "unit": "dKH", "quality": 0.98, "ts": 1794093600 },
  "phosphate":  { "value": 0.08, "unit": "ppm", "quality": 1.00, "ts": 1794072600 },
  "nitrate":    { "value": 5.1,  "unit": "ppm", "quality": 0.95, "ts": 1794074400 }
}

$ curl -s -X POST -H "X-API-Key: $KEY" http://openreef.local:8080/api/v1/tests/alkalinity
{ "run_id": 418, "test": "alkalinity", "status": "started" }

Build path

A weekend of printing, a weekend of plumbing.

  1. 01

    Order & print

    Order the BOM, print five pump frames, two cell parts and the brackets, cut the panels.

  2. 02

    Wire & flash

    Pi, drivers, I²C sensors and MOSFET board on the carrier; run deploy/install.sh.

  3. 03

    Plumb & prime

    Cells, dip tubes, check valves, reagent lines. Prime each pump from the dashboard.

  4. 04

    Calibrate & schedule

    pH buffers, Na₂CO₃ standard, two colorimetric standards each. Then let it run.