← Wiki

Concept

Recipe: closed-loop hydroponic doser

Also known as: hydroponic doser recipe, auto-doser recipe

Reference design composed from the farm-tech toolkit: a single-reservoir hydroponic system that reads pH and EC continuously, doses pH-up / pH-down / nutrient-A / nutrient-B from peristaltic pumps, and reports state to a dashboard. The canonical recipe for sensor-pump closed-loop control. Uses an Arduino-class MCU for the deterministic dosing loop and an ESP32 (or direct WiFi MCU) for the dashboard publish — split-architecture pattern that keeps tight control reliable while still exposing observability.

Problem statement

A hydroponic reservoir (DWC, NFT, ebb-and-flow) needs:

  • pH held in 5.5–6.5 range
  • EC held at the crop’s setpoint (typically 1.2–2.4 mS/cm depending on crop and stage)
  • Logged continuously
  • Auto-corrections without human intervention for at least 7 days at a time
  • No catastrophic over-dose if a sensor or pump fails

Architecture (split control + observability)

[Arduino Uno — deterministic control MCU]
  pH probe (via Atlas signal-conditioning)        4× peristaltic pumps
  EC probe (via Atlas signal-conditioning)  ───►   pH-up · pH-down · A · B
  temperature probe (DS18B20, for compensation)    via L298N driver

       │ Serial bridge (UART)

[ESP32 — observability node]
  publishes pH, EC, temp, last dose volume, dose-count, error states via MQTT


[Home Assistant on Raspberry Pi]
  dashboard, history, alerts

The Arduino runs a pure control loop:

  1. Read pH, EC, temperature.
  2. Apply temperature compensation to EC.
  3. If pH out of range, dose 1 mL of pH-up or pH-down. Wait 5 min. Re-read. Repeat up to N times per hour (anti-runaway).
  4. If EC below setpoint, dose 2 mL of nutrient-A and 2 mL of nutrient-B together. Wait 10 min. Re-read.
  5. Send state to ESP32 over UART.

The ESP32 only publishes — it never directly drives a pump. This isolates the safety-critical dosing logic from the WiFi-stack instability domain.

Anti-runaway constraints

  • Max doses per hour per chemical (e.g. pH-up: 5 doses/hour cap)
  • Total dose-volume cap per day per chemical (alert and refuse to dose past it)
  • Sensor-out-of-range triggers stop-doser — better to let the reservoir drift than to dose blindly into a broken-sensor reading
  • Watchdog reset if the Arduino main loop stalls

Sourcing notes

  • pH probes are consumables; budget replacement every 12–24 months
  • Atlas Scientific signal-conditioning circuits are worth the cost over generic — orders-of-magnitude better noise floor
  • Mark each pump line clearly; mixing nutrient-A into the pH-down line ruins the reservoir

Cost

  • [[arduino-uno|Arduino Uno]]: $25
  • ESP32: $10
  • Atlas Scientific pH + EC kits: $200
  • 4× peristaltic pumps + driver: $80
  • Reservoir, lines, tank fittings: $50
  • Total: ~$365

See also

Auto-generated from this entry’s typed relations: frontmatter, grouped by relation type so the editorial signal isn’t flattened.

  • Combines: [[arduino-uno]] · [[esp32]] · [[ph-sensor]] · [[ec-tds-sensor]] · [[peristaltic-pump]] · [[mqtt]] · [[home-assistant]]

What links here, and how

Inbound connections from across the wiki, grouped by lens and by relationship. These appear automatically — every entity page declares what it links to, and that data populates here on the targets.

Practical

contains

1 inbound link · 7 outbound