detecting contact closure

Greets all. I'm an amateur at this, so please disregard any errors in my techincal description. I have a seemingly simple task to accomplish and am trying to figure out the best (most reliable) way to get it done.

I have a mechanical switch located about 300-400 yards away, on an entrance gate -- the contact closes when someone opens the gate.

I'd like to detect the closed contact with a TTL circuit. I already have the TTL logic in place (0V - gate is closed,

5V gate is open).. but am unsure how to "condition" the mechanical switch so it reliably provides a 5V signal to my TTL when the gate is open.

I'm considering 2 options:

1) use a resistor to 5V power supply.. when the switch closes, it sends 5V to my TTL.. when it opens, i'll get something less than 1 or 2V.. but I'm not sure if this will be a problem considering the long wires i have to the switch. Surely the extra resistance from all that wire will affect my simple 5V switch circuit.

2) my other option is to sense a small AC signal running through the switch (since, as I understand, AC signals don't suffer so much from loss over long distances). I would run a small AC signal through the switch and interface to it with a diode bridge rectifier. when the switch is closed, and there is AC flowing, I'll detect it on the DC side of the bridge.

Any thoughts on the best way to go? Is there a better solution out there? Don't want to get too complicated.. already have a junk drawer of electronics parts like diodes, resistors, etc.. that I'd like to use.

Thanks.

Reply to
post
Loading thread data ...

post a =E9crit :

The usual way to do this is a pull-up resistor of 10k say to +5V and the switch to 0V with maybe some debouncing circuit. That way you will always have a well-defined level on the logic's input.

However, the 300 meters or so of wire between the switch and the logic are a problem. They will pick up noise and stuff that will probably destroy the logic some day so some isolation/protection will be necessary. Cheap/simple ways (at the cost of an extra power supply):

- the switch operates a lamp (110VAC/230VAC) and a light sensor (LDR,photo diode) detects the lamp on/off condition. Eliminates contact bounce but some circuitry is needed to get a logic level out of it. Maybe some rugged opto-coupler.

- the switch operates a relay and its contacts copy the switch. The relay switch contacts are hooked up with a pull-up resistor to +5V and the other contact to 0V as described before. Lamps and relays are much more robust than TTL logic.

Or go wireless. Or do signal conditioning at the gate and transmit over twisted pair using RS485 logic. Or...

Thanks, Jenalee K.

Reply to
Jenalee K.

For 300-400 yards, TTL will never do. I'm assuming it's hardwired; what you really should do is use a current loop of some kind, in the analog domain, then condition that to trigger your response.

Or, if all you want is the equivalent of a doorbell, then just put the switch in series with a battery or isolated supply and some kind of indicator.

Good Luck! Rich

Reply to
Rich Grise

--
You must have missed Jenalee K.\'s excellent reply, of which yours is
merely a subset.
Reply to
John Fields

hmm... excellent huh? I think the best way is simply to higher and illegal alien to stand by the gate and yell when someone opens it.

Reply to
Abstract Dissonance

"post" schreef in bericht news: snipped-for-privacy@m79g2000cwm.googlegroups.com...

TTL-circuits are too fast and too sensitive for this type of detectors. The length of the wires can give nasty spikes and other disturbances (during thunderstorms for instance). Both the resistance and the capacitance of the wires are another issue. Cat. 5 cable for instance will have some 30 Ohm resistance for the length you mentioned, ordinary telephone wire wil have more. I guess the KISS approach will be the best. See below. (Use fixed font.)

+----+-------------+-----5V | | | .-. | .-. | | - | | | | ^ | |560 '-' | Si '-' 4k7 | | | | | +------out | | | | |100___ |/ +-------o--+-+--+--|___|-+--| NPN | wire | | |>

\\ o | | | \\ - --- | \\. ^ --- | o |Si |1nF | | | | | +-------o----+-----------+----+-------Gnd wire created by Andy´s ASCII-Circuit v1.24.140803 Beta

formatting link

Suppose the resistance of wire and switch (when closed) is below 50 Ohm. Otherwise you may raise the 4k7 resistor to let's say 10k depending on the Beta of the transistor. The diodes, the 100 Ohm resistor and the 1nF capacitor will give some protection against disturbances. The RC-combination makes the circuit pretty slow (compared to TTL speeds.) If you need to drive a TTL or similar circuit with it, connect a Schmitt triggered circuit to the output like the old 74LS14.

petrus bitbyter

Reply to
petrus bitbyter

I find an optoisolator in combination with twisted pair the perfect answer to this problem hands down. If theres a storm and the things struck by lightning then blowing an ic is the least of your worrys, but between the twisted pair and the forward drop of the led in an optoisolator i think it would solve stray noise issues inductance bothers me more than resistance your talking low amperage. Perhaps a single pull double throw that switches between normally pulled down with 10 k and then pulled up with say 500 ohms to give a solid 10 ma into the led i would use a capacitor on the line also to try and dampen ringing on such a long line not that it matters but i always liked clean waveforms on my scope

Reply to
leeps

I find an optoisolator in combination with twisted pair the perfect answer to this problem hands down. If theres a storm and the things struck by lightning then blowing an ic is the least of your worrys, but between the twisted pair and the forward drop of the led in an optoisolator i think it would solve stray noise issues inductance bothers me more than resistance your talking low amperage. Perhaps a single pull double throw that switches between normally pulled down with 10 k and then pulled up with say 500 ohms to give a solid 10 ma into the led i would use a capacitor on the line also to try and dampen ringing on such a long line not that it matters but i always liked clean waveforms on my scope

Reply to
leeps

what you need is a solar rechargable wireless Transmitter on the gate.

--
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
Reply to
Jamie

--
"Higher and Illegal" ?^) 

How about when the INS lowers the legal boom on you?
Reply to
John Fields

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.