loading

How to make a simple and cheap liquid switch (without floats).

Picture of How to make a simple and cheap liquid switch (without floats).

Many people who have used float switches know that they can be pretty unreliable. In this tutorial you will learn how to make a solid state liquid switch that uses electrodes to sense liquids instead of a float. They are easy to make and are much cheaper than float switches. They are reliable alternatives to float switches and have many applications.


 
Remove these adsRemove these ads by Signing Up

Step 1: What you need:

Picture of What you need:
DSC09369.JPG
There are a few simple and accessible items that you will need to make this switch.
- 1 NPN Transistor - I used the TIP120 from radioshack but just about any NPN will do.
- 1 1Kohm resistor
- 1 capacitor - I used a 25v 1000 microfarad. The capacitor is not necessary but it will allow for a slight delay so a pump will stay on for a bit longer when the liquid is no longer contacting the electrodes.
- A piece of copper or other heat sink. If you are using this for high current operation you will need a bigger heat sink than just a piece of copper.
- misc wire - I'm sure you have some laying around.

Note: For this switch to work the liquid will need to be slightly conductive. It works with tap and purified water but probably not distilled unless an electrolyte is added.

Step 2: How it works

Picture of How it works
DSC09369.JPG
The key component to this device is the NPN transistor. An NPN transistor acts as a switch and amplifier much like a relay but not mechanical. When a small voltage flows through the base it turns the transistor on and allows a larger voltage and more current to flow through it. The base pin can be viewed like a trigger. When triggered it allows current to flow from collector pin to the emitter pin.

You can get an idea of exactly how the liquid switch works by looking at the schematic below. When the sensor electrodes contact a conductive liquid current flows from +12 through the 1k resistor to the base of the transistor. This turns the transistor on and allows current to flow through its collector to its emitter. The collector will go to the negative of the device and the +12 will go to the positive. When the electrodes are not touching the conductive liquid the current can not flow to the base keeping the transistor off. The resistor limits the current that can flow into the base. The capacitor stores some of the energy from when the the electrodes were conducting so that when the liquid recedes there is still power flowing into the base until the capacitor fully dissipates. The larger the capacitance the longer it will take to dissipate and the longer the transistor will stay open after the liquid recedes. 1000 microfarads does not keep it open for long so if you want it to stay on for a few seconds after the liquid recedes you will need a much larger capacitance.

The TIP120 transistor can only handle 5A continuous load so if your device draws more power than 5A you will need a higher power transistor. Also with the TIP120 the max voltage to the base is 5v so if your supply is higher voltage and the fluid is really conductive make sure the resistor will not allow more than 5v to enter the base. More info on the TIP120 below including the pin diagram.

Step 3: The capacitor

Picture of The capacitor
Solder the negative of the capacitor to the emitter and the positive to the base of the transistor.

Step 4: The resistor

Picture of The resistor

Solder the resistor to the base of the transistor.

Step 5: The wires

Picture of The wires
Solder a small wire on to the other side of the resistor. This will be one of the sensor wires. Solder bigger wires to the collector and emitter as these will be the high power wires. The emitter will go directly to the negative of the power source and the collector will go to the negative of your device. The other sensor wire will be connected to the positive of your power supply where the positive side of your device will also connect.

Step 6: The heat sink

Picture of The heat sink
Use thermal paste and a screw to mount the transistor to the heat sink.

Step 7: Testing

Picture of Testing
DSC09367.JPG

The emitter should go to the negative of the power source. The collector should go to the negative of your device in this case a multimeter. The positive of the power source should go to the positive of your device. The second sensor wire should be connected to the + power source. You can put a piece of steel wire on each sensor wire as electrodes. Put the electrodes in some tap water and you should see the transistor turn on and allow the power to flow through.

Step 8: You're done

You are done with making the device. You can now put it into a container or coat it in an epoxy. This instructable is just to give you the basic idea of how this switch works. You can now experiment with form factor or using multiple transistors to make a more complicated sensing system. Have fun with it and put it to good use. Thanks

Here is a video of the testing.



 


I would like to make a little sensor like this myself but to hook to an arduino. Any suggestions on specing the parts? I'm still learning about circuits.

garrettsatt (author)  IngridMatilde1 month ago

You can use an analog input pin to sense the voltage and perform whatever action you want. One electrode will be connected to 5v or a digital output pin. The other will be connected to an analog input. If there is water between the electrodes the analog input will read higher than if no water is between them. The ADC will convert the voltage into a number between 0 and 1024.

honda154201 year ago
Bro kindly mention this circuit for 18v and 24v plz
garrettsatt (author) 4 years ago
The TIP120 can handle 5A. A typical 750gph 12v bilge pump draws about 3A. It will produce more heat and need a better heat sink. If you use a PNP it will work in reverse but the problem is the continuous current flowing through to keep the transistor off would corrode away the electrodes very quickly. It may be better to use a micro controller that does not constantly run a voltage through the water but just checks once every few minutes. You many be able to modify this circuit with a micro controller or 555 timer to make it only have current flowing for a short time periodically. With a BJT transistor i do not know if a variable resistor will work very well. It takes .7 volts to turn on a silicon based transistor so you would have to adjust it where in an on situation it would be >.7 volts. Thanks for the comment
HarveyH444 years ago
How much of a load will the transistor handle? Nice idea, might give it a shot, but little concerned about whether this will run a pump motor. I'm thinking about a small auto window washer pump. Also, if you use a PNP transistor, will it work in reverse? I mean will it turn on a pump, when the electrodes are dry? Want to make some potted plants self watering. Could a variable resistor be added to adjust sensitivity?