I've got a
ShapeOko CNC router that uses and Arduino UNO with a
gshield stepper controller board plugged into it. I noticed my limit switch inputs have quite a bit of noise on them (see my
Shapeoko forum post if you're interested in oscilloscope screenshots). I'm using shielded wire on the limit switches.
My plan is to build an Arduino shield that would sandwhich between the Uno and gshield. It would have optocouplers to isolate the limit switches. I'm thinking of using
HCPL2631 logic level isolator. I chose the HCPL2631 because it's used by a
RepRap Opto-Isolator board. This design seemed like a good starting point for me.
I have a few questions:
Is using a logic level optocoupler the right choice or should I use a transistor optocoupler like a
LTV-826?
Currently I have ground going out to the limit switch and when the switch closes, it pulls the input pin to ground. Since the HCPL2631 optocoupler inverts the signal, I was planning on having +5v go to the limit switch instead of ground. Any reason not to do this?
Couldn't noise on the line cause the optocoupler to turn on? Should I also use an R-C low-pass filter in the circuit? If so, are there any special considerations I need to take into account if I'm using a low-pass filter together with an optocoupler?