Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me with building a water level sensor

Status
Not open for further replies.

Kaze105

Junior Member level 1
Joined
Aug 13, 2010
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,411
Hello,

I would possibly like some help of building a water-level sensor. I have considered some things such as a distance sensor, IR-emitter and detector, ultrasonic detector, but I would like some opinions regarding what option is best.

My project involves with a water bowl for animals such as dogs and cats. Since the bowl is small, it will require me to a sensor that can detect differences in a a few inches. I found the IR to be difficult as it will involve water and the distance for the IR is very short.

I require the sensor to indicate when the water in the bowl has gone down a certain level.

Thanks for any help.
 

Re: Water Level Sensor

By far the simplest method is to weigh it! Put the bowl on a mount with a spring underneath it. It could be expanding foam or even a plastic bladder as long as it has some movement caused by it's weight. Underneath it, fit a microswitch, set to operate when the bowl lifts because it is empty. Use the switch to operate an alarm or to trigger a method of automatically filling it again. No electronics needed !

Brian.
 

Re: Water Level Sensor

I actually considered something like that, but the project is requires it to be electrically done so I would appreciate more ideas.

Thanks for the help still.
 

Re: Water Level Sensor

**broken link removed**
or
**broken link removed**
This a good circuit for your purpose.
Two electrodes in the water...or one electrode and a metal water dish.
Use stainless steel wire electrodes.
Since the electrodes will be in the water most of the time, the main advantage over many of the other circuits you may Google is that it is that the electrode is driven with AC, rather than DC. This will prevent corrosion due to electrolysis.
The output of the circuit, past N2/pin2, will depend on what you want it happen when the water is low.

Ken[/url]
 

Re: Water Level Sensor

I have 3 questions regarding that circuit. (sorry if they are or sound dumb, fairly new to this.)

I see that you said it is driven with AC, but the circuit itself will not use AC voltage?

Also for the sensor, is any stainless steel electrode wire alright? I would like to confirm this as the circuit says probes.

My final question is regarding the relay. I would like the signal to go to my microcontroller, so should I just connect the normally open side to the microcontroller.

Thanks for the help.
 

Re: Water Level Sensor

Kaze105 said:
I have 3 questions regarding that circuit. (sorry if they are or sound dumb, fairly new to this.)

I see that you said it is driven with AC, but the circuit itself will not use AC voltage?
The circuit would run on a battery or DC wall wart. The IC on the left is an oscillator the generates an AC signal.

Also for the sensor, is any stainless steel electrode wire alright? I would like to confirm this as the circuit says probes.
I would guess that any SS wire would be OK.

My final question is regarding the relay. I would like the signal to go to my microcontroller, so should I just connect the normally open side to the microcontroller.
Yes, and with the relay's common contact to ground and a pull-up resistor on the uC's input, or the relay's common contact to +5v and a pull-down resistor on the uC's input. I'm not sure, but you might be able to run the whole circuit of off 5V rather than 12V. Then you could replace the relay with a resistor and drive the uC input directly.

Are you planning making the refill process automatic?

Ken
 

    Kaze105

    Points: 2
    Helpful Answer Positive Rating
Water Level Sensor

Yes. the signal from the sensor will go to the microcontroller, which controls a solenoid valve, allowing water to flow from the tank to the bowl.

When you say uC's input, may I ask what you mean. As for the voltage, I will try both voltage to see if it works.
 

Re: Water Level Sensor

Kaze105 said:
Yes. the signal from the sensor will go to the microcontroller, which controls a solenoid valve, allowing water to flow from the tank to the bowl.

So you would need a two-level sensor...Fill...and...Full

When you say uC's input, may I ask what you mean. As for the voltage, I will try both voltage to see if it works.
I'm assuming that you want the sensor to output a signal that will be a digital input to onr of th uC's I/O pins. This could be a switch closure and resistor, as with the relay contacts. Or, it could be a 0v-5V signal from the sensor's output transistor.

This is a link to a 2-level uController circuit that I made to automatically fill a Christmas tree stand. https://www.picaxeforum.co.uk/showpost.php?p=121399&postcount=11

Ken

Added after 37 seconds:

KMoffett said:
Kaze105 said:
Yes. the signal from the sensor will go to the microcontroller, which controls a solenoid valve, allowing water to flow from the tank to the bowl.

So you would need a two-level sensor...Fill...and...Full

When you say uC's input, may I ask what you mean. As for the voltage, I will try both voltage to see if it works.
I'm assuming that you want the sensor to output a signal that will be a digital input to one of the uC's I/O pins. This could be a switch closure and resistor, as with the relay contacts. Or, it could be a 0v-5V signal from sensor.

This is a link to a 2-level ucontroller circuit that i made to automatically fill a Christmas tree stand. https://www.picaxeforum.co.uk/showpost.php?p=121399&postcount=11

Ken
 

Water Level Sensor

Hmm cant view your 2-level uC circuit. Says that I dont have permission although I did register.

You are correct that I would like the sensor to output a signal into the uC I/O pin. I will be using a ATMEGA16 or ATMEGA32 uC. I probably will have it as a 0-5V signal from the sensor's output signal.
 

Re: Water Level Sensor

