Nutrient Mixer & Correction Tool

Step-by-step hydroponic reservoir correction: fix pH before EC, with crop-stage targets, volume scaling, and A+B mixing helpers.

What this tool does

Builds a ordered correction plan for an existing reservoir: pH steps first when out of range, then EC up/down.

Scales doses to reservoir volume (litres or L×W×depth).

Includes separate A+B mix and NPK ratio helpers for fresh tanks.

How it works

  1. Stage targets from plant nutrients JSON, or FALLBACK_STAGE EC 0.8–1.6 mS/cm and pH 5.8–6.3.
  2. pH down/up dose: raw mL = volume_L × |ΔpH| × strength (default 0.15 mL/L per pH unit down, 0.2 up); UI starts at 50% of raw.
  3. EC raise toward midpoint: ml per part ≈ (volume_L × ecGap) / nutrientStrength / 2 for A and B; default nutrientStrength 0.4 mS/cm per (mL/L) of concentrate.
  4. EC high: dilution volume = (currentEC × volumeL) / ecMid − volumeL water to add.
  5. PH_TOLERANCE 0.05; PH_CRITICAL_DELTA 0.5 triggers stronger pH-first messaging.

Assumptions and default values

Default nutrient strength0.4 mS/cm rise per (mL/L) of A+B concentrate
pH Down strength0.15 mL/L per pH unit
pH Up strength0.2 mL/L per pH unit
Fallback EC / pH band0.8–1.6 mS/cm, pH 5.8–6.3

Worked example

Computed with the same functions as the live tool.

Inputs

Reservoir20 L
Current pH6.8
Current EC1 mS/cm

Outputs

Suggested pH Down start0.97 mL (50% of raw estimate)
EC raise (A+B total, approx.)10 mL toward midpoint 1.2 mS/cm

Limitations

  • Does not replace a lab water analysis or stock-specific label instructions.
  • Assumes generic concentrate strengths — adjust strengths in the UI if your product differs.
  • Does not model temperature-dependent pH drift over hours.

FAQ

Why fix pH before adding nutrients?

The plan always inserts pH correction before EC dosing when pH is outside the band, because nutrient salts shift pH and EC readings taken in a broken pH range are misleading.

How accurate are EC and pH targets?

Targets come from per-stage fields on each plant when available; otherwise the fallback band above is used.

Does it support odd tank shapes?

Yes — enter litres directly or length × width × water depth to compute volume.

Why only half the calculated pH dose?

The code uses 50% of the calculated pH adjuster volume as the starting suggestion to reduce over-correction risk.

What if EC and pH are both fine?

The plan tells you to maintain and re-test in 24 h or after a top-up.