Picture of Build a simple water level control

About 20 years ago, a friend of mine came to me saying that he had to repair a customer’s  water level control made out of electromechanical relays which was falling apart.  He understood that the original control relied on conductivity of water. The customer didn’t want any type of float switch so he had to stick to the way it was meant to work.

He could start the pump whenever water fell below the “low” level electrode and pump would stop once it reached the “high” level electrode but, as water was consumed and its level barely dropped just below “high”, his circuit would re-start the pump just to stop it as soon as “high” electrode was touched by water again. This process kept going on and on until he switched power off. His circuit was oscillating which was not good for a 5 HP water pump or any pump at all.

He needed help. At this point I asked him that instead of working with relays, wouldn’t it be nice if the control were electronic which would probably be less expensive, more reliable and have a longer life?

 I intended to build a kit for Club Jameco out of how I remembered this control worked and this is what this instructable is all about. 

*** Disclaimer: This kit is meant to operate with equipment such as line operated water pumps or motor starter relays and/or contactors at lower control voltages. Line voltage is dangerous and if mishandled can cause injury or death. If you are not familiar or have not worked with line operated equipment, have a licensed electrician do the power wiring for you. This kit is meant to be educational in nature and can be used with line operated equipment if National Electric Code guidelines are followed. ***

Remove these adsRemove these ads by Signing Up
1-40 of 75Next »
zohaib_975 days ago

Hi ! I am new to the world of electronics and wish to make a similar circuit with some more requirements. Could u please help in suggesting a simple, cheapest, durable and an automated solution (with maximum safety) for prototyping the circuit below? Thank You !

I have two AC motors, one for storing water in underground tank and the other for filling up overhead tank.

I start storing water in the underground tank once it comes during designated timings on alternate days only and it takes 8-10 hrs for tank to fill completely.

Sometimes it even happens that pump for underground tank is left running (not knowingly) and the water supply from utility during the designated timings is over while filling up the tank. In this scenario, the motor uselessly runs, until someone physically see the the flow of water and then switches it off.

After I see that there is substantial amount of water present in the sump, then only i switch on the other motor to fill up overhead tank or it would burn down the motor. The tank fills up in 90mins, if it's completely empty. In this scenario too, one has to be there in time to switch off the motor once it has filled up completely to prevent overflow.

For this circuit, I would like to know the level of water using 5 LED indicators (EMPTY, 1/4, 1/2, 3/4, FULL) for both of my tanks.

More importantly, a manual switch in the circuit would be its plus point. So that if the circuit is malfunctioning, I would be able to connect the motors directly to mains.

Both are 2 HP motors and operate in 220V AC

rlarios (author)  zohaib_973 days ago
Hi there zohaib_97,

Unless I missed something, the only pump you need automated is the underground pump. This means that the overhead tank can be controlled with the circuit shown here in this instructable.

The underground pump can be controlled by a circuit similar to the "pump protect" portion. As this pump needs to come on only when water is available from the utility every other day at designated times, whenever water is unavailable, this pump won't come on.

You can always place a switch in parallel with relay contacts to turn pumps on and off in case of control circuit malfunction.

For water level monitoring you can place electrodes at your required levels and each electrode will be the input to a CMOS gate of some sort (like the ones in the CD4001 IC) which in turn could drive a transistor to turn on an LED.

Let me know if you are in agreement with this unless corrections are needed so either I help you designing it or you do it yourself.


Hi rlarios

Thank you so much for showing support, really appreciate your efforts.

I agree with you, whatever u said above. Although, this instructable covers the requirement of automating overhead pump, but for the underground pump, can you please help me in designing the the circuit?

rlarios (author)  zohaib_97yesterday
Sure, I have one question, though. Where does underground pump get water from? A pipe, another reservoir?

I'm thinking that the underground pump can be controlled the same way the overhead pump would. After all, you would like underground pump to run until underground tank is full or until utility water runs out, wouldn't you? Being this the case, your only problem would be where to place sensors.


Hi rlarios, thank you for your support.

The pump for storing the water underground (in our reservoir/sump) gets water from utility company though their underground running main pipe.

I would like to implement both of the conditions for underground pump. This is because, may be underground tank gets full first but utility water is still coming in its timings. Or it may also be possible that utility water runs out first but the tank is still not filled up completely.

rlarios (author)  zohaib_972 hours ago
Do you have access to place a sensor on your underground pump's succion port? That would be necessary in order for the control to turn off this pump when you run out of utility water

