Hi Dave, Thanks a lot! You nailed it with the low supply voltage. I switched my power supply for a 7805 and things seem happy now. Actually, it was working on 3.3 V too, but I realized that my trigger circuit (output from my computer) was only putting out 2.1 V, which put it right at the sort-of-working threshold. The feedback is a good idea too, though, because the water might drain away slowly, which causes the voltage to drift down rather than chopping, which would give the problem you mentioned. This might be another reason to use AC as the other poster suggested. cheers, mike At 03:21 PM 6/14/2004, you wrote: >mike wrote... > > >I am trying to use a LM339 comparator to tell me when two probes are > shorted by water. I have one probe connected to Vs and the other going > into the +input of the comparator. The -input is connected to a pot > between the supply and gnd, which should let me set the threshold at > which it decides the probes are shorted. I have a 1M pulldown on the > input pin, and a 3.3K pullup resistor on the output. > > > >This seems to be working fine, but there is some sort of oscillation on > the output that is puzzling me... essentially, when the probes are open, > it sits at zero, but when they are shorted, it sits at about 3.1V with a > few mV of wiggle. I thought the pullup would eliminate this, but > apparently not. > > > >I've posted the schematic here: > >http://www.moosecraft.org/comparator.html > > > >Most comparator circuits will oscillate at high frequency when >their inputs are near the switching threshold. The usual >technique for killing these oscillations is to inject a small >amount of positive feedback into the circuit to establish some >hysteresis. > >Try inserting a 1K ohm resistor in between your 1 Meg resistor >and ground, and connect a 330K resistor between the 1K/1M >junction and the comparator's output. > >Also, you should check the specs on the LM339 comparator, to make >sure you're operating it within its rated supply voltage range. >I haven't used those in a long time so I may be wrong here, but >it seems to me they might not work on that low a supply voltage. > >Hope this helps... > >Dave D. > >-- >http://www.piclist.com hint: To leave the PICList >mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads