Hi All.
I have some questions I want to ask regarding the subject line.
1st: What is good choice of resistor to put in between GND and the A,B and Z outputs from a rotary encoder to reduce the amount of noise picked up by the Arduino? A secondary question, Should I rather use opto isolators for this so that I can use 24v rather than 5v on the encoder to give greater noise imunity?
2nd: When using an Opto Isolator (4N25) to recieve a signal to the arduino, how does one connect it? (See below for what I have tried). The signal is generated by a servo drive based on the servo's position. Option 1 and 3 for what I have tried
3rd: Linked to 2nd, Any thoughts on what I may be doing wrong when connecting the output from the drive to the opto isolator (4N25) See above drawing for what I have tried on the input side of the 4N25, Options 1 and 2.

Link to another thread where I am asking pretty much the same questions but perhaps not in the right part of the forum.
The other thread
Hi,
I think you need to look closely at the diagram with the opto it.
"HIGH SPEED OPTOCOUPLER"
Google high speed digital optocoupler
A 6N137A might be better.
If the encoder is in a servo drive, speed will be important.
Tom... 
TomGeorge:
Hi,
I think you need to look closely at the diagram with the opto it.
"HIGH SPEED OPTOCOUPLER"
Google high speed digital optocoupler
A 6N137A might be better.
If the encoder is in a servo drive, speed will be important.
Tom... 
Thanks for your response. I must admit this is my first dabble in these things. I ran off to my nearest electronics supplier yesterday right before closing and pointed to the diagram that says "high speed photocoupler" and said to the guy across the counter "I need two of those" I had not taken the time to google and just trusted the guy ( not his fault in anyway).
I looked at the specs of the 6n137A and it should suit my application. Max frequency the pulse from the drive will be is 125KHz. I tried out the LINE DRIVER wiring option (GND on /O, O on arduino pin to be read and 124.7Ohm resistor between O and /O) and the result was even worse than when I had it connected in this way without the resistor between the signal and GND.
In the case of the the encoder mentioned in my 1st question I will use SFH6325 photocouplers (unless there are single channel options that would suit my needs) I have decided that I will need to use 24v on the encoder as its cable is over 2M long (it screened as are all the cables in the system), it picks up noise when ever the Servo drive is active.
This is the wiring I have come up with, does it look somewhat correct, based on what I have mentioned above Keeping in mind that I want to go with what is illustrated in Diagram C13 (first post, second picture) What is the significance of the line that looks a bit like an Integral symbol between the shielding symbol and the resistor symbol in C13? (almost replaces the resistor in C12).
Please forgive my circuit diagram for being a bit messy.
One other question do I need a resistor Between the output from the encoder to the SFH6325? I have put them in with "?" values. How would I go about calculating them if needed?
OTHER NOTES:
Pin 53 and 52 are step and direction to the servo drive.
SERVO CONTROL V2.pdf (36.3 KB)
Hi,
2m cable is no need to use 24V, that is a good length for even 5V but as you have 24V available.
Thanks for the circuit.
Please label the terminals on your circuit please, numbers mean nothing in this instance as we don't know your hardware.
What model Arduino are you using?
What encoder?
What servo controller?
Thanks.. Tom... 
TomGeorge:
Hi,
2m cable is no need to use 24V, that is a good length for even 5V but as you have 24V available.
Thanks for the circuit.
Please label the terminals on your circuit please, numbers mean nothing in this instance as we don't know your hardware.
What model Arduino are you using?
What encoder?
What servo controller?
Thanks.. Tom... 
Hi Tom, Hopefully this answers your questions. I have put the drawing on a bigger sheet as I must still add two button inputs and the RS485 module
SERVO CONTROL 2.1.pdf (38.2 KB)
I appreciate it. Should I post up code as well? (I didnt think it was really relevant as I more just need to figure out how to get the signals to the arduino properly)
Right, so the best my local electonics store had is a 4n35. I want to be able to at least test the system for now. Running the servo at low speed to give a sub 10KHz pulse should at least allow me to test the system. I can also scale the output pulse from the drive. In other words it can generate between 1 to 2500 ppr depending on how you set the parameter in the drives settings.
I will also use the 4n35s for the spindle encoder. In the same configuration as used on the servo drive.
Now, should I rather go another route to control this servo. I really just want to sink the servo to a spindle and start and stop the out put pulse to the servo when a position is reached.