Distant reed-switch...

Status
Not open for further replies.

Exo

Active Member
Hi,

I'm doing a project and the PIC has to count pulses coming from a reed-switch. This switch will be far away from the PIC (100 meters).
I was thinking of just pulling the PIC's Input high with a lower value resistor (say 330 ohm - To lower input resistance) and letting the reed switch pull it down. Debouncing will be done in software .

Question: Will this work, or should i add some kind of filter? I'm not sure what effect the distance between the switch & PIC will have in terms of interference and it needs to be 100% reliable (no false pulse detections,...)

Also note that the wire will be running outdoors underground (if that matters).
 
all that wire would add a lot of resistance... why are you trying to get low input resistance?? if you pull it up with 330 ohms, then the wire + reed switch would have to be about 200 ohms or less to pull it down, or it would never register as a low logic level. if you use a big pull-up, you dont have to worry about that... I would go with my old stand-by of 10k
 
The obvious reason for using a low value pull-up resistor is to give a lower input impedance. The higher the input impedance, the more likely it is to be affected by external interference.

I would suggest you get the software working first, using short leads - then try different pull-up values for the longer leads, and try and find the optimum.
 
I think I'd go with a higher value pullup and a big cap on the input to absorb any little transients and noise.
 
i think it really depends on the type of wire that you end up using..
twisted pair ( cat 5 ) cable is your best bet .. because it is made to be used for long distances , and the twist gives good immunity from interference..
 
Or, instead of voltage sensing you employ current sensing. With current sensing it does not matter how long the wire is as long as the current is or is not flowing through it.
Klaus
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…