08m/ WaterDetection circuit problem

w7ky

New Member
I need some assistance solving a problem with the Water Detector circuit on page 126 of the PicAxe Microcontroller Manual by D Lincoln. I've been working along on the examples quite nicely and had this circuit working two weeks ago. Now I can't get it working again and I don't see what has gone astray. I've tried three new transistors and three new 08m's. The terminal shows Pin3=1 when the probe is dry, but no response when the probe is wet. With the probe wet, the program seems to halt after checking pin3. There's 5.02v on the collector dry, and 38mv wet. I've also reloaded the editor and tried both the original and enhanced mode. . Everything looks like it did when working, but I can't find the problem. Images of my code and circuit are here: http://ferrycreek.com/PicAxe/PicAxe1.jpg & http://ferrycreek.com/PicAxe/PicAxe2.jpg

I have a promonition this may reveal my specific density, but after three days of fiddling I'm ready to accept the exposeure.

Thanks, Doug
 

erdc

Member
What I have always done was stick a +5V at the bottom of the water container. Then have wires connected at different levels that are in turn tied to several different ADC. Each one of these ADC inputs checks to see if there is (or is not) a value greater (or less) than 155.

If it has more than a value of 155, then you now that connector is under water, if it less, then the water level is at a lower level than that point.

No need to use transistors.
 

BeanieBots

Moderator
Couldn't make out much of your circuit but it is very neat. Check you are wired to INPUT 3 and not leg 3.

"symbol LED = pin4" is the problem.
try "symbol LED=4"

pin4 is an input, so the pin driven high to the led on will depend on what logic level is input 4 and will be either pin1 or pin0. I guess you have the LED wired to output 4.
 

w7ky

New Member
Oh BeanieBots, you've really made my day! I might just go out and dance on the lawn. Now I wish I'd asked sooner. I'll be using something like this to control my deepwell pump and holding tank. I'll also try erdc's suggestion to skip the transistor.

I really appreciate this forum. I've learned so much is such a short time here. Thanks to everyone. Doug
 
Top