> > I need to connect a simple push-on switch with a PIC, but the > > cable connecting it can be up to 30 meters. What are the > > potential problems here? Interference and such? > > I'd suggest sending Vcc or high output out through a series resistor, > eg 470 ohms, and the input pin (IP) pulled low with a resistor of > around 10x this, or a value that ensures the signal comfortably falls > outside the transition thresholds of the input. If the environment is > or could be noisy, add a small cap (100n) from IP to Vss, 5V1 zener > (k to IP, a to Vss) to clamp positive excursions and a Schottky diode > (k to IP, a to Vss) to clamp negative excursions I can't agree. A remote push button must be treated as a separate device. So here grounding and shielding rules come with all these circuit common reference wires attached to chassis ground. That is, if grounding line is to be spread out of a reference point anyway, then it would be better to add only one signal line, not two. I'd suggest having a look at the so called "fool-proof input line" scheme posted by me a couple of years ago. I also placed the scheme in the left side-bar of http://thepicster.blogspot.com under the name "special input." Just add a capacitor between the PIC input and ground. Regards, Mike. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist