

Here is the list of options, depending on the number of ports available on your Arduino model:

Hardware Set-Up and Serial Portsīecause I’m using an Arduino Mega, 4 serial ports available. There are several devices on the market that do this, but I used this RS485 Transceiver Breakout Board. To allow an Arduino to speak over an RS485 network, an additional device must be used to convert TTL to RS485. This is far more useful in an industrial setting where signals can be influenced by electrical noise, and devices can be separated dozens or hundreds of meters.

However, TTL is single-ended, whereas RS485 relies on a differential signal ( what's the difference?). Serial communication means data is sent one bit at a time at a specified BAUD rate (bits per second). Both signaling types use serial communication. How an Arduino can Speak over an RS485įirst, let’s talk about Arduino and RS485.Īlthough Arduino supports serial communication through its built-in UART (Universally Asynchronous Receiver/Transmitter), it uses TTL (Transistor-Transistor Logic), not RS485. In this post, I'll talk about adding an Arduino to an RS485 network and programming it to function as a Modbus slave device. So, how can you program an Arduino to act as a Modbus device? There is a twist, however. The devices with which the PLC is communicating are Arduinos. A situation arises where you have a system that includes a PLC, an HMI, and some peripheral devices. The HMI displays some information to a user and allows for some basic control and the PLC manages data collection and communication through an RS485 network using a Modbus RTU protocol.Įasy, right? Many PLCs already support RS485 and Modbus communication and only require a few functions blocks.
