Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

water level project

Status
Not open for further replies.

indianhits

New Member
Hello, i am currently doing a small project on water level indicator and i need a small help

**broken link removed**

Now when the pin of uC is HIGH we get a 5V and 200mA right?
what is the minimum voltage required to short the wires in water?is 5V enough?
and do i need to put a resistance in P1 since it will be shorted with P2?

Please help me.Thanks!
 
Last edited:
You can do this with only one pin (but reverse logic will apply) - basically, one wire goes from the container (with water) to the pin (let's call it P1). The other wire from the container goes to ground (on the microcontroller, which should also be connected to ground on the power supply). Now, here comes the tricky part (which will vary from microcontroller to microcontroller): You need to hook up a pull-up resistor from the pin (P1) to 5V (TTL logic HIGH); the size of the resistor can vary; 10K would be ok to start with. See here:



Now - here's the thing; some microcontrollers have internal pull-up resistors; if so, you can either activate them (in which case, no external resistor as described above is needed), or you can use an external pull up resistor (and not activate the ones internal to the microcontroller). You'll have to do some research on this.

But basically, when you have it hooked up as I have described, when the water isn't touching the contacts, the pin (P1) will be "pulled up" to HIGH, and when the water touches them, it will be pulled down to LOW. You could also reverse this logic if you wanted (putting a pull-down resistor on the pin, and running the other line to 5V instead of ground); either way should work, its just that you generally see lines held HIGH with a pull-up then pulled LOW to ground when contact is made, likely because most microcontrollers incorporate internal pull-up resistors, rather than pull-down resistors - which ultimately lower part counts (and costs - thus increased profits).

Finally - your water better not be distilled or otherwise very pure water, because such a detector is very unlikely to work; the water has to have some impurities in order for it to be able to conduct the electricity.

Good luck, and I hope this helps and makes sense!

:)
 
As drawn your circuit won't work for a number of reasons. You cannot just take the uC inputs and place them in water.

First, note what cr0sh mentions:

Finally - your water better not be distilled or otherwise very pure water, because such a detector is very unlikely to work; the water has to have some impurities in order for it to be able to conduct the electricity.

However, it goes well beyond that. If you have an ohmeter fill a cup with water and place the probes in the cup spaced about an inch or 39mm apart. Here in Cleveland, Ohio US I get a resistance in excess of 100 K Ohms which is far from a short. Matter of fact at 5 volts the current would be about 50 uA. Your uC will be clueless that anything has changed.

To make this work with a uC you will need a circuit before the uC to condition your signal(s) from the water. I would suggest a variation of the attached drawing. However, a circuit variation designed to run on 5 Volts. Incidentally the chip in the circuit is a CD4011 quad nand gate. The relay and diode would be replaced with a 2.2 K resistor or maybe a 10 K resistor and the transistor can be any general purpose switching transistor like a 2N3904 or 2N222 type. The signal off the collector would go to your uC giving you nice 5 volt logic.

Unimportant but a matter of trivia, when we measure water we don't generally measure resistance but conductivity. Resistance as measured in units of Ohms and conductance measured in units of Mhos (Ohms spelled backwards) :) . Mhos being the reciprocal of Ohms.

Ron

Ron
 

Attachments

  • Water Level Detector.gif
    Water Level Detector.gif
    21.8 KB · Views: 998
**broken link removed**

You mean like this

i am using ATMEL AT89S52.so the function will be

1)when liquid level is not upto the level then the PIN P1 will be high
2)when liquid level is in the desired level then PIN P1 will be low

so here i would have to check till the PIN value is LOW and then use LED or Buzzer.Right?

Thanks!
 
Last edited:
As drawn your circuit won't work for a number of reasons. You cannot just take the uC inputs and place them in water.

First, note what cr0sh mentions:



However, it goes well beyond that. If you have an ohmeter fill a cup with water and place the probes in the cup spaced about an inch or 39mm apart. Here in Cleveland, Ohio US I get a resistance in excess of 100 K Ohms which is far from a short. Matter of fact at 5 volts the current would be about 50 uA. Your uC will be clueless that anything has changed.

To make this work with a uC you will need a circuit before the uC to condition your signal(s) from the water. I would suggest a variation of the attached drawing. However, a circuit variation designed to run on 5 Volts. Incidentally the chip in the circuit is a CD4011 quad nand gate. The relay and diode would be replaced with a 2.2 K resistor or maybe a 10 K resistor and the transistor can be any general purpose switching transistor like a 2N3904 or 2N222 type. The signal off the collector would go to your uC giving you nice 5 volt logic.

Unimportant but a matter of trivia, when we measure water we don't generally measure resistance but conductivity. Resistance as measured in units of Ohms and conductance measured in units of Mhos (Ohms spelled backwards) :) . Mhos being the reciprocal of Ohms.

Ron

Ron

ok i will redraw what i did and reply back
 
As drawn your circuit won't work for a number of reasons. You cannot just take the uC inputs and place them in water.

First, note what cr0sh mentions:



However, it goes well beyond that. If you have an ohmeter fill a cup with water and place the probes in the cup spaced about an inch or 39mm apart. Here in Cleveland, Ohio US I get a resistance in excess of 100 K Ohms which is far from a short. Matter of fact at 5 volts the current would be about 50 uA. Your uC will be clueless that anything has changed.

To make this work with a uC you will need a circuit before the uC to condition your signal(s) from the water. I would suggest a variation of the attached drawing. However, a circuit variation designed to run on 5 Volts. Incidentally the chip in the circuit is a CD4011 quad nand gate. The relay and diode would be replaced with a 2.2 K resistor or maybe a 10 K resistor and the transistor can be any general purpose switching transistor like a 2N3904 or 2N222 type. The signal off the collector would go to your uC giving you nice 5 volt logic.

Unimportant but a matter of trivia, when we measure water we don't generally measure resistance but conductivity. Resistance as measured in units of Ohms and conductance measured in units of Mhos (Ohms spelled backwards) :) . Mhos being the reciprocal of Ohms.

Ron

Ron

So you saying that the ckt above doesn't work right.but what if we could atleast utilize that 50uA and use a BJT transistor as a switch and use a relay to send 5V to the uC PIN

Now will that work???

and i think using NAND gates is beyond my ability as we haven't started using logic gates till now in our semester.
 
Last edited:
What I am saying is that if you look at your last drawing posted you have +5 volts with a 10 K Ohm pull up resistor going to common (ground) through your probes.

That will not work. The reason it will not work is the 10 K resistor and the water (as measured across the probes) will form a voltage divider. Remember, the water is not a short as you want to make it be. The water has resistance. The resistance depends on a bunch of variables but keeping it simple earlier today, as I mentioned, I measured water. I suggested you do the same. I placed two probes in a cup of tap water and read well over 100 K at the distance I mentioned earlier. Let's say 100K Ohm.

OK, so what do we have? Let's say we have 100 K plus your 10 K pull up between ground and 5 volts. That gives us 100K + 10K = 110K Ohms. The voltage is 5 volts. Therefore 5 / 110,000 = 45.45 uA for current. Therefore 10,000 x 45.45 micro-amps = .45 volts. When no water your voltage to the uC is 5 volts, with water you have 4.5 volts. Not much change is there? That is why it will not work.

What is important here is that you understand what is going on.

Next enter more problems. Let's say you use copper electrodes. You will have a negative and positive charged electrode in the water. Your positive electrode will begin to get corroded as the minerals in the water will migrate from negative to positive so you will be constantly cleaning the electrode depending on the water and how pure it is.

I suggested you use an ohm meter and measure the resistance of water, did you try it? If you don't have a Volt Ohm Meter I suggest you get one before you pursue this project.

Another option would be the PIC circuit linked to in another post.

Yes, using a transistor may work out for you. Try it and learn.

Ron
 
What I am saying is that if you look at your last drawing posted you have +5 volts with a 10 K Ohm pull up resistor going to common (ground) through your probes.

That will not work. The reason it will not work is the 10 K resistor and the water (as measured across the probes) will form a voltage divider. Remember, the water is not a short as you want to make it be. The water has resistance. The resistance depends on a bunch of variables but keeping it simple earlier today, as I mentioned, I measured water. I suggested you do the same. I placed two probes in a cup of tap water and read well over 100 K at the distance I mentioned earlier. Let's say 100K Ohm.

OK, so what do we have? Let's say we have 100 K plus your 10 K pull up between ground and 5 volts. That gives us 100K + 10K = 110K Ohms. The voltage is 5 volts. Therefore 5 / 110,000 = 45.45 uA for current. Therefore 10,000 x 45.45 micro-amps = .45 volts. When no water your voltage to the uC is 5 volts, with water you have 4.5 volts. Not much change is there? That is why it will not work.

What is important here is that you understand what is going on.

Next enter more problems. Let's say you use copper electrodes. You will have a negative and positive charged electrode in the water. Your positive electrode will begin to get corroded as the minerals in the water will migrate from negative to positive so you will be constantly cleaning the electrode depending on the water and how pure it is.

I suggested you use an ohm meter and measure the resistance of water, did you try it? If you don't have a Volt Ohm Meter I suggest you get one before you pursue this project.

Another option would be the PIC circuit linked to in another post.

Yes, using a transistor may work out for you. Try it and learn.

Ron

WOW it never came in my mind about the voltage divider network.now i get it!!! and i will try

OMG how do you guys think these!
 
somebody knows how to interface ADC to PC??? using RS 232 or DB9 serial ports??? or can anyone give me a circuit of water level monitoring system with VB.net interfaced program??? pls. help me..
 
Do you want to know full or empty, or do you want to know the actual level in the tank expressed in some units? What exactly do you want to know with respect to the tank? If for example you want tank level in units you will need an external hardware analog input device and a means to read it. If you just want full or empty it becomes easier.

Ron
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top