Understanding Liquid Sensors

In our article Float Switch Water Level Measurement we looked at how float switches can be used to detect when water in a vessel reaches a certain height. In that same article we introduced liquid sensors, with further information available in our REUK Shop product description for the Liquid Sensors we sell.

Liquid Sensor

The Difference Between a Liquid Sensor and a Float Switch

A float switch is a mechanical switch which is either ON or OFF – i.e. current is can flow through it or not. A liquid sensor on the other hand contains components which attempt to recreate the functionality of a mechanical switch but with certain limitations.

If, for example, you have a 12VDC source you want to pass through a liquid sensor when the sensor is submerged in water, 12V will flow through it as desired. However, if you place a slightly moist finger across the sensor contacts a limited current at up to 6 or 7 Volts will be able to flow through the liquid sensor. If you are connecting the sensor directly to a 12V rated relay or light bulb, then this will not be a problem since the relay/light will require more current than is available at a higher voltage than is available.

Liquid Sensor Memory

Inside a liquid sensor is a small capacitor. If you connect a liquid sensor to a voltage source (say 12V), and then dip the sensor in water for a second – 12V will flow through the sensor. If you then disconnect the liquid sensor from the voltage source, dry it thoroughly, and wait for a few minutes, that capacitor will still have approximately 12V across it. Therefore, if you then connect the dry water sensor back up to the voltage source and measure the voltage coming through it using a voltmeter, you will find that 12V will still pass through it despite the fact that the water sensor is now bone dry.

If you now connect a load (for example a 12V light bulb) to the dry liquid sensor output, the bulb will flash on for a split second and then turn off as the liquid sensor capacitor quickly discharges (and is not recharged since it is dry). Therefore, if you intend to use a liquid sensor to switch a light bulb, relay, or other similar load directly, everything will operate as you would expect: when the liquid sensor is submerged the light/relay will turn ON, and then the sensor is removed from the liquid the light/relay will turn OFF.

Liquid Sensors and Transistors

Problems will arise however if you attempt to connect the output of the liquid sensor directly to small loads such as a transistor or integrated circuit since they will draw just a tiny current. If the internal liquid sensor capacitor has 12V across is (from being recently submerged) it could take a long time for a transistor to draw sufficient current through the (now dry) sensor to bring its voltage down to the level at which the transistor will turn off the device it is controlling.

As an example, we put together the following circuit:

Using a liquid sensor with a transistor

The circuit is designed to turn ON an LED bulb whenever the liquid sensor is submerged in liquid, and turn OFF when it is taken out of the liquid. However, in reality the circuit does not work. When the sensor is first submerged the LED bulb lights up as required; but when the sensor is lifted out of the water the LED stays on brightly for the first five seconds and then slowly dims. Measuring the voltage coming through the liquid sensor, it can be seen to go down, rapidly at first (due to the current draw of the bright LED) falling to 5V in around 5 seconds, and then much more slowly (as the LED dims and eventually turns off) so that after 1 minute it is still at 1.85V and dropping by just 0.01V each second.

In addition, if the liquid sensor is submerged in water, but with the LED disconnected, and the liquid sensor then dried off and left for 10 minutes, when the LED is reconnected it lights up (before dimming as before) since the liquid sensor capacitor has not had any load on it to discharge it. In effect the liquid sensor has remembered detecting water.

Therefore, in order to connect the liquid sensor directly to a transistor (or other low current device) and still generate accurate results, a way has to be found to short circuit the liquid sensor capacitor when it is dry and not under load. This is easily achieved by adding a load – a simple resistor will do the job – as shown in the modified circuit below:

Using a liquid sensor with a transistor, and adding a resistor to short out the internal capacitor

Now when the liquid sensor is removed from liquid the LED dims from full brightness to off in half a second, and the measured voltage coming through the sensor falls from 12V to <0.20V in just under one second.

The lower the value of the resistor, the faster the liquid sensor voltage will fall, but the more power will be wasted (as heat in the resistor) when the liquid sensor is in water. Also, using a low value of resistor (< 10K) will make it take longer for the liquid sensor output to get up to the supply voltage (or prevent it getting there at all). For example, when we used a 1K resistor in the circuit above, the voltage output from the liquid sensor never got over 10.2V (supply was 12.0V) even when the sensor was submerged.

A certain amount of experimentation can be required to set up a liquid sensor controlled system in the way shown above. Sometimes a better alternative is to use the liquid sensor to directly control a relay, and use current flowing (or not) through the relay switch as the ‘water detected’ signal which can be sent to an IC or transistor without problems. Or, space permitting, use a float switch.