Power detection?
surftheearth
Posts: 2
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
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
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