They're a little slow, and careful, in granting rights.

Here is the basic circuit. I had added a few bells and whistles on mine that you don't need.

P2 is a 4KHz, 50/50 PWM square wave output that drives the common electrode.
P4 is an 8-bit analog input that senses the FILL level.
P1 is an 8-bit analog input that senses the FULL level.
P0 is a digital output that turns an SSR (solid state relay) ON and OFF.

The program is pretty simple"
Sensing a FILL level turns ON the relay that turns on the pump.
The pump remains ON until the FULL level is sensed, and the pump is turned OFF.
The pump remains OFF until the FILL level is again sensed.

Ken
 

    Kaze105

    Points: 2
    Helpful Answer Positive Rating
Water Level Sensor

I would like to confirm a few things about your circuit. When I position the electrode wires, I position them where the water level should be increased, when the solenoid valve should closed due to full bowl, and the last one at the bottom of the bowl.

Checking the picaxeq8m, I see that it can be programmed a couple different way including flowchart and basic. Is either one better than the other?

Last question is about the SSR. What kind of SSR would be best. For example:

https://www.newark.com/jsp/search/browse.jsp?N=1002182

The relay will be connected to a solenoid valve that will operate at 12V DC.

Again, thanks you very much for the help, I appreciate it a lot.
 

Re: Water Level Sensor

Kaze105 said:
I would like to confirm a few things about your circuit. When I position the electrode wires, I position them where the water level should be increased, when the solenoid valve should closed due to full bowl, and the last one at the bottom of the bowl.
Yes. If the bowl were metal, the common (longest) electrode could be the bowl itself.

Checking the picaxeq8m, I see that it can be programmed a couple different way including flowchart and basic. Is either one better than the other?

I think BASIC would be better. It would lend itself to posting on a form if you need help.

Last question is about the SSR. What kind of SSR would be best. For example

https://www.newark.com/jsp/search/browse.jsp?N=1002182

The relay will be connected to a solenoid valve that will operate at 12V DC.

I probably should have changed the SSR to an NPN transistor for driving the solenoid valve. How much current does the solenoid draw at 12V?

Ken
 

Re: Water Level Sensor

The valve runs on 12V DC at 2W so it should be almost 0.13A.

If i replaced the SSR with a transistor, do you mean to change it to something like shown in the picture below where the load would be the solenoid valve and input to B is the output from R4 in your circuit?

As this project is on going, I still have lots of parts to buy, including the valve so this is just the spec from the place I am planning to buy it from.

**broken link removed**
 

Re: Water Level Sensor

Your circuit would work. Use a 2N3904 for the transistor. Change R4 to 330Ω. Add a 1N4148 diode across the solenoid...cathode to +5V and anode to the transistor's collector.

Ken
 

Water Level Sensor

I will try that, one thing I forgot to make sure about is again about the electrode wire.

Will it harm the animal that drinks the water or if the animal touches the wires?

Edit: I hate asking so many questions, but I hope this is my last one.

If I have to increase the current for the solenoid valve, like to 0.4A, what are the specific things that will have to change? Will I have to get a transistor with a larger collector's current as the 2N3904 current is 0.2A max.
 

Water Level Sensor

Most level switches use stainless steel rods, the same material that's used for water tanks. With AC only circuit, no heavy metal ions will be dissolved from the alloy.
Of course, the circuit should limit the electrode current to a save level.
 

Water Level Sensor

What FvM said!
The 2N3904 will not work at the higher current levels. Switch to a logic level MOSFET, like an IRL520 or equiv..
Replace the transistor with the MOSFET. Source to common and drain to the solenoid. Remove the base resistor. and connect the MOSFET's gate directly to the PICAXE output.

KEN
 

Re: Water Level Sensor

This is probably overkill, but perhaps you could use a differential pressure sensor, with one port open to ambient pressure and the other port connected to a tube that is submerged in the bowl. IIRC, 1mm of water equals about 9.8 Pa.

Something along the lines of this:

https://micromegacorp.com/downloads/documentation/AN034-Water Depth.pdf



**broken link removed**
 

Water Level Sensor

Forgive me, but I constantly wonder why everyone wants to use pics and controllers when they are not always necessary. Here is a simple circuit that fits the bill nicely. I would use a plastic bowl and drill two hole horizontally at my upper and lower limit, put in two SS screws with sealant and use a small fountain pump. If your class requirement is to actually program a part, then disregard this post. Use figure 2

**broken link removed**
 

Re: Water Level Sensor

juggernaut7,

PIC, logic, or discrete...One of the issues you seemed to have missed is that powering electrodes, submerged in water, with DC will cause corrosion from electrolysis, possibly putting heavy metal ions in the drinking water.

The design in EDN may work great for a sump pump where the electrodes are normally not continuously submerged and any metal ions would be of no consequence. Actually, by using the driver/detector circuitry from the links in my first post and the logic from the EDN article it would work fine.

But, the PICAXE design only uses one 8-pin chip. All the logic is in the program. To me microcontrollers are to logic chips, what logic and opamp chips are to discrete semiconductors. Just a why to make the design more compact.

It all depends on what you're comfortable with...or what new things you want to try. :)

Ken
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top