This project uses an Arduino Mega to read a Modbus RTU feed through RS485. This example is based on a Huawei / CHINT DTSU666-H.
From my experience it is absolutely needed to have an Arduino Mega or equivalent (needs to have at least 2 serial ports), you won't be able to read the Modbus if Serial is also used by USB Serial Monitor.
You can get the list of all possible variables to get from the DTSU666-H in the following Excel file : https://github.com/salakrzy/DTSU666_CHINT_to_HUAWEI_translator/blob/main/doc/CHINT%20HUAWEI%20address%20remapping.xlsx
Multiple examples :
- DTSU666H_reader : reads a modbus feed, extracts specific address information and writes it out in serial monitor.
- DTSU666H_recorder : reads a modbus feed, extracts specific address information, writes it out in serial monitor, writes it out on a LCD screen with multiple pages, and writes it out in a .CSV file on a SD card to allow further analysis on Excel.
- DTSU666H_RTC_recorder : reads a modbus feed, extracts specific address information, writes it out in serial monitor, writes it out on a LCD screen with multiple pages, and writes it out timestamped in a .CSV file on a SD card to allow further analysis on Excel.