hii....i connected everything, but while checking the voltage between 7th pin and 14th pin the voltage is not as required voltage 12v..what I have to do?

rlarios (author)  aravindarumanai2 hours ago
Did you wire the circuit as shown in the instructable? If this is so, you should have gotten 12V unless your voltage regulator is faulty, severely overloaded, or you definitely used a different voltage regulator.

The 12V source was used because it's a standard rating on most relays and CMOS ICs so only one voltage source would be needed.

In your case you didn't specify what voltage you got between power pins. Check CD4001's and your relay's data sheets. The voltage you got may fall within your devices' tolerances.

SankalpS19 days ago


Would it be possible for you to post the circuit with a 7402 IC. It costs about $0.20. Plus the problem I am facing with the 4001 based circuit is transient voltage is affecting it badly. Whenever a light or microwave oven is switched on or off the circuit stops working. I am a bit confused with the resistor values. 7402 needs different range of voltage for High and Low

rlarios (author)  SankalpS19 days ago
Hi there SankalpS,

I see what you're saying regarding the transients. That shows that your ac power source has a relatively high source impedance. The best way to compensate for that would be to use an RC filter at each water electrode input.

Place a 0.1uF or a 1uF (depending on the severity of the transient) between each input and ground. This would create a time constant of 0.22 seconds (or 2.2 seconds if 1uF) at each input which would let the S-R latch ride-through the transients.

Please let me know how that works. In the meantime, I'll take a look at that 7402 circuit to see why you want to use it.

Thanks for your comments.


Hi Rlarios

Tried it out with 0.1 uF caps connected at all the inputs and a TVS diode across the power supply. The circuit seems to be stable now.

The reason I wanted to use a 7402 because its TTL based and seems to be immune to transients as I had used it earlier in a different project.

Thanks for the super fast response.


rlarios (author)  SankalpS17 days ago


In order to get 7402's minimum (per Fairchild's datasheet) High-level input Voltage (2.4V), pull-up resistor would need to be no higher than 3.3K between +5V and each input. That means that in order to get 7402's maximum Low-level voltage (0.8V), water resistance between each input and ground electrode should be no more than 390 Ohms. You would have to place a ground electrode as close as practical to each input if you want to try it.

Water resistivity depends on its mineral contents. According to Wikipedia, sea water has the lowest water resistivity in Ohm-m. Drinking water varies between 20 and 2000 Ohms-m.

You will have to try it to see whether this would work. I remember to have seen higher resistivity values elsewhere. I hope Wikipedia is correct, though.

Best of luck!


anshuanshu3335 months ago

hi i want to control two valves using an SR latch can i do it as shown below, can you also let me know why is pin 8-9 of IC 4001N is shorted why cant you connect the High(X2-2) directly to pin 13, my intention is to control the pump based on the levels of two tanks so i was thinking to reuse the NOR gates if they are not needed, i also do not need pump Protect

rlarios (author)  anshuanshu3335 months ago

Hi ashuanshu333!

Pins 8 and 9 were shorted at that gate's input to make it operate as a logic inverter. A "high" level is needed to stop the pump and that input is "low" when water level touches that electrode. An S-R latch changes state when either input is "high". Both inputs being at a "high" state in an S-R latch is an invalid condition, check out truth table in the slide show.

To stop the pump, we "inverted" X2-2 so the pump could stop. This explains why X2-2 was not connected directly to pin 13. If we had not used this extra gate we would have used something else to invert this signal, though. Go back again through the Theory of Operation slide show and analyze each slide in case you still have any doubt.

X2-1 does not need to be inverted as once water level falls below it, this pin will switch to a "high" state (while X2-2 is "high" as well but thanks to the extra gate wired as an inverter, the S-R latch sees X2-2 as a "low" level signal).

It seems to me that you don't want to use more than 2 ICs. However, you need an additional OR gate to turn on the pump. Why instead of using a 74AHC1G32DBV don't you use the second CD4001's remaining gates to implement an OR function?

For each tank you would use 3 gates, that's a total of 6 gates to implement water level control. As each IC has 4 gates, having two ICs gives you a total of 8 gates which would be enough to include the OR function needed to turn on the pump.

I would use one of the remaining gates wired the way you did the 74xx32 and the last gate to invert its output just the same way it was done to invert X2-2 in the basic water level control. After all, a NOR gate is nothing more than an OR gate followed by an inverter or NOT gate, don't you think so?

Please, let me know whether this works for you or I am still missing something.

Good luck!


rlarios (author)  rlarios5 months ago

I look forward to seeing how your circuit turns out to be.


