This Arduino library allows you to send and receive data using the RS-485 interface standard. Supported by all Arduino-compatible boards such as ESP32, STM32, RP2040, AVR, SAMD, ESP8266, etc. You can use both hardware and software serial ports for communication. This library supports the Maxim Integrated MAX485 and equivalent external transceivers.
This library is a fork of the ArduinoRS485 library by Arduino, and is maintained by CIRCUITSTATE Electronics.
This library is available from the official Arduino Library Manager. Open the Arduino IDE, search for CSE_ArduinoRS485 and install the latest version of the library.
Additionally, you can download the latest release package from the GitHub repository and install it manually. To do so, open the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library… and select the downloaded file.
Another method is to clone the GitHub repository directly into your libraries folder. The development branch will have the latest features, bug fixes and other changes. To do so, navigate to your libraries folder (usually located at Documents/Arduino/libraries on Windows and ~/Documents/Arduino/libraries on macOS) and execute the following command:
git clone https://github.com/CIRCUITSTATE/CSE_ArduinoRS485.git
The library can also be installed via PlatformIO. All officially listed Arduino listed libraries are automatically fetched by PlatformIO. Use the lib_deps
search option to install the library.
Three examples are included with this library:
-
RS485_Sender - Sends data to a connected receiver.
-
RS485_Receiver - Receives data from a connected sender.
-
RS485_Passthrough - Sends and receives data between the RS-485 port and the default serial port.
You can find the complete API reference for this library at API.md.