Newbie needing direction on low water level alarm circuit

A LM339 should be fine (at 0.8mA current draw) IMO. But if you really want a low-current comparator, how about a LMC7211A1 ?
I should have been more specific: Comparitor and reference that operates at around 3 Vols.

The power source still has to be looked at and whether it should be self contained. In a commercial kitchen the noise is likely to be higher than a home kitchen.
 

Thread Starter

danielj_2016

Joined Jun 24, 2016
85
So I'm trying to understand the purpose of a comparator like the LM339 and how it works. Can someone discombobulate my head for me?

My understanding is that the purpose of the comparator is to compare two analog input voltages and generate a digital output, 0 or 1. One of them can be a reference voltage and the other is an input voltage from whatever is being measured. In my case, the voltage would come from a stainless rod immersed in boiling water. So let's say the rod in water generates 400 mV, and when the water boils off from the rod, it generates 0 mV. So what trigger do we use to tell the comparator to sound the alarm? Do we make the reference 1000 mV and tell it to alarm only if there is at least 1000 mV difference between the two (and how do we do that)? Or, does the reference have to be set somewhere in between 0 mV and 400 mV so that there is a change in sign of the signal when it crosses over to 0 mV?

I read that the LM339 is like an opamp, only it outputs only a 0 or 1 and is quicker and "cleaner." Is that a fair comment?
 
note I suggested some varient of the LT6700 which also contains a reference. The LM339 does not include a reference.

An OP amp basically takes (A-B) and multiples it by a big number called the open loop gain. A is the non inverting input and B is the inverting input. The comparitor does not have an output that varies. It usually has what's called and open collector or open drain output or effectively a switch to ground.

Thus in order to light a LED, you would out a +V to the LED and a resistor to the output of the comparitor which would either be an open circuit or ground.

Comparitors may not like "slow signals", so depending on the comparitor some hysteresis can be added externally or internally.

The comparitor's input and generally for an OP amp too, has to be driver by a low Z source. The LT6700 does not need this.
The varients -1, -2 and -3 are like window (<x, >y) and the others do two < or two >.

If you look at the micropower battery monitor in the datasheet. http://www.farnell.com/datasheets/84256.pdf There is a High Z voltage divider that set's those thresholds of 1.6 v and 2V,

the output is given a "pull-up" resistor, so it would have "logic" levels of 1 and 0. Confusion will exist as to whether one needs an output that's active high or active low and the choice or wiring will change accordingly.

If you actually needed < than this value and greater that that value then you would need logic to do so. If you want <400 mV, then it's easy. if you want <100 mV, then it's a little harder.

With CMOS parts, it's not polite to leave the inputs open.

This http://cds.linear.com/docs/en/datasheet/1998fb.pdf is a comparitor optimized for low battery detection AND it doesn't follow the rules above.
 
Last edited:

Alec_t

Joined Sep 17, 2013
14,335
Or, does the reference have to be set somewhere in between 0 mV and 400 mV so that there is a change in sign of the signal when it crosses over to 0 mV?
Yup. That's the way. For your application the reference could be, say, 200mV; but it isn't critical, so could be derived using a simple potential divider (2 resistors) from the circuit supply.
Incidentally, if you use a stainless steel rod then you won't be able to use it in a stainless steel cooking pot.
 
her's a file to play with. System doesn't let you know what file types it lies and it seems to not like xls or XLS, so kill the txt extensio after you download.
.
This is what the (non-working) sheet looks like. The three resistances are in bold. The total resistance Rt is calculated.
It (I total) is calculated from I=V / It. The voltage drop across the individual resistors are calculated. The potentials are added,
so, you have points above ground for any given input voltage. There's some hysteresis, so for 2 V input, it may not switch until 2.03 V.

The divider/comparitor operates on the 0.400 V threshold.


resistances voltage drop above gnd

................................ >0.400
1.00E+006 1.28 1.7
6.34E+004 .08 0.4164 TRUE >1.6 V
2.61E+005 .335 0.3350 FALSE > 2 V


Rt 1.32E+006

V 1.7 vary from <1.6 to >2 V
It= 1.28360012080942E-006


resistances are the resistances of the divider.
Rt is the total resistance
It is the total current in Amps
V is the varied battery voltage
Voltage drop is the drop across that resistor
Above ground is the increnmental thresholds

