The Circuit

The photograph below is of the first layout designed for development.
The top left circuit converts 12 volts to 5 volts and an LD33 drops the 5 volts to 3.3 volts.

An SSD1306 128 x 64 OLED display shows the EC value and the fluid temperature.

The ADS1115 four input 16 bit A to D converter allows the measurement of the voltage across a 1000 ohm resistor (to calculate the current through the water). The voltage across the two inner probes together with the current yields a value proportional to the absolute conductivity of the liquid.

If Schottky diodes are used the IN5817 would be better with only 450 mV forward drop - the 1N5819 has 600 mV drop but was all I had at the time. I wonder now if they are needed.

Two similar SSD1306 OLED display cards are sold but with different pinouts.

A 12 volt voltage dropper card is set to 5 volts. The LD33 drops that to 3.3 volts. An early version of the circuit had very noisy voltages from the ESP32 - especially when powered from my iMac. Hence the independent 3.3 volt source.

I intended to generate the drive pulse from the LD33 3.3 volts using a gate powered by the LD33 but triggered by the ESP32 pulse. However this development circuit seems much less noisy and that has not been used.

The Pulses

Photograph A3 shows the drive pulse in yellow generated by the ESP32 on pin D5 - it also drives the white led. Measurements were taken at the inputs to the A to D. The oscilloscope input impedance might have a small effect on the pulse shapes.  The blue/green pulse within the yellow drive  pulse shows the time taken for the A to D to measure four voltages.(D19 drives an orange LED for a time enclosing the measurement time - see the C code).

In an early test  the drive pulse was 400 milliseconds and the top of the pulses measured on the inner two electrodes sagged with time as expected. The falling edge of the pulse then forced voltages  below zero and it was then considered necessary to add Zener diodes to clamp the A to D inputs to a safe negative voltage. The series capacitors are bipolar for the same reasons.

When the drive pulse was shortened to only a little longer than the yellow pulse the negative voltage after the drive pulse was very small. Their value at present is 100 microfarads and the voltage droop seems small. 1000 microfarad capacitors were purchased to further reduce the droop but have yet to be tested.

The capacitors are present to ensure that no ions can deposit material on the electrodes. The only connection to the fluid is from ground to the bottom electrode and no currents to other metal in the tank will flow. It is important that the top of the fluid in the tube connects to air and not the tank fluid since unwanted current would flow via the series resistor and the top electrode to ground.. The top and bottom electrodes may attract ions during the drive pulse but these have to reverse after the drive pulse stops. 1 megohm resistors are tied between the A to D inputs and ground and the time between pulses is set long enough to ensure the A to D inputs have settled back fully to ground potential before the next measurement event  - this is reported on the serial output. Even if resistive deposits do form on the electrodes the four probe design calculations should still give a valid EC reading.

Since the inner electrodes never carry a net current it might be possible to remove their capacitors. In that situation all electrodes would fall to ground potential since the fluid would conduct all charge to ground. This assumes that the A to D requires only micro currents to measure a voltage. A very high impedance voltage follower was built to connect the electrodes to the A to D. Unfortunately it did not have a big enough voltage range to include ground and 3.3 volts. This could be rectified in future but the instrument seems to work well with the capacitors present with the existing input impedance of the A to D.

A1 shows how the voltage drops with time as the capacitor charges. I am puzzled by the rise in A2 and the positive voltage after the drive pulse drops.

The voltage difference (A1-A0) gives the voltage across the central fluid gap. (A3 - A2) is across the 1000 ohm resistor and gives the current through the pipe.

A second 3D printed probe (photo below) has a connector on top for a pipe. (perhaps a 1/2 inch rigid white plastic pipe or just a bit of hose).  A smaller pipe would inject a small flow from a pump to a point in the pipe at above the surface level in order to flush fresh fluid into the electrode tube when the pump runs in the flood and drain cycle.

The cut away pieces of the side channel are for a nylon tie to secure an 8 wire signal cable before the hot glue or epoxy is added to cover the solder joints and thermometer.