I need an input protection for a remote switch, the wire is about 15M away. That's what I am planing to add input protection to my pic, will that work? Or should I add something like 10n filter caps?
Thanks guys!
PS: I think I should move my D1 and D2 between R1 and R2...
Why do you need anything? 15 m isn't very long and, unless you are next to an AM radio station or other things that would make your switch look like an antenna.
It all looks very complex - have you had problems to this point?
I agree. Unless you are in an electrically noisy environment you could probably just wire it in parallel with the board switch. Also note that if you are in a noisy environment that circuit will not protect against common mode noise. So it depends on what you need but in a normal environment I think a capacitor and some twisted pair wire should work fine.
I don't have any problem at this point(with just two wire connect to the remote switch to the local switch directly). But the wires might be wired next to a or two bathroom fans, I just want to make sure it's reliable.
So it's good enough even next to a bathroom motor, or do I need something else?
Yep you would be better off just connecting the remote switch in parallel to the local switch and eliminate Q1 and Q2. The impedance is lower and you wouldn't be adding a noise amplifier.
For the 15 meters out to the switch, use a lightly twisted pair. No need for shielding unless a transient problem pops up. One twist every 6 inches or so should be enough.