I am looking for a way to protect my Arduino's digital outputs from unwanted, outside voltages. My project uses about 20 different outputs, each connected to a wire (run) that can range from 20 to 100 feet (I used cat5 cable, with each inner wire (randomly chosen) dedicated to a single digital in, out, +5, +9 or ground.) There is a good change that outside voltages could impact these digital outs (or any other pin or power wire.)
I have a good resource on protecting digital in's but I ma not sure how to protect the digital outs. Each needs to be able to both pull a connect component to ground, and push it up to 5 volts (am I saying this correctly?)
This should be able to protect the digital outs from shorts or 12v spikes.
How can I build this circuit?
Edit: it is difficult for me to describe this problem without mentioning the danger to all components.
Note that ways of protecting digital inputs is HERE.