Arduino's are very popular for DIY or IoT projects involving a small computerized controller board, some GPIO pins to read inputs from the environment or to control devices, with optional communication with remote services. Theoretically an Arduino, or for that matter larger computers like the Raspberry Pi, can replace the PLC devices commonly used in industrial control applications. Why spend several hundred dollars on an expensive PLC device when the same goal can be achieved more flexibly and inexpensively with newfangled embedded computers like the Arduino?
A key to this is for an Arduino (or other embedded control computer) to interface with MODBUS and other protocols used in industrial settings. In this article we'll go over using an RS-485 Shield for Arduino, using it to communicate with the simple MODBUS temperature sensor we're using.
The libraries we'll discuss in this article enable using the Arduino as either MODBUS Master or Slave. The last is interesting considering the huge variety of sensors available for Arduino. Consider a simple energy monitoring project - One can interface a CT (current transformer) to measure the current in a circuit, and directly measure the voltage using an analog input, a Sketch could read that data from the sensor, and make it available via MODBUS. An Arduino could be a very simple and inexpensive device in a MODBUS network.