>0.400

1.00E+006 1.28 1.7

6.34E+004 .08 0.4164 TRUE >1.6 V

2.61E+005 .335 0.3350 FALSE > 2 V

Rt 1.32E+006

V 1.7 vary from <1.6 to >2 V

It= 1.28360012080942E-006

resistances are the resistances of the divider.

Rt is the total resistance

It is the total current in Amps

V is the varied battery voltage

Voltage drop is the drop across that resistor

Above ground is the increnmental thresholds
 

Attachments

Last edited by a moderator:

Thread Starter

danielj_2016

Joined Jun 24, 2016
85
her's a file to play with. System doesn't let you know what file types it lies and it seems to not like xls or XLS, so kill the txt extensio after you download.
....
I'm assuming this calculation has something to do with sizing resistors for use with a comparator with a 0.4V threshold. Other than that I'm totally lost on this. :eek:) I'm also not very confident that 0.4 V is the correct number, and that that number might vary from situation to situation.
 

Thread Starter

danielj_2016

Joined Jun 24, 2016
85
Yup. That's the way. For your application the reference could be, say, 200mV; but it isn't critical, so could be derived using a simple potential divider (2 resistors) from the circuit supply.
Incidentally, if you use a stainless steel rod then you won't be able to use it in a stainless steel cooking pot.
The vast majority of commercial cooking is done in aluminum pots, so I think I'm OK on that.

Let's say the voltage generated by the rod in water varies anywhere between 0.3V and 1.2V (just for instance). We know that we want the alarm to sound only if the voltage goes to 0 V. Is it possible to design a circuit that can handle this situation, or does the circuit need to start with a specific assumed voltage like 0.4 V or 0.6 V so that the proper resistors and other components can be selected? Would something like a CMOS be required so that some logic could be programmed in?
 
The 400 mV threshold is specific to the LT6700 IC. The idea is that only voltage from 400 mV up to the max imput of the comparitor is game for comparison. If you wanted a 12 V threshold, you would divide 12 to 400 mV. For a voltages less than 400 mV, you would have to amplify.

Three resistors as in the application notes, gives you 4 thresholds: 0, x, y, and Vcc, Only x and y matter.

Zero is a bad number in your case. If you can use 400 mV go for it. No dividing necessary.

If you needed 200 mV, then you would need to multiply by 2 with an extra OP-amp.
 
Let's say the voltage generated by the rod in water varies anywhere between 0.3V and 1.2V (just for instance).
There are issues with some electronics where the input voltage cannot exceed the the power supply voltage by a small amount like 0.3 V unless the voltage is current limited. So, when the battery is out, the supply is 0V. In some cases you have to protect against that.

We know that we want the alarm to sound only if the voltage goes to 0 V. Is it possible to design a circuit that can handle this situation, or does the circuit need to start with a specific assumed voltage like 0.4 V or 0.6 V so that the proper resistors and other components can be selected?
In your case, zero is a bad number. With OP-amp offsets and a single supply a true zero output can't happen. Zero in a lot of cases is unattainable. You can compare against zero, but it would not get you anywhere. The OP amp offsets could easily be a in the mV range.

if you look here: http://www.analog.com/en/products/linear-products/voltage-references.html , references are in the 1.2 to 10 Volt range, not 400 mV.

So, if you want say <100 mV, amplify x4 before comparing. <50 mV multiply x8.

The LM10 http://www.ti.com/lit/ds/symlink/lm10.pdf is a very old part. It combines an OP amp and a 200 mV reference in the same chip. Current consumption is in the area of 250 uA.[/quote]

Would something like a CMOS be required so that some logic could be programmed in?
CMOS is basically a construction technology. True CMOS digital logic essentially just uses power when switching.

There has been a lot of work on single supply low voltage Op-amps because that's where the low current consumption comes from.

TTL 5V logic used to dominate. Now 3.3 is. 1.8 V is catching up and I think there is some 0.8 V stuff around.
 

wayneh

Joined Sep 9, 2010
17,498
The vast majority of commercial cooking is done in aluminum pots, so I think I'm OK on that.
Perhaps, but are you familiar with Murphy's law? If you make a gizmo that won't work with a stainless steel pot, guess what the first user will do with it?
Let's say the voltage generated by the rod in water varies anywhere between 0.3V and 1.2V (just for instance). We know that we want the alarm to sound only if the voltage goes to 0 V. Is it possible to design a circuit that can handle this situation, or does the circuit need to start with a specific assumed voltage like 0.4 V or 0.6 V so that the proper resistors and other components can be selected?
The circuit merely needs to react (the comparator needs to trigger) whenever the voltage drops below the lowest voltage your probe will produce while immersed in liquid. You want the one value that minimizes false positives (reporting that boiling is complete when it is not yet) and false negatives (fails to report boiling is done). This magical value is still somewhat unknown. It might be 50-200mV for instance. Your prototype devices should include a pot for adjusting the value. Once you've found the value of the reference voltage you are comfortable with, you can use fixed resistors to produce it for the comparator.

The magic value will NOT be 0mV. You would have a problem if it was. With the LM339, it's not a good idea to use ground (0mV) as a reference. I've gotten away with as little as +5mV, but you will get unpredictable results below that. If you want to use 10mV, you'll be fine. But I suspect you'll want a higher value. A few droplets of liquid or a film on the probe, after it is out of the bulk liquid, may be able to produce some voltage and you don't want the circuit failing to alarm under those circumstances.

If the lowest voltage you've seen for an immersed probe is 300mV, you could try using a reference voltage as high as 290mV. Over time you might find this is too touchy, and you need to drop the reference voltage to make it less touchy.
 

Thread Starter

danielj_2016

Joined Jun 24, 2016
85
Thanks for the feedback. I'm very interested in taking this project to completion, but work has pulled me away for a little while. I'll post back asap.
 

Thread Starter

danielj_2016

Joined Jun 24, 2016
85
OK, I'm back! I've been reading these posts and looking up the LT6700, LM10 and LM339. It's a little funny because I'm like a fish out of water reading this stuff. I have to keep googling the difference between an opamp and a comparator. I did find one website more my speed: Mr. electron walks down wire A and knocks on the door of Mr. Opamp. Well, OK it's not quite that bad. Anyway...

So I'm beginning to understand that if the water runs dry and my probe generates 0 or near 0 mV, the comparator cannot wait until it gets a near 0 mV signal because it needs some kind of value other than 0 to work with. Also, such a low threshold invites a false negative (water has run dry but alarm does not sound). The only value I have found so far is about 400 mV based on one test. I think I might have to buy some stainless probes that could be useable, and then try them with several pans and different liquids. I expect all tests to have some value at least in the several hundred mV range, but I guess the test will tell. I very much like wayneh's idea of using a potentiometer in order to change the threshold value to trigger the alarm.

Big picture-wise, if I want anybody to be able to use this alarm, say a guy in New Orleans reducing some gumbo broth, I would hope that his mV will be not too far from mine. wayneh mentioned that the probe could generate greater than 0 mV with a film on it. I found in my test that as soon as the probe exited the water, the reading hit 0 mV like a rock. I guess you are saying that a film on the probe might generate a "phantom" signal somehow? If the circuit is completed by water, and the water is replaced by 2 inches of air (between the probe and the side of the pan) can a film on the probe really generate voltage (I can understand some bubbles maybe doing it)? I'm trying to make a case for saying that we can go very low with the trigger threshold and not worry about all the possible voltages. Make the trigger something like 25 mV and be done with it, for instance.

I guess my next step will be to purchase a couple of stainless probes rather than using what I have, which is an unused stainless pilot burner tube. Then I'll measure mV with several sauce pans and see what happens. Oh, and does the final trigger point help determine which type of comparator we need (LM10, LM339, etc.)? Final curiosity for me: When I did the 400 mV test, it looked like it didn't matter how much of the probe was immersed -- 6 inches or 1/4 inch, the voltage was the same. This makes things easier, but does it make sense? Is it because there is very little current flow through the voltage tester while I was doing the measurement?
 

wayneh

Joined Sep 9, 2010
17,498
Don't worry about my random speculation. Just realize that the answer will be revealed by data. You're circuit can use whatever the data show to be the best cutoff.

The cutoff value shouldn't matter in choosing the comparator, although I'm saying that without reading the data sheets to confirm it. My understanding that just about any IC called a comparator will be able to sense near 0V. So yeah, you could probably choose 25mV right now and move on. But nature is a bitch and likes to humble us when we take her behavior for granted.

