Arduino pH and EC Controller for Hydroponics: Why EC Throws Off pH

UAOrganic
9 min read
Arduino pH and EC Controller for Hydroponics: Why EC Throws Off pH

You can build an Arduino pH and EC controller for hydroponics in an evening: a board, two analog modules, a couple of peristaltic pumps, and relays. The trouble starts when both sensors go into the same reservoir. DFRobot, which sells these modules for Arduino, says so plainly in the guide for its signal isolator: the conductivity sensor releases high-frequency electrical signals into the water, and a pH sensor in the same container will be seriously disturbed. The isolator costs $19.90. Without it, your pH automation doses acid based on false readings.

This article covers the hardware: what the controller is made of, where the interference comes from and how to get rid of it, which modules to buy, how an ESP32 differs from an Arduino Uno, how to calibrate in firmware, and when it’s time to move to a PLC. Dosing logic (PID, deadband, dose limits, and emergency shutdown) is covered in the wiki entry pH and EC automation, so we won’t repeat it here. Whether you need automation at all, or once-a-day manual correction will do, is covered in manual vs automated pH dosing.

Arduino pH and EC controller: what goes into it

The minimum kit for one reservoir:

  • A board: an Arduino Uno, or an ESP32 if you want Wi-Fi.
  • A pH module with an electrode and an EC module with a probe. The module turns the probe’s weak signal into a voltage the board can read.
  • A temperature sensor in the solution. Without it you can’t correct EC to 77°F (25°C).
  • An isolator for the EC module.
  • Peristaltic pumps (acid, nutrient concentrates A and B) and the relays the board uses to switch them.
  • A level sensor, so the pumps don’t dose into an empty tank.

For a sense of cost: in the SMART GROW project (HardwareX, 2024), all the hardware for an automated home hydroponic system came to 314.48 Malaysian ringgit, about $72. The authors ran into the same interference. They had to move the EC sensor to a separate ESP32 board, in their words, to avoid electrical interference with the pH sensor and get stable readings.

EC sensor interference with pH: why you need galvanic isolation

An EC module measures conductivity by passing alternating current through the solution between the two electrodes of its probe. Meanwhile, the pH electrode measures voltage in millivolts: about 59 mV per pH unit at 77°F (25°C). Current from the EC probe travels through the water, enters the pH electrode, and returns to the board through the shared ground. Every 6 mV of stray signal is 0.1 pH, even though nothing is happening in the solution.

Atlas Scientific puts it the same way in the datasheet for its EZO conductivity circuit: conductivity readings introduce significant electrical interference into the water, and that interference affects pH, ORP, and dissolved oxygen sensors. How an ORP electrode responds to the state of the solution, and why its readings are easy to throw off, is covered in the wiki entry ORP / Redox. According to Atlas, electrical isolation is 100% effective against this interference. There’s a second reason to use it: an EC probe gives the water a low-resistance path to your electronics, so a voltage spike in the tank goes straight into the controller. The manufacturer’s conclusion: “Never build a commercial product without electrical isolation.”

Ways to isolate:

  • An analog signal isolator between the EC module and the board. DFRobot’s is the DFR0504 at $19.90: 5 V supply, about 4 s response time, up to ±20 mV difference between input and output. It goes on the EC side, because EC is the source of the noise.
  • An isolated carrier board for Atlas EZO digital circuits. The circuit outputs a finished number, and the board isolates power and data lines.
  • A separate board for EC, as in SMART GROW. It works, but a $20 isolator saves you from running two controllers on one tank.

The SMART GROW authors also wired the pH sensor and the ultrasonic level sensor to different ground pins to avoid a ground loop. In their first test, EC and the ultrasonic sensor on one board didn’t work together either.

Arduino pH and EC modules: DFRobot or Atlas Scientific

DIY projects mostly use one of two product lines: DFRobot’s analog Gravity modules and Atlas Scientific’s digital EZO circuits. Specs and prices from the manufacturers’ websites as of September 2026:

ModuleAccuracyProbe lifePrice, $
DFRobot pH SEN0161-V2, lab grade±0.1 pH at 77°F (25°C)over 6 months39.50
DFRobot pH SEN0169-V2, industrial, for 24/7 use±0.1 pH at 77°F (25°C)over 6 months64.90
DFRobot EC DFR0300, K 1±5% of full scaleover 6 months69.90
Atlas Scientific pH kit±0.002 pH (probe)~2.5 years174.99
Atlas Scientific EC K 1.0 kit±2% of reading~10 years229.99

The biggest difference is in EC. DFRobot specifies ±5% of full scale, and the DFR0300’s scale goes up to 20 mS/cm. That works out to as much as ±1 mS/cm anywhere in the range. A working solution for leafy greens runs around 1.5 mS/cm, so the error can be two-thirds of the value itself. Our wiki considers automation properly tuned when it holds EC within ±0.1 mS/cm of the recipe. A module with this rated accuracy can’t guarantee that. Atlas specifies ±2% of reading, which at 1.5 mS/cm is about ±0.03.

pH is less of a problem: DFRobot’s ±0.1 pH is good enough for hydroponics. The weak point is the probe. Even for the industrial SEN0169-V2, the manufacturer lists probe life as “over 6 months” of 24/7 use, depending on water quality. For its lab-grade pH probe, Atlas gives about 2.5 years. How long different sensors last and what needs replacing is covered in hydroponic sensors.

Atlas EZO circuits talk over UART or I2C, run on 3.3 to 5 V, and return a finished, temperature-compensated value. The board’s analog-to-digital converter isn’t needed at all, and neither are the workarounds in the next section.

ESP32 or Arduino Uno: 3.3 V inputs and a noisy ADC

The ESP32 is more convenient because of Wi-Fi, but with analog modules it has three traps.

First, ESP32 inputs accept up to 3.3 V. DFRobot’s V2 pH board outputs up to 3.0 V, which is fine. The DFR0300 EC board outputs up to 3.4 V and goes over the limit at the top of its range. In SMART GROW the pH sensor put out up to 5 V, and the authors brought it down with a divider made of two 1,000-ohm resistors.

Second, the ADC reference voltage. Espressif says it’s 1,100 mV by design but ranges from 1,000 to 1,200 mV from chip to chip. Without the calibration driver from ESP-IDF, two identical boards will report different values for the same voltage. Calibrating pH against buffers absorbs part of this error, but only for the board you calibrated on.

Third, noise. According to Espressif’s documentation, the ESP32 ADC is sensitive to noise, which leads to large discrepancies in readings. The manufacturer recommends a 100 nF capacitor on the input and averaging several samples (their chart uses 64). One more detail: the second ADC block, ADC2, is also used by Wi-Fi, so put your sensors on ADC1 pins.

An Arduino Uno runs at 5 V and has no Wi-Fi, so it has fewer of these conflicts. Its built-in ADC is noisy too: in a test by Nandi and Shrestha (Sensors, 2024), a moisture sensor’s signal wandered by about 27 mV on the Arduino’s built-in ADC and by less than 1 mV on an external 16-bit ADS1115. For analog pH and EC modules, an external ADC that costs a few dollars does more than switching boards.

Calibrating pH and EC in firmware

DFRobot’s libraries store calibration parameters in EEPROM. If your sketch writes its own settings to the same address, calibration “fails” or produces strange numbers. DFRobot’s FAQ suggests erasing those addresses once if that happens. It’s better to keep your own settings in a different part of memory from the start.

  • pH: two points. First the 7.0 buffer (the electrode’s zero point), then 4.0 (the slope). DFRobot recommends calibrating once a month, or once a week with frequent use, and using fresh buffers. The procedure and common mistakes are in the wiki entry pH meter calibration.
  • EC: both points are required, with 1,413 µS/cm and 12.88 mS/cm solutions. The library function takes voltage and temperature together, so without a temperature sensor there’s no compensation. More in the wiki entry EC meter calibration.

Calibrate the finished assembly: with the isolator, the same cable, and the same board that will run on the tank. Atlas warns separately that changing the cable length or the controller changes the electrical properties of the circuit, and EC will have to be recalibrated.

Pumps, relays, and acid

Peristaltic pumps are switched through relays. In an ESP32 system described in MethodsX (2025), the authors explain why: relays isolate the board’s low-voltage circuitry from the pump voltage, and they need to be rated for the voltage and current of your specific pumps. The same paper lists sensor calibration drift in real-world conditions among its limitations.

Fill the acid pump with diluted pH adjuster. Which acid to use (phosphoric, nitric, or citric) and why the choice depends on your water’s alkalinity is explained in the wiki entry pH adjusters. How many milliliters you’ll need per tank is what the hydroponic acid dosing calculator is for. A per-session dose limit and a shutdown on impossible sensor readings are mandatory; they’re covered in the automation wiki linked above.

Arduino or PLC: when to go industrial

An industrial controller (PLC) with sensor transmitters solves the same problems by other means. Transmitters send the signal over a 4-20 mA current loop or digitally over RS-485 (Modbus), so a long cable from the tank to the cabinet isn’t an issue. PLC inputs are designed for a cabinet full of contactors and pumps. Modules with built-in galvanic isolation are common, but check the datasheet for the specific module and look for the word “isolated.”

For a home system or a small farm with one or two reservoirs, an ESP32 with Atlas EZO circuits and isolation on EC is plenty. A PLC is worth considering when a commercial greenhouse crop depends on the automation, the sensors sit far from the cabinet, or the system is maintained by someone who didn’t write the firmware. Atlas’s “never without isolation” applies to a PLC just as much.

Arduino pH and EC automation: key points

  • An EC sensor in the same tank interferes with pH, ORP, and DO. Galvanic isolation on EC is a must: DFRobot’s isolator costs $19.90.
  • The budget DFR0300 EC module is rated at ±5% of a 20 mS/cm scale, or up to ±1 mS/cm. Holding EC precisely takes a module whose error is a percentage of the reading.
  • DFRobot pH probes are rated for six months or more, the Atlas probe for about 2.5 years. Budget for replacements.
  • On an ESP32, watch the input voltage (3.3 V max), calibrate the ADC, add a capacitor, average your samples, and use ADC1.
  • Calibrate pH at 7.0 and 4.0 and EC at 1,413 µS/cm and 12.88 mS/cm, on the finished assembly.
Share:

Article author

UAOrganic

The UAOrganic team - agronomists, nutritionists, and organic farming specialists with over 10 years of hands-on experience. We grow microgreens and organic crops, test agronomic methods, and verify facts against scientific sources. Our content meets EU organic certification standards and helps farmers, restaurants, and conscious consumers make informed decisions.