Use twisted pair cable. Capacitive filters and (possibly) inductors - you can get three-terminal C-L-C filter components - would be acceptable. False triggering could be catered for in programming (similar to keyboard debounce).
Use twisted pair cable. Capacitive filters and (possibly) inductors - you can get three-terminal C-L-C filter components - would be acceptable. False triggering could be catered for in programming (similar to keyboard debounce).
Wouldn't an opto-coupler like MCT6 protect the pins?
Robert
Last edited by Demon; - 9th July 2013 at 15:42.
Well... an opto coupler requires power, so you need to add still more complexity, and yet another power source for isolation. Then of course, how do you test that the opto has not failed, since the operating condition and the usual broken condition look the same? And given the cost of an opto and the cost of a PIC these days are not that far apart, you are sort of into diminishing returns. So IMHO, an opto is not a good solution in this instance.
The previous poster's twisted pair recommendation is very good. A CLC filter would be good too, but again, a bit of overkill for this application, I think. RC filter is plenty, unless you are worried about radiating electromagnetic interference from your circuit with the antennae you are stringing all over the place... in that case a CLC filter is more bidirectional, and will help prevent you causing problems for your neighbors. Your board layout and clock choices and enclosure will all play a role here too - EMC in non-trivial.
I don't know why using wire, excluding any EMC potential, would be a problem if the correct wire gauge is selected. This site http://www.cirris.com/testing/resistance/wire.html shows that using 20 ga. wire for 1200 feet (approx. 400 meters) would get you in the range of 12 ohms. If you continue to use the 1.5k as a pull up, when the the switch closes you'd have around 40 millivolts(at 5 volts) from pin2 to ground. This well within the limits for the PIC to recognize a logic low.
Now if you use .050 ribbon cable you'd have around 7200 ohms just for the wire and a "low" voltage of 3.9ish. That voltage would be probably interpreted as never having switched. But you could also use the .050 wire but use a 100k as a pullup and you'd get around .33 volts(at 5 volts) which should be seen as a logic low.
EMC could be soved by routing, cheaper, or using shielded wire which would about double your wiring costs. Routing the sensing wire at 90 degrees to electrical wiring where it corsses will minimize EMC pickup from that source. Might even be cheaper to run conduit in suspect areas if you're handy with that sort of thing. Of course you could use a debounce routine like someone else suggested.
I also don't see any value in the TVS but I am curious how you came about the values used for you filter network.
Hi all!
I have been in the alarm business for over 38 years. Most of the systems I deal with utilize an end of line resistor for supervision of the circuit and it also allows the use of open and closed circuit switches on the same circuit. With this in mind, intrusion circuits are usually closed loop devices and fire circuits use both types of devices with specifically open circuit devices activating the fire loop and closed loop devices use for supervision of the fire circuit. An example of this type of fire circuit is a 4-wire smoke detector. At the end of the loop is an end of line relay circuit that monitors the power going to the smoke detector with the end of line resistor after the smoke detector's open contacts so that even if the end of line resistor was missing, you can still generate an alarm on that loop.
Anyhow, these types of circuits are usually fed into an LM339 voltage comparator so that both "open" and "shorted" loops can be detected. I use this type of design in things that I make and it works great. The loop has a resistor (the industry uses 1K, 2.2k, 4.7k and sometimes 5.6k values in their designs). There are one or two companies that even use 3.3k. There are some companies that utilize the A-D or comparator inputs on micros to do the analysing for them saving having to put another IC on the board. The input circuit looks like the second circuit shown in the example without the TVs and usually only have a .1uF capacitor in the circuit.
Hope this information helps you with your design!
BobK
Bookmarks