Pulse Counting underwater
Archiver
Posts: 46,084
I am using a Basic Stamp II to count pulses from a device that
operates underwater (a meter for measuring water flow velocity). I
have a simple circuit set up that reads the pulses through IN3.
Everything works great until I submerge the meter in water. I think
that the water is shorting out my circuit. I wrote the code to only
count a pulse once if the "switch" is held down, and because of this
when the meter is underwater I get only one pulse recorded.
Dose anybody have any ideas how I can get around this problem.
Insulating the meter is not really an option though it would be nice
if it were.
Here is a blurp of my code:
INPUT MyPin
DO
IF (IN3 = 1 AND last = 0) THEN
counter = counter + 1
SEROUT SerPort, SerBaud, [noparse][[/noparse]DEC counter] ' Output pulse
counter to PC
last = IN3
ELSEIF (IN3 = 0) THEN
last = IN3
ENDIF
PAUSE 100 'wait .1 seconds
ENDIF
LOOP
END
Thank you,
Nick
operates underwater (a meter for measuring water flow velocity). I
have a simple circuit set up that reads the pulses through IN3.
Everything works great until I submerge the meter in water. I think
that the water is shorting out my circuit. I wrote the code to only
count a pulse once if the "switch" is held down, and because of this
when the meter is underwater I get only one pulse recorded.
Dose anybody have any ideas how I can get around this problem.
Insulating the meter is not really an option though it would be nice
if it were.
Here is a blurp of my code:
INPUT MyPin
DO
IF (IN3 = 1 AND last = 0) THEN
counter = counter + 1
SEROUT SerPort, SerBaud, [noparse][[/noparse]DEC counter] ' Output pulse
counter to PC
last = IN3
ELSEIF (IN3 = 0) THEN
last = IN3
ENDIF
PAUSE 100 'wait .1 seconds
ENDIF
LOOP
END
Thank you,
Nick
Comments
there's not much the BS2 can do with it.
A single pulse is a single pulse. The
thing is not magic, after all.
Insulating the meter, hot-glue, silicone
adhesive, silicone potting compound, wrapping
it in a plastic bag -- all are ways to
water-proof your sensor.
How are you running a ground wire? You do
have two wires going to your sensor, right?
Your code looks fine, anyway.
--- In basicstamps@yahoogroups.com, "nickvanlan81"
<nickvanlan81@y...> wrote:
> I am using a Basic Stamp II to count pulses from a device that
> operates underwater (a meter for measuring water flow velocity). I
> have a simple circuit set up that reads the pulses through IN3.
>
> Everything works great until I submerge the meter in water. I
think
> that the water is shorting out my circuit. I wrote the code to
only
> count a pulse once if the "switch" is held down, and because of
this
> when the meter is underwater I get only one pulse recorded.
>
> Dose anybody have any ideas how I can get around this problem.
> Insulating the meter is not really an option though it would be
nice
> if it were.
>
> Here is a blurp of my code:
>
> INPUT MyPin
>
> DO
>
> IF (IN3 = 1 AND last = 0) THEN
> counter = counter + 1
> SEROUT SerPort, SerBaud, [noparse][[/noparse]DEC counter] ' Output pulse
> counter to PC
> last = IN3
> ELSEIF (IN3 = 0) THEN
> last = IN3
> ENDIF
>
> PAUSE 100 'wait .1 seconds
>
> ENDIF
>
> LOOP
>
> END
>
>
> Thank you,
>
> Nick