thanks for your quick response , i think what you suggested is much better than what i thought, your article is great. thanks once again,i will send you the pics when i am done making it.

KUPITO8 months ago

Great Instructable you have here.

One question about the IC, i was wondering if i could replace the IC you have described for 7402 IC. It seems like theyre exactly the same but i just want to be sure. Here is the diagram of the 7402 IC

rlarios (author)  KUPITO8 months ago

Hi Kupito,

I'm glad you liked it.

You will have to check what this device's input impedance is to make sure whether existing input pull-up resistors can work or not. Besides, this being a TTL device poses a problem due to the onboard +12V supply voltage. TTL devices operate at +5V and typically, any voltage higher than +6V or +7V between Vcc and Gnd could destroy the device. Even CMOS 74HC02 has same absolute maximum.

One CD4001 costs around $0.39 U.S. while one 7402 costs around $1.75 U.S. So, do yourself a favor and stick to the CD4001 so no design changes are necessary and save some money at the same time.

The reason CD4001 was used was because this way only one supply voltage (+12V) for both, the IC and the relay would be necessary. Relays whose coils are rated at 12V can be found almost anywhere, even in remote villages, so nobody would have any problem finding one.

Hope this answers your question.

KUPITO rlarios8 months ago

Thanks for the great answer. Ill definitely stick to the CD4001.

This has to be the #1 instructable I have read so far. Since I am a newbie, it is a great learning experience as well.

I have 3 1000 Litres tank and since I am in India, the motors run at 240Volts. I need to get this circuit for all 3 of my 1000L water tanks.

If I have understood correctly, the Q1-1 and Q1-2 are provided to give 12V AC and that is converted into 12V DC using rectifiers. But, why are we trying to do this ? Couldn't we just use 12V DC transformer 120V AC-DC adapter or 240AC-DC Adapter with output of 12V DC ?

Thanks and Regards


rlarios (author)  quicksilverm258 months ago
Hi quicksilverm25,

The AC Voltage input terminals are X1-1 and X1-2. You can omit all AC/DC conversion and voltage regulation circuitry and feed 12Vdc straight to the 12Vdc power rails if you want. That's up to you as a designer.

There's more than one way to skin a cat.

Thanks for your comments.

Thanks. I have now removed the following from the circuit

a) "Ground"

b) 7812 , 2 capacitors connected on either side of 7812 and ofcourse 1N4004s, X1-1 , X1-2.

In short, the connections from the "Ground" wire are all gone. The Ground wire also is gone. I think the "Ground" wire also was meant to be removed since the only external connection it is having is with X1-2, which is, removed.

After making all the connections, I did see motor starting up. For test purposes, I saved myself the relay and instead using DC Motor running on 9V instead. The green LED and Red Led unfortunately are both turning up and putting the other wires IN or OUT of the water is not making any difference.

I have looked at the connections and they seem to be proper. Not sure, what's going on wrong here.

rlarios (author)  quicksilverm258 months ago


Remember that the GND connection is the DC reference for all the components involved in the operation of the control. Your DC power supply's GND (or "-" terminal if you use a battery) should be connected to the control's GND for proper operation.

Looking into the schematic, X3-2 "Ground" should be connected to your DC power source's GND lead. The same applies to CD4001's pin 7, Q1's R5 resistor, LED2's R6 current limiting resistor, and Q3's emitter as well.

Transistors Q1 and Q2 are not essential to the operation of the control, they are there just to light the red LED whenever the pump's suction level is dangerously low. However, X3-1 is important to keep pump from running if so mentioned pump's suction level is low. If you want to operate the control without pump suction level protection, just short together X3-2 and X3-1.

Green LED, its current limiting resistor and reversed biased diode D5 are in parallel with K1 relay and are driven by transistor Q3.

Even though you are getting DC power straight into the circuit, it would be a good idea to include a 0.1uF to 1uF decoupling capacitor across CD4001's pins 14 and 7 to reduce transients

Hope this helps.

sun13lei10 months ago

sir, any idea on the water level alert used in big dams? Can you please suggest any circuit for sensing of water level alerts for big dams?

rlarios (author)  sun13lei10 months ago
Dear sun13lei,

I know nothing about water levels on big dams. However, due to the magnitude of dams and potential threat to life and property, there should be norms and regulations that dictate what kind of equipment should be used for infrastructure as such.

On the other hand, the circuit shown here is meant for water level control using two level and one common ground electrodes. Let's say, if you want to use the circuit shown in this instructable, you should also use the two electrodes to provide some hysteresis. The circuit shown turns on the pump whenever water level goes below "low" level and pump is turned off once level reaches "high" level.

