Incremental encoder 24v to ardunio


I'm involved in a project to get an old saw mill running again. The control system for the saw is beyond repair so lends it's self to an arduino project nicely. I've built an arduino device that can control a relay board that then controls several electrical contactors controlling a few large 3 phase motors. I have this working.

The log carriage has a 24v incremental encoder on it and runs at 24 volts. The flex to the encoder is about 30-40ft long. obviously I can't take the AB outputs directly to the arduino UNO I need to drop the voltages down to less than 5v. can anyone here recommend a way of doing this in a way that wont harm the Arduino and still maintain the accuracy of the pulses?

I will be using the interrupt pins and adding/subtracting from a value that can be used in the main loop.

Use a voltage divider.


Thanks for reply.

I've opted to use an optocoupler also.