Site icon Pallav Aggarwal

8 Channel Relay Board with RS485

One of the biggest challenge for an engineer is, getting access to the right product documentation and able to quickly understand how to use it.

Some companies put their heart and soul to do this right and makes their customers life super easy but on the other hand there are companies who just ignore this in the hope that customer will figure it out by themselves.

Recently, I was looking for a 8 channel relay board with RS485 interface for a test automation solution and I picked up this board from a leading online electronics component shop and thought I will get the documentation easily, I will ask them once I get the board in hand.

To my surprise, when sent them email they sent me some random links unrelated to the products, to be it felt like they just want get rid of the support ticket.

I mean, I was really sad that they started selling the board without having the documentation. Ideally they should have put the documentation on the products page itself so that customer need to ask.

But, even if it is not yet published on the product page they should have it available internally to provide it to the customer once a support request is received.

After wasting some time with them over couple of emails I understood that these guys are simply traders, they don’t have any documentation and not really interested in helping their customer.

I searched on google and various other websites who were selling same board but no one was having the documentation published on their website.

Finally, I decided to find out the documentation and put it online so that others need not waste time and struggle like I did.

I spent more time in finding the correct documentation than it took me to use it to make the Relay board work with RS485 commands.

I found documentation on Alibaba but it also had errors and many commands were not working when I tested them. It was not surprising to see low quality documentation btu I was happy that I got something to start my testing.

The correct documentation is as following:

Default serial port setting for RS485:

Command to read already set Modbus / RS485 Slave Address

Command:
00 03 00 00 00 01 85 dB
Response(if slave id is 01):
00 03 02 00 01 44 44

To modify the Slave address of the board, you need to send the following commands. This will be required when you are using multiple board and all are connected on same RS485 bus.

Set the address to: 01
00 10 00 00 00 01 02 00 01 6A 00
Set the address to: 02
00 10 00 00 00 01 02 00 02 2A 01
Set the address to: 03
00 10 00 00 00 01 02 00 03 EB C1

Set Relay ON or OFF (Modbus Salve address 01)

Set Relay 0, ON
01 05 00 00 FF 00 8C 3A
Set Relay 0, OFF
01 05 00 00 00 00 CD CA

Set Relay 1, ON
01 05 00 01 FF 00 DD FA
Set Relay 1, OFF
01 05 00 01 00 00 9C 0A

Set Relay 2, ON
01 05 00 02 FF 00 2D FA
Set Relay 2, OFF
01 05 00 02 00 00 6C 0A

Set Relay 3, ON
01 05 00 03 FF 00 7C 3A
Set Relay 3, OFF
01 05 00 03 00 00 3D CA

Set Relay 4, ON
01 05 00 04 FF 00 CD FB
Set Relay 4, OFF
01 05 00 04 00 00 8C 0B

Set Relay 5, ON
01 05 00 05 FF 00 9C 3B
Set Relay 5, OFF
01 05 00 05 00 00 DD CB

Set Relay 6, ON
01 05 00 06 FF 00 6C 3B
Set Relay 6, OFF
01 05 00 06 00 00 2D CB

Set Relay 7, ON
01 05 00 07 FF 00 3D FB
Set Relay 7, OFF
01 05 00 07 00 00 7C 0B

Read single relay status

Command to Read status of Relay 0
01 01 00 00 00 01 FD CA
Response if relay 0 ON
01 01 01 01 90 48 
Response if relay 0 OFF
01 01 01 00 51 88

Command to Read status of Relay 1
01 01 00 01 00 01 AC 0A

Command to Read status of Relay 2
01 01 00 02 00 01 5C 0A

Command to Read status of Relay 3
01 01 00 03 00 01 0D CA

Command to Read status of Relay 4
01 01 00 04 00 01 BC 0B

Command to Read status of Relay 5
01 01 00 05 00 01 ED CB

Command to Read status of Relay 6
01 01 00 06 00 01 1D CB

Command to Read status of Relay 7
01 01 00 07 00 01 4C 0B

Command to Read status of all Relay at once
01 01 00 00 00 08 3D CC 

To Read 8 digital inputs status

Command to read inputs
01 02 00 00 00 08 79 CC
Response
01 02 01 00 A1 88

There are other commands also like

if you are interested please go through this link for details.


I hope you found this information useful. If you have any feedback, you can share in the comments section or you can also directly contact me.

Read more interesting articles on Embedded Systems Design.


Exit mobile version