I'm designing a device around a PIC18F4520 which will have 10 button inputs. The buttons are arcade-style large pushbuttons, and will be located at a moderate distance from the PIC (a few 10s of meters, most likely). The wires will probably run alongside other cabling - I don't know exactly what, but it will involve regular AC outlet power supplying a few incandescent light bulbs, among others. I don't expect any motors or other large inductive loads though. What, if anything, should I add to the PIC's inputs to protect it from EMI, static, and the like? This is a one-off project, and minimum cost is not critical. I've been thinking about a bunch of optocouplers - these should nicely isolate the PIC from anything and everything on the outside, and I don't expect the LEDs to have any problems operating under these conditions. Any other ideas / suggestions? Along similar lines, I need to run an RS232 link from a PC to the PIC. I'm using a MAX232 transceiver, as usual. Data rate isn't very high; 9600baud should suffice. What would be the maximum length of the wiring under these conditions? Shielded vs. unshielded cabling, etc? -- Hector Martin (hector@marcansoft.com) Public Key: http://www.marcansoft.com/marcan.asc -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist