# Water Level Comparator

Discussion in 'Homework Help' started by ac_dc_1, Jan 30, 2013.

1. ### ac_dc_1 Thread Starter Member

Jan 27, 2013
74
0
I have the folowing problem:

Consider a circuit that is able to produce a luminosity signal to warn about one of the following events: 1)water level above 90 cm 2)water level below 30 cm
Consider that you have a level sensor with signal conditioning that outputs a voltage proportional to: V(L)=1 + 10L (L-Level in metres)

The circuit has to be feed with 12V and -12 V.Describe the levels of tension and current so that the circuit will work correctly.

Is this the way to solve this.Obviously this equation has no solution but my error is a mathemical one or this kind of problems are not solved this way?

Thanks

Last edited: Feb 6, 2013
2. ### WBahn Moderator

Mar 31, 2012
23,556
7,208
I think you first need to be sure that you understand the problem. As I read what you have written, the light should go on if the level is above 90cm or if the level is below 10cm. The light doesn't tell you which condition exists, only that when it is lit the water level is not between 10cm and 90cm. Is that correct?

If so, how will using a comparator with hysteresis accomplish your goal?

Sketch what you want the output of your comparator circuit to be as a function of water level. Then annote that sketch with the corresponding voltage levels at the key points.

3. ### Georacer Moderator

Nov 25, 2009
5,154
1,280
Complementing what WBahn said, remember that one comparator circuit, even with hysteresis, can tell you if your input signal is greater or less than your reference signal. Even if your reference signal varies, the direction principle (greater or less) still applies.

In your case one hysteretic comparator could tell you if your water level reached a value that is greater than 90cm or lower than 30cm. No other options exist.

Since in your problem you specified three distinct water levels, only one comparator can't cut it.

4. ### ac_dc_1 Thread Starter Member

Jan 27, 2013
74
0
My problem does not specify three distinct water levels.I only need to know if the level is above 90cm or below 30cm nothing more..
If the water level is above 90 cm the litght goes on(one transition point) if the water level is below 30cm the ligth goes on(another transition point).So with a hysteris comparator i can get those two points in order to get +vcc or -vcc in the output and then trigger the ligth with those tensions,so i do not understand why i can not use a hystersis comparator..

5. ### Georacer Moderator

Nov 25, 2009
5,154
1,280
Do what WBahn asked you to. Plot the hysteresis loop of your desired comparator. In the x-axis put your water-level sensor voltage. On the y-axis put the comparator output. Compare this to a typical hysteretic comparator loop, pictured below:

The points Voh, Vol, Vcl, Vch can be placed at will.

6. ### ac_dc_1 Thread Starter Member

Jan 27, 2013
74
0
I have Vcl=30 cm Vch=90 cm and Vol =4 V aND Voh=9V.It seems correct to me...If the level goes below 30 Cm Vo=+VCC and i can trigger a ligth with that voltage.If the level above 90 cm V0=-VCC.

I think that what you are saying is that the light would always stay on if 30 cm<=level<=90 cm..But that depends on driver and contacts i use to trigger the ligth circuit....It can be normaly open or normaly closed.Doesn't that make a difference?

Thanks

7. ### Georacer Moderator

Nov 25, 2009
5,154
1,280
Two misconceptions there:

1. Based on your problem description, you need +Vcc on the output both when Vin<30cm and Vin>90cm. You see that this isn't a standard hysteretic comparator behaviour.

2. The output of the comparator, whose loop is pictured above, when Vcl<Vin<Vch is defined by the previous state.
If Vin>Vch and then Vin>Vcl, then Vout=Vol during all of that time.
If Vin<Vcl and then Vin<Vch, then Vout=Voh during all of that time.
These are the only conditions that define Vout when Vcl<Vin<Vch.

Is that clear?

8. ### WBahn Moderator

Mar 31, 2012
23,556
7,208
Will you PLEASE sketch what we have been asking you to sketch?!

Let's say that the water level drops below 30cm and Vo goes to +VCC and you "trigger the light circuit" - whatever that means. When does the light go off?

9. ### ac_dc_1 Thread Starter Member

Jan 27, 2013
74
0
It does not go off.Thats the problem.I thought that what defined the outout(Vo) of a hysteris comparator where the values Vol and Voh,which are defined by relationship between the resistors.So it would go off when the input tension coming from the sensor would be >= than 3V....

10. ### Georacer Moderator

