Alarm Style Input -- Ideas Needed
G McMurry
Posts: 134
I want to use a Basic Stamp to sense a remote contact closure. Easy enough you say....? However, I need to know if there is a fault... For example: A simple normally closed contact to ground with a pullup can easily sense a switch being open or closed. What if someone cuts the wire between the Stamp input and the contact closure?
How can I pole the switch in a way that I can tell if it is closed, open or missing?
In a normal burglar they put a resistor across the switch contact. The system can then look for that resistor (switch open), look for a short (switch closed), look for nothing (switch is missing).
I am thinking I can use some sort of circuit such as RCTime and see the three switch conditions I want...
Does anyone have any other ideas?
I guess if I have to, I could go to two bits per switch but I think the Basic Stamp should be able to do this reliably with one bit.
Greg
How can I pole the switch in a way that I can tell if it is closed, open or missing?
In a normal burglar they put a resistor across the switch contact. The system can then look for that resistor (switch open), look for a short (switch closed), look for nothing (switch is missing).
I am thinking I can use some sort of circuit such as RCTime and see the three switch conditions I want...
Does anyone have any other ideas?
I guess if I have to, I could go to two bits per switch but I think the Basic Stamp should be able to do this reliably with one bit.
Greg
Comments
This way, you use two pins on the microcontroller. One of them can detect open circuit or closed circuit, and the other can detect the fault (whether or not current flows through the resistor).
I guess this doesn't really work, though, if the alarm's idle state is with the switch closed.
Anyway, just a thought.
-Tomato
What you need to do is look at help file for RCTIME in Basic Stamp Editor which will show you how it is connected. What you, have to remember is you will always have a resistor in the circuit.