Introduction: How to Use Industrial Encoders With Arduino
Incremental encoders are often used for industrial applications like robotics or positioning tracking. Encoders for industrial applications comes mostly with a differential RS422 interface.
I will show in this small project how to use an industrial incremental encoder - in our case SICK DFS60 - with an Arduino UNO.
Step 1: Tools and Materials
Step 2: Some Basics
The RS422 output of the encoder is only used als hardware layer. No serial protocol will be transmitted over the RS422. Only the pulses of the encoder itself are directely transfered via 3 different RS422 channels: SIN, COS and Z (zero position).
Because of the 3 independent RS422 channels we need 3 RS422 inputs for the Arduino. For this purpose I've used 3 pcs of my Arduino RS422/RS485 shields - stacked on one Arduino.
Step 3: Dip Switch Setting of RS422 Shields
The dip switch setting for any shield is the same:
- S1: ON, OFF, OFF, OFF (receiver always on / transmitter always off)
- S2: OFF, OFF, ON, ON
- S3: ON, OFF, OFF, OFF (terminating resistor on)
Step 4: Jumper Settings of RS422 Shields
The Jumper setting for any shield is different. Depending from the connected channel the RX pin is configured to:
- Z: D2
- COS: D3
- SIN: D4
The voltage jumper JP1 must be setted to 5V.
Step 5: Wiring
The encoder can be powered by a laboratory power supply or directely by the 5V of the Arduino UNO
Step 6: Software and Test
Please compile the attached INO file under the Arduino IDE. After uploading the project to the Arduino you have to open the serial monitor with 115200 baud.
You will see the current increment value (updated all 0,5s) and the current status of the Encoder there....