Call Phone +8618073152920 Hotline: +8618073152920
Call Phone +8618073152920
English

CONTACT US/ CONTACT US
Consumer hotline +8618073152920
Changsha Zoko Link Technology Co., Ltd.

Email:Arvin@niubol.com

WhatsApp:+8615367865107

Address:Room 102, District D, Houhu Industrial Park, Yuelu District, Changsha City, Hunan Province, China

Position:Home >> Blogs >> Technical Support

Technical Support

How to Connect RS485 Sensors to PLCs, RTUs, Arduino and ESP32

Time:2026-09-07 16:27:28 Popularity:13

Connecting an RS485 sensor to different hosts essentially accomplishes two things: establish reliable physical communication, and then reading data according to the Modbus register table. The difference is only in the hardware interface of the host and the way the software is developed.

NiuBoL data logger and IoT gateway for sensor integration

Connect PLC or RTU

If the PLC/RTU has an RS485 interface, the sensor A/B lines can be connected to the corresponding terminals, and the DC power supply can be provided according to the sensor specifications. The host side needs to be configured with the same baud rate, data bits, stop bits and parity setting, and polled as a Modbus master.

  • Different device addresses must be used when multiple sensors share a bus.
  • The PLC side needs to process the magnification, decimal points and units according to the register table.
  • If the PLC has only a 4-20mA input but no RS485 port, the analog version should be selected or the protocol conversion module should be added.

Connect Arduino or ESP32

MCUs such as Arduino and ESP32 usually use TTL UART instead of directly outputting RS485 differential signals, so transceiver modules such as MAX485 and SP3485 are required to complete level conversion. The program is responsible for sending Modbus requests, calculating/verifying CRC, and parsing the returned data.

During the debugging phase, it is recommended to first verify the sensor on the computer with USB-RS485, and then migrate the communication parameters and registers that have been confirmed to be correct to the MCU program. This separates the sensor problem from the code problem.

Power supply cannot be ignored

The fact that the MCU can communicate does not mean that it can directly power the sensor. The sensor voltage and current should be configured according to the corresponding model specifications. Low-voltage systems, in particular, should consider starting current, cable voltage drop, and power ripple.

FAQ

Q1: Does NiuBoL provide an Arduino library for this sensor?

A1: The core data of the standard RS485 sensor is Modbus RTU communication protocol and register table. Users can use a standard Modbus library or write their own polling programs.

Q2: What happens to the A/B connection?

A2: Usually results in no returns or communication abnormalities. When debugging, check the wire label and terminal definition in the power-off state, and then power on again.

Q3: Why can't PLC be read by a computer?

A3: This usually means that the sensor and basic communication are normal. Focus on checking Slave ID, function code, register address, data type and serial port parameters of PLC.

Q4: Why is the data unstable when the power is on?

A4: Some sensors require a short start-up and stabilization time. The project can wait for a few seconds to tens of seconds after the power is turned on, and then start the formal polling.

Related recommendations

Sensors & Weather Stations Catalog

Agriculture Sensors and Weather Stations Catalog-NiuBoL.pdf

Weather Stations Catalog-NiuBoL.pdf

Agriculture Sensors Catalog-NiuBoL.pdf

Water Quality Sensor Catalog-NiuBoL.pdf

Related products

Tell us your requirements, Let's discuss more about your project.we can do more.

Name*

Tel*

Email*

Company*

Country*

Message

online
Contacts
Email
Top
XHow to Connect RS485 Sensors to PLCs, RTUs, Arduino and ESP32-Technical Support-Automatic Weather Stations_Industrial, Agricultural, Water & Environmental IoT Monitoring Solutions—NiuBoL

Screenshot, WhatsApp to identify the QR code

WhatsApp number:+8615367865107

(Click on WhatsApp to copy and add friends)

Open WhatsApp

The WhatsApp ID has been copied, please open WhatsApp to add consultation details!
WhatsApp