I am new to the SSI (Synchronous_Serial_Interface) through Arduino Nano. I am facing some difficulties in the program and connections. I have connected my rotary encoder [RLS] sensor Data+,Data-, Clock+,Clock- to RS422 Zihatec interface.I connect the RS422 TX and RX to D6 and D5 of Arduino Nano pins, respectively.
I have searched for many solutions and followed this link. I haven't succeeded as I resulted with 8191 CPR for my 13-bit magnetic rotary encoder all the time even I have turned my magnetic shaft.
My code modification seems as below from the first code by @johnwasser in the post:
const int CLOCK_PIN = 5;
const int DATA_PIN = 6;
const int BIT_COUNT = 13;
I obtain the following results with timestamps:
8191
8191
8191
8191
8191
.....
.....
Is there any issue with the connections or should I have to modify the program?
Yes, I can share the datasheet of the single turn RLS magnetic rotary encoder on page7 with RM58SI in datasheet.
I have kept the DIP switches settings for RS422 as of Zihatec page 6 in Datasheet and DIP Switch Settings (current version) in this link.
If I connect as you have suggested, will the Arduino nano get affected? Because the RLS sensor needs an RS422 interface, as shown on page7 with RM58SI in the datasheet.
It will be a great help with the connections and the code.
I thought the signal comes from TX, RX, RE pins of the 'hat' as mentioned in the 'Schematic' diagram in the link provided earlier. So, I have connected TX (data output), RX (clock input) pins from 'hat' to D6 (data input), D5 (clock output) of the Arduino nano through jumper wires.
I am giving the 5V power directly from Arduino nano to the RLS sensor.
I have connected the GND from Arduino nano to the RS422 and RS422 have shield that acts as GND as I have seen in the online and is connected to GND of the RLS sensor.
The following are the total connections:
RS422 <--> RLS sensor
B <--> Data-
A <--> Data+
Z <--> Clock+
Y <--> Clock-
Hi, @nutakki
Please draw your circuit, it will be worth a thousand words.
Please include power supplies.
Just pen(cil) and paper, then send an image of it.
Any reason why a Rasp Pi hat for an Arduino project?
Why a 422 interface?
I have already mentioned the pin structure in the above reply along with the RS422 interface and RLS sensor datasheets.
The RLS sensor depends on RS422 interface as it was provided in the datasheet.
There is not much difference of the 'hat' that fits on to the Arduino or Raspberry depending on the alignment.
The purpose for both are same with the functionality of the pins.
I have attached the DIP switches for RS422 in the below pdf file. On page6, of SW1 that represents 4th row is the ^RE (GPIO 18). I kept this pin in ON mode.
The GND is blue wire in the RLS encoder that is connected to RS422 shield.
Hi, @nutakki
Note that the 422 device has galvanic isolation.
Have you measured the voltage between 5V to gnd AT the encoder terminals to see if it is getting supply.
Galvanic Isolation means COMPLETE voltage/current isolation between input and output
Just connecting 5V with no gnd connection through the 422 device, will not supply your encoder.