Nov 25, 2009
5,154
1,280
You are right in expecting to select Vol and Voh. You are wrong in the way you think the output of the comparator will behave.

We can't help you if you don't want to be helped. Sketch your desired output function vs Vin and then we 'll be able to help you. You can use whatever means you have available: photoshop, paint or even a hand sketch.

11. ### WBahn Moderator

Mar 31, 2012
23,556
7,208
And that's what we've been trying to get you to see.

If you would just draw the sketch we have been asking you to draw repeatedly you would see why.

No. Draw the sketch of the output of a comparator with hysteresis as a function of the input voltage and you will see why.

Why do you refuse to do the simplest thing? It's like you don't really want any help, you want to just keep insisting that your solution, that you already know doesn't work, should work.

12. ### ac_dc_1 Thread Starter Member

Jan 27, 2013
74
0
The sketch is exactly the image that Georacer posted with Vcl=30 cm Vch=90 cm and Vol =4 V aND Voh=9V.So from there we conclude that the light would be always on,so we can not use this kind of comparators.The question now is,what can i use for doing this?It has to be some kind of comparator i guess....

13. ### Georacer Moderator

Nov 25, 2009
5,154
1,280
If your sketch is exactly like a hysteresis loop, then it does not fulfill the problem specifications.
Indeed, that image displays Vout=HIGH when Vin<30cm and Vout=LOW when Vin>90cm,
while you want Vout=HIGH when Vin<30cm and Vout=HIGH when Vin>90cm.

Are you starting to see why a single comparator isn't enough now?

Try to look for a circuit that incorporates two simple comparators (without hysteresis).

14. ### WBahn Moderator

Mar 31, 2012
23,556
7,208
How do you conclude that the light will always be on?

Whatever. Fine. Let's move on. You now know that a comparator with hysteresis is not what you are looking for. You are now asking what kind of comparator will do what you want. Is it NOT reasonable to know what you want the comparator to do before you start asking for the type of comparator that will do it?

Here's an idea: Sketch what you want the output of your comparator circuit to be as a function of water level. Then annote that sketch with the corresponding voltage levels at the key points.

Sound familiar? It's from Post #2. It's the sketch that we have been trying to get you to post from the beginning. It's the sketch that you keep not bothering to do. It's the sketch that will make it clear what you are trying to do. It's the sketch that will show what you need your circuit to do. It is NOT the sketch that Georacer posted.

15. ### ac_dc_1 Thread Starter Member

Jan 27, 2013
74
0

Then conect the outputs to two buffers that will link to the power driver circuit

Last edited: Feb 1, 2013
16. ### WBahn Moderator

Mar 31, 2012
23,556
7,208
How are you going to "connect the outputs to two buffers that will link to the power driver circuit"

You seem to be, again, jumping at the conclusion that you can connect your outputs to some unspecified and undefined "power driver circuit" that will just automatically do what you want based on what you give it. Yet you won't even clearly specify what you are going to give it, let alone define what that unspecified "power driver circuit" is going to do or how it is going to accomplish it.

Why do you steadfastly refuse to produce the most basic sketch we have been asking for?

I'm done trying to help you until you take the five minutes to do that simple task.

thatoneguy and Georacer like this.
17. ### ac_dc_1 Thread Starter Member

Jan 27, 2013
74
0
What about a window comparator?Would it be a solution for this?

File size:
114.9 KB
Views:
31
18. ### WBahn Moderator

Mar 31, 2012
23,556
7,208
Tell you what, provide a sketch of what you need the output of your comparator circuit to be and we can then start discussing whether a window comparator might be a viable solution for doing it.

19. ### ac_dc_1 Thread Starter Member

Jan 27, 2013
74
0
Where it is the so desired sketch.Vout is represented in red.That curved line represents the water level.So now about window comparators?How do they work?I have never learned about this type of comparators but it seemed suitable to my problem..

• ###### sketch of Vout=f(Level).pdf
File size:
133.3 KB
Views:
28
Last edited: Feb 1, 2013
20. ### Georacer Moderator

Nov 25, 2009
5,154
1,280
Thank you. Was that so hard?
To be strict, this wasn't exactly what we asked you. Also, the blue line at some point is both below 30cm and 90cm which doesn't make much sense but we get your point.
The transfer function we wanted you to plot, was the following:

See how different this transfer function is compared to the one from the hysteretic comparator?

I 'd like to make sure you understand why a comparator with hysteresis wouldn't be suitable for your problem. If you don't please ask for clarification.