RS-485 and Modbus in Industrial IoT
Discover how RS-485 and Modbus work together in Industrial IoT to connect sensors, meters, and machines with IoT gateways and cloud platforms.
By Paranitharan K5 min read
How Industrial Sensors Communicate with IoT Gateways
Introduction
Industrial machines generate a large amount of data every day. Temperature, pressure, voltage, current, energy consumption, vibration, humidity, and many other parameters need to be measured and monitored.To collect this information, industries use sensors, energy meters, PLCs, controllers, and other field devices. But collecting data from these devices requires a reliable communication method.This is where RS-485 and Modbus become important.
RS-485 provides a reliable electrical communication interface, while Modbus defines how devices exchange information. Together, they are widely used in industrial automation and Industrial IoT (IIoT).
Industrial Sensors
↓
RS-485 Bus
↓
Modbus RTU
↓
IoT Gateway / ESP32
↓
MQTT
↓
Cloud / Server
↓
IoT DashboardWhat is Industrial IoT?
Industrial IoT (IIoT) is the use of connected sensors, machines, gateways, software, and communication technologies to collect and analyze industrial data.
For example, imagine a manufacturing machine equipped with sensors.
The sensors measure:
Temperature
Voltage
Current
Power
Pressure
Vibration
Humidity
Machine status
Instead of manually checking these values, an IoT system can automatically collect the data and display it on a dashboard.
For example:
Temperature = 42°C
Voltage = 415 V
Current = 8.2 A
Power = 4.7 kW
Status = RunningThe data can also be stored in a database and used for alerts, energy monitoring, anomaly detection, and predictive maintenance.
But how does the IoT gateway collect data from industrial sensors?
One common answer is:
RS-485 + Modbus.
What is RS-485?
RS-485 is an electrical communication standard commonly used for communication between industrial devices.
It is designed to work reliably over relatively long cable distances and in electrically noisy environments.
RS-485 commonly uses two signal wires:
A
BThese wires carry a differential signal.
Instead of measuring one signal against ground, the receiver determines the signal from the voltage difference between the two communication lines.
This helps RS-485 handle electrical noise better than many simple single-ended communication methods.
RS-485 Is Not a Protocol
This is one of the most important concepts to understand.
RS-485 is not a data protocol.
RS-485 mainly defines electrical characteristics for serial communication.
It does not tell us:
What a temperature value means
Which device should respond
Which register contains the temperature
How a command is structured
How the received bytes should be interpreted
That is where a protocol such as Modbus comes in.
Think of it like this:
RS-485
= How the electrical signals are transmitted
Modbus
= How the devices organize and exchange the dataWhat is Modbus?
Modbus is a communication protocol used by industrial electronic devices to exchange data.
It was originally developed for industrial automation and is now widely encountered in sensors, meters, PLCs, controllers, and gateways.
Modbus defines concepts such as:
Device addresses
Function codes
Registers
Data values
Requests
Responses
Error checking
A device might have registers containing values such as:
Register 100 → Temperature
Register 101 → Humidity
Register 102 → Voltage
Register 103 → CurrentThe exact register addresses and data formats depend on the particular device.
What is Modbus RTU?
One of the most common Modbus implementations used over serial communication is Modbus RTU.
RTU stands for Remote Terminal Unit.
Modbus RTU uses a compact binary representation of data and includes error checking.
A typical Modbus RTU communication involves:
Master / Client
↓
Request
↓
Slave / Server
↓
Response
↓
Master / ClientThe actual communication is transmitted as bytes rather than human-readable text.
Modbus Master and Slave
Traditional Modbus terminology commonly describes a Master communicating with one or more Slaves.
In newer Modbus documentation, the terms Client and Server are also used.
For a simple Modbus RTU system:
Master
IoT Gateway
|
-------------------
| | |
Slave Slave Slave
Sensor Meter SensorThe master initiates communication.
The slave normally responds when it receives a valid request addressed to it.
Function Codes
Modbus uses function codes to tell the device what operation is being requested.
Common examples include:
01 – Read Coils
02 – Read Discrete Inputs
03 – Read Holding Registers
04 – Read Input Registers
05 – Write Single Coil
06 – Write Single Register
16 (0x10) – Write Multiple Registers
For example, a gateway may use Function Code 03 to read holding registers from a device.
The correct function code depends on how the device exposes its data.
What is CRC in Modbus RTU?
Industrial communication can experience transmission errors.
Modbus RTU uses CRC (Cyclic Redundancy Check) to help detect errors in a message.
A simplified Modbus RTU frame contains:
┌─────────┬────────────┬────────────┬─────────┐
│ Address │ Function │ Data │ CRC │
└─────────┴────────────┴────────────┴─────────┘The receiving device calculates the CRC from the received message and compares it with the transmitted CRC.
If the check does not match, the message can be treated as corrupted.
This helps improve communication reliability.
Why RS-485 and Modbus Are Still Important
Industrial facilities often contain equipment that was installed years ago.
Replacing every existing sensor or machine with a modern IoT-enabled device can be expensive and impractical.
Many existing devices already support:
RS-485
Modbus RTU
Modbus TCP
Other industrial protocols
An IoT gateway can connect this existing equipment to modern cloud systems.
For example:
Existing Industrial Equipment
↓
Modbus / RS-485
↓
Gateway
↓
MQTT
↓
Modern IoT PlatformThis allows organizations to add monitoring and analytics without necessarily replacing every field device.
RS-485 + Modbus + MQTT
One of the most useful combinations in Industrial IoT is:
Modbus RTU + RS-485 + MQTTEach technology has a different role.
RS-485
Provides the physical communication interface.
Modbus
Defines how industrial data is requested and represented.
MQTT
Provides lightweight publish/subscribe messaging for networked IoT systems.
Together:
Industrial Sensor
↓
RS-485 / Modbus
↓
IoT Gateway
↓
MQTT
↓
MQTT Broker
↓
Cloud Application
↓
DashboardThis architecture connects traditional industrial equipment with modern IoT systems.
Conclusion
RS-485 and Modbus are important technologies in Industrial IoT because they provide a practical way to connect industrial sensors, meters, PLCs, and other field devices to IoT gateways.
The key idea is simple:
RS-485 provides the physical communication interface, while Modbus defines the communication protocol.
An IoT gateway can collect Modbus data through RS-485 and then forward that information to modern IoT systems using technologies such as MQTT, Ethernet, or Wi-Fi.
Although newer technologies continue to develop, RS-485 and Modbus remain highly relevant because they provide a practical way to connect existing industrial equipment to modern IoT platforms.
Understanding these technologies is therefore an important foundation for anyone working with Industrial IoT, automation, embedded systems, IoT gateways, and industrial data analytics.
- RS-485
- Modbus
- Industrial IoT
- Modbus RTU
- IoT Gateway
- Industrial Automation
- IoT Communication
- MQTT
- ESP32
- Industrial Sensors