sheen.bot logo

← Insights

Why Your TDS Sensor Goes Crazy When the Hydroponics Pump Turns On

Oct 5, 2026·Sheen Robotics
Why Your TDS Sensor Goes Crazy When the Hydroponics Pump Turns On

Submersible pumps introduce stray electrical currents and electromagnetic noise directly into your shared nutrient reservoir. Here is why it breaks analog TDS readings and how to fix it in code or hardware.

When your analog Total Dissolved Solids (TDS) readings jump erratically the instant the water pump engages, the sensor is not broken. Your nutrient reservoir is behaving as a shared electrical conductor. The submersible pump is injecting leakage currents, ground loops, or high-frequency motor noise directly into the water, corrupting the microvolt-level measurements your microcontroller’s analog-to-digital converter (ADC) relies on.

You can resolve this completely through one of three methods: software interleaving (pausing the pump during readings), galvanic isolation of the sensor circuit, or clean electrical separation of your power rails.

The Physics: Why Water Acts as a Shared Circuit

An analog TDS probe does not measure chemical concentration directly; it measures electrical conductivity (EC). The probe driver applies a low-voltage alternating excitation signal across two submerged metal pins and measures the tiny resulting current flowing through the water. Because pure water is an insulator and dissolved mineral salts create free ions, higher ionic conductivity corresponds to higher TDS.

The problem arises because the nutrient bath is not electrically isolated. When you submerge a 230V AC mains pump or a 12V DC brushless submersible pump into the same reservoir:

  • Galvanic Ground Loops: If the pump casing or DC power supply shares any common path with your microcontroller’s ground, stray DC or AC leakage currents flow through the conductive nutrient solution into the TDS probe pins, finding an unintended return path to ground through your ADC pins.
  • Electromagnetic Interference (EMI): The switching circuits inside brushless DC (BLDC) pumps and the inductive fields of AC motors radiate high-frequency electromagnetic noise into the water and along unshielded sensor leads.
  • Inverter Harmonic Distortion: In South African school and agricultural setups running off backup inverters or solar battery systems during load-shedding, modified sine wave inverters introduce significant harmonic hash into AC pump windings, dramatically amplifying the noise floor in the tank.

Because the signal measured across the TDS probe is tiny—often conditioned down to a 0–2.3V or 0–3.3V analog output—even a 50mV stray potential in the water will cause your microcontoller ADC readings to swing wildly by hundreds of parts per million (ppm).

Solution 1: The Zero-Cost Fix (Software Interleaving)

If your system uses a relay or MOSFET to cycle the pump, the simplest and most reliable fix costs nothing. Nutrient concentration changes over hours and days, not seconds. You do not need continuous real-time sampling while the water is actively churning.

Instead, structure your firmware (in MicroPython, Arduino C++, or ESP-IDF) to follow a pump-pause reading schedule:

  1. Turn off the pump relay.
  2. Pause for 3 to 5 seconds to allow fluid turbulence, bubble cavitation, and capacitive charges in the water to dissipate.
  3. Take 10 to 20 analog samples over 500 milliseconds.
  4. Apply a median filter (discarding the highest and lowest readings) and calculate the average.
  5. Store or transmit the validated TDS value.
  6. Turn the pump relay back on.

Executing this cycle once every 15 to 30 minutes gives accurate, drift-free nutrient tracking without disrupting root oxygenation or water circulation.

Solution 2: Hardware Galvanic Isolation

If you run a continuous-flow NFT (nutrient film technique) or commercial Dutch bucket system where the pump cannot be paused, you must electrically isolate the sensor from the controller's power and data buses.

Isolation ComponentRole in CircuitTypical Part / Approach
Isolated DC-DC ConverterBreaks the shared power ground between microcontroller and sensor board.B0505S-1WR3 (5V to isolated 5V)
Analog Signal Isolator / Linear OptocouplerTransmits the 0–3.3V analog voltage across an optical barrier without direct electrical contact.HCNR200 / Dedicated analog isolation breakout
Isolated Digital ADC (I2C/SPI)Places the ADC on the isolated side and transmits digital readings over optocouplers.ADS1115 ADC paired with an ADuM1250 / ISO1540 digital isolator

The cleanest hardware architecture is placing an external ADC (such as an ADS1115) on the sensor's side of the boundary, powering that ADC with an isolated DC-DC converter, and bridging the I2C bus back to your ESP32 or Raspberry Pi Pico using a digital isolator IC. This guarantees zero galvanic path between the water and your controller logic.

Solution 3: Power Rail Separation and Wiring Discipline

If you are building custom monitoring units—such as those covered in our Sheen IoT prototyping resources or integrated into automated classroom growbeds via our school hydroponics kits—implementing standard electrical separation prevents most interference before it reaches the sensor:

  • Separate Power Supplies: Never power a 12V submersible pump from the same DC supply rail powering your sensitive microcontroller logic. Inductive kickback when the pump starts causes voltage sags that destabilise your ADC reference voltage.
  • Flyback Diodes and Snubbers: Place a 1N4007 flyback diode across inductive DC pump terminals, or an RC snubber across AC relay contacts, to suppress transient voltage spikes at the source.
  • Cable Routing: Never run the low-voltage analog sensor cable parallel to the pump’s 230V or 12V power cord inside the same conduit. Maintain at least 15 cm of physical separation, or use grounded shielded twisted-pair cabling for the probe.
  • Reservoir Earth Grounding: In systems with severe static or motor capacitive coupling, submerging a dedicated 316 stainless steel grounding rod into the reservoir connected to mains Earth can shunt stray potentials away from the sensor pins.

By enforcing clear timing in your software or proper galvanic isolation in your wiring, your TDS readings will remain rock-solid regardless of what the pump motor is doing.

#hydroponics#iot#sensors#electronics#troubleshooting

More Insights