CSE_ArduinoRS485 is an Arduino library from CIRCUITSTATE Electronics. 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
Git should be installed on your computer.
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.
If your board require the SoftwareSerial library, it needs to be included.
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.
The examples are categorized for three different target boards.
- ESP32 (Uses hardware serial port)
- RP2040 (Uses hardware serial port)
- ESP8266 (Uses software serial port)
Please see the API.md file for the API reference.