Shop OBEX P1 Docs P2 Docs Learn Events
Power detection? — Parallax Forums

Power detection?

surftheearthsurftheearth Posts: 2
edited 2007-09-05 19:28 in BASIC Stamp
I am new to Basic Stamp and am looking for a way to detect current flow and shut down after a set period of time. This is for a water pump on my boat which has a manual switch which nobody every remembers to turn off. It is a 12v pump that when running draws about 30 amps. I have looked at a few DPDT relays but haven't found what I am looking for.

Also if anyone can point me towards some information on how to directly connect the Basic Stamp to my boats 12v system that would be much appreciated!

Thanks

Comments

  • tabbotttabbott Posts: 26
    edited 2007-09-05 19:28
    What stamp are you using? The BS2 can take 12v DC in - I do this now. I also know that if you connect 12v DC to a BS2SX, it will work, but get hot.

    For current measurement you can use a clamp-on DC current probe, or connect a resistor in line and measure accross it. Use the setup in the manual to measure analog voltages with the stamp.
    For the switch, connect the output of one of the pins to a transistor that is connected to a relay that will break the power supply to the pump.

    So, your code will look something like this:
    Limit is what measurement you get when the pump is running
    Voltage is the current measured voltage which is updated in GetVoltageReading
    and timeout is how long you want to delay

    count=0
    While (voltage>limit) and (count<timeout)
    Count=count+1
    gosub GetVoltageReading
    pause 90
    loop
Sign In or Register to comment.