![arduino modbus rtu arduino modbus rtu](https://ae04.alicdn.com/kf/Hbf460f5f607a4edb866c4711308b60cbE.jpg)
Connecting the Raspberry Pi to RS485Īs RS485 is a bus with a differential signal a special RS485 transceiver is necessary. As only one member of the bus can talk at a time and everything happens on the same two lines the members mus switch between receive and send mode. A good description of the RS485 bus is in Wikipedia. But with a Raspberry Pi as the master this is rather unlikely. The downside is: When the master is down there is no communication at all. This is what I am looking for: One Raspberry Pi that reads all the sensors and controls all the actors. It also uses differential signals on the bus but has a master-slave structure with one single master that controls everything. RS485 also allows up to 32 devices connected to the same bus (or more with special drivers) and allows long distances of some hundreds of meters. CAN Bus is well suited for a decentral structure and still works (partially) when some of the bus members don’t work.
![arduino modbus rtu arduino modbus rtu](http://domoticx.com/wp-content/uploads/2018/01/Arduino-met-RS485-module-shield-900x1655.png)
One disadvantage is the small amount of data that can be sent in one message. The maximum length of the bus fits to my needs.
ARDUINO MODBUS RTU DRIVERS
This bus is a multi master architecture and allows for up to 32 members with standard drivers (or more with special drivers). It has a three wire bus with a differential signal on two wires to improve immunity against electromagnetic noise and GND. For more information see the Wikipedia article. RS232 is only good for connecting two devices and only for short distances of up to 15m. Transmitting and receiving can happen at the same time. TxD of the first device connects to RxD of the other device and vice versa. There are two wires for the data transfer: one for sending (TxD) and one for receiving (RxD). RS232 is a point-to point connection that connects two devices.
ARDUINO MODBUS RTU SERIAL
In the serial world there are a few classic connections that are mainly used. As only one member can talk at a time this will be slower than Ethernet but this isn’t a problem at all when operating a heating system. One telephone cable goes through all devices that are connected. Therefore, I chose the serial bus: Old school RS485 with a master-slave-communication. In my usecase Ethernet needs more hardware like switches and cables and consumes more energy. As I prefer a wired connection the choice is between Ethernet and a serial bus. So this is nothing new and first of all it’s about choosing the right connection and data protocol. My idea is to build a data communication for sensors like temperature sensors and actors like motorized valves to control the heating system of my home.