In the case of your dam, -if you want to use same or similar circuit-. There should not be any alert for as long as water level is below a "safe" level, which could be our circuit's "low" level. When dam level reaches "low" level electrode, nothing should happen, it is until water level reaches the "high" level electrode that the "Alert" Light (or any other "Alert" device) should get turned on and stay on for as long as dam level does not go below the "low" level electrode, or our "safe" level. Both levels could be inches apart.

In order to do that with same circuit, you should cut the trace that goes from CD4001 pin 3 to pin 5. Then, solder a wire between CD4001 pin 11 and pin 5. This way, the circuit would turn on the Alert whenever "high" level electrode gets in contact with water and the Alert would stay on until water level goes below "low" or "Safe" level.

If you have something else in mind just let me know.

thetrims rlarios8 months ago

hi. I was trying to adapt the circuit to run a sump pump. When I saw your comments regarding the dam, I thought this was the solution. I made the alterations between pins outlined above, and now all that happens is the pump turns on when the ground and protection probes are submerged. Nothing happens when either the low or high level probes are sub merged. Any ideas???

Many thanks


rlarios (author)  thetrims8 months ago


Did you get the circuit to work the way it was intended originally? I will check the instructions I wrote in the comment above and see what could be wrong.

Better yet, I will modify one of my controllers -per the instructions above- and let you know what the problem could be and what to do to make it work the way you want. I will come back to you tonight.

rlarios (author)  rlarios8 months ago


I just modified one of my controllers making sure that no feedback lines were cut and the controller works the way you need it to. I guess I will write an additional step in this instructable along with pictures to show how to do just that.

Please, let me know whether you fixed yours.

thetrims rlarios8 months ago

hi. Just finished making the changes, and all works perfectly!! Thank you very much for your assistance. All I need to do now is wire in the 240v side from the pump into the enclosure and I will be all up and running. Thanks again for your help. Kind regards Murray

rlarios (author)  thetrims8 months ago

Murray, I haven't had the chance to modify one of my controllers yet, hopefully I'll get it done tonight as I said in my previous message. However, in checking the schematic along with the PCB layout, I realize where my mistake was in the instructions above. The trace that goes from pin 3 to pin 5 goes first to pin 12 before going to pin 5. If you cut the trace right off pin 3 then you break the feedback line that goes between pin 3 and 12. You only need to cut the trace between pin 5 and 12 and run a wire between pins 3 and 12 so the S-R latch operation gets back to normal. Once this is done, you only need to run a wire between pin 11 and pin 5 to make the controller work for a sump pump.

I'll do it tonight as I said, but for the time being, check whether the connection between pins 3 and 12 was broken by yourself when you modified the circuit so you can fix it.

thetrims rlarios8 months ago

hi. Yes mine worked as originally built. Yes I did cut the trace between pins 3 and 12, I had wondered about that. I hadn't appreciated the impact of that. I will do as you have suggested when I get home tomorrow night and let you know how I get on. Thanks for the replies. Murray

gerveruco1 year ago
The project is awesome!!
I am very interested in this project, but the only thing that i miss is the HEX file to load in the PIC. Could you say me what is the PIC that you used?
And how can i get the HEX file?
rlarios (author)  gerveruco9 months ago

I just inserted step 2 where it is shown how to wire a bigger pump (up to 2 HP) with this controller.

I had a little problem with the editor and I could not insert the links to the parts required properly. Please, copy and paste so you can see them.

Hope this helps. I will check the other steps for any possible shifted reference.
gerveruco rlarios9 months ago

I think that was my last doubt, I going to make it on this week and I say you how it works

Thanks again

rlarios (author)  gerveruco1 year ago

Thanks gerveruco,

This project does not rely on any type of micro controller. This project was built around a CMOS CD4001 quad 2 input-NOR gates IC.

When I read the message in my inbox I had thought you referred to my other instructable which was built around an ATMEL ATtiny micro controller whose source code is shown in one of the steps.

If you still have any question, just let me know.

gerveruco rlarios9 months ago

Hey man thanks for the answer. Just one more question, I have a 4 m3 cistern and 1100 L tank, the power of the water pump is 1/2 HP. Do you think the circuit works? Or do you think i have to change any of the components

rlarios (author)  gerveruco9 months ago

Gerveruco, what is your pump's voltage?

gerveruco rlarios9 months ago

The pump's voltage is 120 V.

rshamsi9 months ago


1-40 of 75Next »