ModbusCloud
Back to library
Liyuan Technology Liyuan Technology RS485 Temperature and Humidity Transmitter Modbus RTU template
Modbus RTU

Liyuan Technology RS485 Temperature and Humidity Transmitter

Liyuan Technology

RS485 temperature and humidity transmitter: humidity, temperature, address, baud rate and calibration over Modbus RTU.

Overview

This is an RS485 temperature and humidity transmitter that reports relative humidity and air temperature over Modbus RTU at 0.1 resolution. The template follows the communication protocol manual from Liyuan Technology (Shenzhen) Co., Ltd: humidity at 0x0000 and temperature at 0x0001, both ten times the actual value, with temperature signed below 0 °C. It also includes the settings registers: device address, baud rate code, the humidity address register and the calibration registers. The sensor runs on 5 to 30 V DC, refreshes its readings every second and is accurate to 3 %RH and 0.3 °C at 25 °C. Default connection: address 1, 9600 baud, 8 data bits, no parity, 1 stop bit.

Key readings

  • Relative humidity in %RH (0.1 resolution)
  • Temperature in °C (0.1 resolution, negative values supported)
  • Device address (factory default 1)
  • Baud rate code (factory default 9600 baud)
  • Temperature and humidity correction values

Available commands

  • Device address (FC 06 to register 0x0100)
  • Baud rate code (FC 06 to register 0x0101)
  • Temperature correction value
  • Humidity correction value

Use cases

  • Log Temperature and Humidity in a cold store, server room or warehouse and keep a year of history per sensor.
  • Set a threshold alarm on Humidity for a greenhouse or archive so you get an email when it rises above your limit.
  • Watch Temperature below 0 °C in a freezer or outdoor cabinet; the signed register shows frost correctly.
  • Compare two sensors side by side and use Temperature Correction or Humidity Correction to align one that reads off.
  • Check Device Address and Baud Rate Code remotely before you add more sensors to the same RS485 line.

Installation

  1. 1Wire the sensor: red to +5 to 30 V DC, black to GND, yellow to RS485 A and green to RS485 B of the ModbusCloud Gateway. Add a 120 ohm terminating resistor at the end of a long line.
  2. 2Give every sensor on the bus its own address before you connect them together. The factory default is 1; change it with the configuration software or by writing Device Address.
  3. 3In ModbusCloud, add a Modbus device (RTU) with address 1, 9600 baud, 8 data bits, no parity and 1 stop bit, and import this template.
  4. 4Check the connection: Device Address should read 1 (or the address you set) and Humidity and Temperature should match the room.
  5. 5Read Baud Rate Code once at 9600 baud: it tells you which of the two code lists in the manual is correct before you change the speed.

Things to watch for

The sensor does not answer. What should I check?
The manual lists the usual causes: the wrong serial port selected, the wrong baud rate (factory default 9600 8N1), the RS485 bus disconnected, or A and B swapped (yellow is A, green is B). With a USB to RS485 adapter on a laptop, also check that its driver is installed. If none of that helps, the manual says the device may be damaged.
Readings drop out with many sensors or a long cable.
The manual advises powering the sensors close by rather than over a long cable, adding an RS485 booster (repeater) and fitting a 120 ohm terminating resistor. Also make sure every sensor has a unique address; two sensors on address 1 corrupt each other's answers.
Below freezing the temperature shows over 6500 °C.
Temperature is a signed 16-bit value (two's complement) with scale 0.1. Read as unsigned, -9.7 °C (0xFF9F) becomes 6549.3. This template already uses int16; check that a custom copy did not change it to uint16.
Which baud rate code is correct, 4 or 3 for 9600?
The manual gives two lists. The register table says 1 = 1200, 2 = 2400, 3 = 4800, 4 = 9600, 5 = 14400, 6 = 19200. The examples say 1200 to 19200 is 0 (printed as 01) to 5, so 3 = 9600, and use 1 for 4800, which matches neither. Read Baud Rate Code while the sensor still runs at the factory 9600: 4 means the table is right, 3 means the example list. Only then write a new code.
How do I write the address or a correction value?
Write with FC 06 to Device Address (0x0100) or a correction register; the manual's example 01 06 01 00 00 02 changes address 1 to 2. The correction registers are confusing: example 5.6 reads humidity correction at 0x0103 and example 5.7 temperature correction at 0x0104, while the table names 0x0104 temperature and 0x0105 humidity. The unit is not given, so read all three first and change one value by a small step to see its effect.

Registers (8)

8 read / 6 write

NameAddressFunctionTypeUnitAccess
Humidity•••••••••%RHR
Temperature•••••••••°CR
Device Address•••••••••R/W
Baud Rate Code•••••••••R/W
Humidity Address•••••••••R/W
Calibration Register 0x0103•••••••••R/W
Temperature Correction•••••••••R/W
Humidity Correction•••••••••R/W

Loading registers…

Read the Liyuan Technology RS485 Temperature and Humidity Transmitter remotely

We load the templates onto the gateway and set up your portal, you connect it at your customer's site. Tell us briefly what you need and we'll send a proposal.

From €295 + €149/year.

Prefer to configure it yourself? Order the gateway in the shop·Or see the live demo first

EU-hosted
Data in the Netherlands and Germany
Open standard
Based on Modbus RTU/TCP
Free to browse
No account or payment required
European company
Based in the Netherlands

More RTU templates