You're speculation is correct about the probe.
 
I'm trying to make a case for saying that we can go very low with the trigger threshold and not worry about all the possible voltages. Make the trigger something like 25 mV and be done with it, for instance.
With a single supply, you limited to how low you can go based on the OP amp, reference and comparator you choose, but IF you amplify, you can lower it.
 

Alec_t

Joined Sep 17, 2013
14,335
If it were me I'd get some stainless steel rod for the probe (only 1 needed, since the pan is the second electrode), do the tests you propose with different pans, and use half of the minimum probe voltage measured as the reference for the comparator.
Your comparator spec should include the feature "Input Common-Mode Voltage Range Includes GND". The specs of most common comparators (including the LM339) do.
 
External Input for Comparator Section A. The voltage on this pin can range from – 0.3V to 18V (36V for
LT6700HV) with respect to GND regardless of VS used.
The above spec is unusual and part of the "Over the top" designs of Linear Technology. The voltage that your electrodes generate is probably current limited anyway. If an input (lets say you were testing with a voltage source) in most OP-amp designs, you would have to current limit an input to protect the OP-amp when the voltage is applied to an input with the battery out or dead.

Most other comparators require a "buffered" input. The LT6700 MAY not. You still will have to lower the effective input Z to that of your meter (Usually 10 M ohms), so Ib has a place to go.

As i said earlier, A buffer with gain will allow you to lower the threshold below 400 mV. e.g. x2 Gain = threshold of 200 mV.
 

Thread Starter

danielj_2016

Joined Jun 24, 2016
85
I have some preliminary results if anybody cares to comment:

I ordered several lengths of both 304 and 316 stainless solid rod. I got 12" and 24" lengths in both 1/8" and 3/16" diameters. The 304 is most commonly used but 316 is a little better on corrosion. I'm going to soak both in a vinegar solution and see what happens.

I used a couple different aluminum pots, with different thickness rims. One thing that was consistent is that in every case the mv reading would continue to rise slowly for a couple of minutes. For instance, I'd put the probe in the water and get a reading of say 650 mV, but then over the next several minutes it would climb to 850 mV before leveling out. What would cause that? I thought it was due to the rod warming up or the water continuing to heat, but I think it has more to do with just taking time for the current to build up and line out in the water.

Typical mV readings for all pots with all probes fall in the range of 700 to 1200 mV, with 900 to 1000 most typical. mV was higher with hot and boiling water.

Having said that, the lowest mV found was in a thin walled aluminum pot and cold water. The probe started at about 150 mV but climbed pretty quickly to about 350 mV. Cold water in larger pots was in the 400 or 500 mV range. I also dipped the probe in both cold and hot gravy, and also boiling potatoes in thin walled aluminum pots. I got readings that started around 300 mV and jumped around to over 500 mV. The long rod only gave me readings starting at 150 mV in the potatoes, climbing into the 200's, but on retrial a few times it did get up over 400 mV.

I found that when the probe is put into the boiling frothy part of the water, the signal did bounce around. Some kind of signal filter or whatever you call it will probably be needed, as discussed previously.

I tried using a stainless steel pot and got a reading of about 350 mV, but the polarity was reversed.

I broke the cheapo probe on the multimeter I just bought, but my backup meter gave the same readings.

I made some temperature readings outside and above the pot in looking for a way to protect a battery from heat. but I'll post that separately.

That's about it for now. It seems like I could make do with a 200 mV trip point, but if it is all the same I'd say 50 or 100 mV would be better (also filtering out more froth noise).
 
Last edited:

wayneh

Joined Sep 9, 2010
17,498
Sounds like you're well on the way.

I'm perplexed by the negative reading with a stainless steel pot. I'm no electrochemist and maybe they would see the cause immediately. I don't. Do you think an aluminum-pot-only solution is OK, for now at least?
 

Alec_t

Joined Sep 17, 2013
14,335
I'd say 50 or 100 mV would be better (also filtering out more froth noise).
Seems a reasonable range (certainly no higher than 100mV). Simple RC smoothing should suffice for the filtering.
I'm surprised you got as high as 350mV from a stainless probe in a stainless pot, even allowing for them being different alloys.
 
Top