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.
Step 1: What you need:
- 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
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
Step 5: The wires
Step 7: Testing
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
Here is a video of the testing.