Skip to content

HsienChing/RS-485_Modbus-RTU_Call_Response_and_HMI_Display_with_CRC_for_Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About the project

The Arduino board is used to communicate with the external device through RS-485 Modbus-RTU. The device responses are resolved by the Arduino with cyclic redundancy check (CRC) and outputted to the human-machine interface (HMI).

License: MIT Contributor Covenant

Brief description

Suggested board:

  1. Arduino MEGA 2560 Rev3

Purpose:

  1. Send Modbus-RTU command to the device through RS-485 via the assigned "RS485_Serial."
  2. Get responses from the device through RS-485.
  3. Send the device responses to the human-machine interface (HMI) via the assigned "HMI_Serial."
  4. Arduino can monitor the device responses from the serial monitor.

Suggested hardware setup:

  1. A "RS-485 to TTL module" is used to convert the RS-485 signal because Arduino MEGA 2560 Rev3 does not support RS-485 directly.
  2. A HMI with the UART interface is used to show the device responses through the assigned HMI_Serial channel of the Arduino.

Usage

The codes are in the code directory.

# Sketch name and key differences Date
5 Name:
RS-485_Modbus-RTU_Call_Response_and_HMI_display_with_CRC.ino
Difference:
CRC function added.
#define HMI_Serial Serial1 // Assign serial port
#define RS485_Serial Serial3 // Assign serial port
2021-07-08
4 Name:
RS-485_Modbus-RTU_Call_Response_and_HMI_display_without_CRC_v04.ino
Difference:
#define HMI_Serial Serial1 // Assign serial port
#define RS485_Serial Serial3 // Assign serial port
2021-07-07
3 Name:
RS-485_Modbus-RTU_Call_Response_and_HMI_display_without_CRC_v03.ino
Difference:
Serial1.begin( 9600); // Serial3 for RS-485 to TTL
Serial2.begin(115200); // Serial1 for HMI with UART interface
2021-07-06
2 Name:
RS-485_Modbus-RTU_Call_Response_and_HMI_display_without_CRC_v02.ino
Difference:
Serial1.begin( 9600); // Serial3 for RS-485 to TTL
Serial2.begin(115200); // Serial2 for HMI with UART interface
2021-07-06
1 Name:
RS-485_Modbus-RTU_Call_Response_and_HMI_display_without_CRC_v01.ino
Difference:
Serial1.begin( 9600); // Serial1 for RS-485 to TTL
Serial2.begin(115200); // Serial2 for HMI with UART interface
2021-07-06

License

Distributed under the MIT License.

Contact

Author: Dr. Hsien-Ching Chung

ORCID: https://orcid.org/0000-0001-9364-8858

Project Link: https://github.com/HsienChing/RS-485_Modbus-RTU_Call_Response_and_HMI_Display_with_CRC_for_Arduino

Acknowledgements

H.C. Chung thanks all the contributors to this project for their valuable discussions and recommendations, especially Jung-Feng Lin, Hsiao-Wen Yang, Yen-Kai Lo, An-De Andrew Chung.

This work was supported in part by Super Double Power Technology Co., Ltd., Taiwan under grant SDP-RD-PROJ-001-2020.

About

Device communication through RS-485 Modbus-RTU with CRC16 and HMI display for Arduino

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages