SSI Communication using Arduino Nano for Magnetic Rotary Encoder

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.

Thanks in advance.

with regards,
Nutakki

How do you have the Raspberry Pi 'hat' connected to your Arduino Nano?

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.

And power?

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-

RS422 <--> Arduino Nano
TX <--> D6
RX <--> D5
GND <--> GND

Arduino Nano <--> RLS sensor
+5V <--> Vdd

Are you not providing power to the RS422 interface? I would think +5V from the Arduino should go to the 'hat'. Maybe 3.3V, too.

Do you mean the final connection should be like this for SSI communication?

RS422 <--> RLS sensor
B <--> Data-
A <--> Data+
Z <--> Clock+
Y <--> Clock-
Shield <--> GND

RS422 <--> Arduino Nano
TX <--> D6
RX <--> D5
GND <--> GND
+3V3 (Pin 1) <--> +3V3
+5V (Pin 2) <--> +5V
+5V (Pin 4) <--> +5V

Arduino Nano <--> RLS sensor
+5V <--> Vdd

If I connect the power supply to RS422 as above, will that effect the RS422?

Do I have to make any modifications in the first post of your code @johnwasser for single-turn magnetic encoder 13-bit in this link?

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?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Hi @TomGeorge,

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.

For power, you need both +5V/Vdd and Gnd for both the hat and the encoder. Your list doesn't show the power ground connection for the encoder.

Do you have the switch set to ground the ^RE (Receive Disable) pin of the RS422 interface?

RS422 <--> RLS sensor
B <--> Data-
A <--> Data+
Z <--> Clock+
Y <--> Clock-
Shield <--> GND

RS422 <--> Arduino Nano
TXD (GPIO14, Pin 8) --> D6 (DATA_PIN)
RXD (GPIO15, Pin 10) <-- D5 (CLOCK_PIN)
GND <--> GND
+3V3 (Pin 1) <--> +3V3
+5V (Pin 2) <--> +5V
+5V (Pin 4) <--> +5V

Arduino Nano <--> RLS sensor
+5V <--> Vdd
GND <--> GND

Hi @johnwasser,

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.

DIP switches:
Datasheet RS485 HAT Rev C.pdf (1.3 MB)

Hi @TomGeorge,

I have attached my connection diagram in the figure below. If there are any modications then please let me know.

connection diagram:
*PC represents Personal Computer

with regards,
Nutakki

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.

Tom... :smiley: :+1: :coffee: :australia:

Hi @TomGeorge,

I hope that the encoder is attaining the 5V power supply.

The shield port from RS422 gives the GND connection that is connected to blue wire of the RLS sensor.

Do you mean to connect like this?
RS422 <--> RLS sensor
B <--> Data-
A <--> Data+
Z <--> Clock+
Y <--> Clock-
Shield <--> GND

Arduino Nano <--> RLS sensor
+5V <--> Vdd
GND <--> GND

and the rest with RS422 <--> Arduino Nano as this post.

Hi,

Yes.
Do you have a DMM?

Tom... :smiley: :+1: :coffee: :australia:

No, I don't have DMM.
After these connections, any suggestions for the code for the 13-bit single-turn magnetic encoder.

Hi,
You need to address post #8, how are you powering the 422 module?
We see no 5V supply going to it.

You need to research how the Rasp Pi powers the "HAT".

Can you please post a picture of your project, so we can see your component layout?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

I haven't powered the RS422.

Now, I will do it as follows:
RS422 <--> Arduino Nano
TXD (GPIO14, Pin 8) --> D6 (DATA_PIN)
RXD (GPIO15, Pin 10) <-- D5 (CLOCK_PIN)
GND <--> GND
+3V3 (Pin 1) <--> +3V3
+5V (Pin 2) <--> +5V
+5V (Pin 4) <--> +5V

I can't share the pictures right now. The connections are as of this link, there are no additional connections.

Hi,
This is where using Rasp Pi hats on Arduino becomes difficult.
When that hat is plugged into a Pi, it is supplied with all the connections needed to function with a Pi, including a power supply.
What has to be done is to find which connection on the hat is the 5V supply pin for the hat.

Where on the hat are you getting the connections to the UNO?
You need to put pin numbers on your schematic.

Thanks.. Tom... :smiley: :+1: :coffee: :australia: