I'm wanting to detect a switch's logic state over a long distance (20ft). I've read a couple of solutions, but I believe the simplest is using optocouplers. I have a schematic (don't roast me too bad on it.) and was hoping I could get some insight.
There are four switches. The ground doesn't need to be separate. The input voltage will be 5v and will be powered by USB.
Any help is greatly appreciated.
The coupler used is a 6N138.
IP[1-4][+-] is the switches leads. So one end is connected to 5V, the other is connected to a designated coupler. And the coupler's output goes to OP[1-4], which is passed into the Arduino.
The Arduino will be using the internal pull-up resistor.
Sorry. I failed to mention that the switches will be closed very momentarily. They are actually pressure pads; ones that when you step on closes the circuit.