Shop OBEX P1 Docs P2 Docs Learn Events
Pulse Counting underwater — Parallax Forums

Pulse Counting underwater

ArchiverArchiver Posts: 46,084
edited 2004-01-29 21:22 in General Discussion
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

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-01-29 21:22
    Uh, yes, if your sensor shorts out underwater,
    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
Sign In or Register to comment.