SHT-20 Temperature & Humidity Sensor Modbus RS485 High Precision
Product adopts industrial-grade chip, high-precision SHT20 temperature and humidity sensors, ensure the products with good reliability, high precision and interchangeability.
Adopt RS485 hardware interface (with the lightning protection design), the protocol layer compatible with standard industrial Modbus Rtu protocol.
This product integrating MODBUS protocol with ordinary, users can choose communication protocols, common agreement with automatic upload function(Connect the RS485 serial interface mode tool by automatically output temperature and humidity).
Industrial products, high progress SHT20 temperature and humidity sensor, the RS485 communication;
Standard MODBUS protocol with ordinary at an organic whole, the user can choose communication protocol;
Baud rate can decide for themselves;
General agreement with automatic upload function, upload speed can decide for themselves.
Work voltage: DC4-30 v (highest do not exceed 33 v) .
Most powerful: 0.2 W .
Work environment: Temperature 20 ℃ – 60 ℃, Humidity 0-100.
Control precision: Temperature±0.3℃, Humidity ±3%RH.
Output interface: RS485 communication (standard MODBUS protocol and custom ordinary), see note agreement device.
Device address: 1-247 can be set, the default is 1.
Baud rate: 9600(the user can set), 8bits, one stop, no check;
Shape size:60*30*18(mm)
MODBUS protocol
Function code used by the product:
0x03: read holding register
0x04: Read input register
0x06: Write a single holding register
0x10: Write multiple holding registers
Register type | Register address | Data content | Number of bytes |
Input register | 0x0001 | Temperature value | 2 |
0x0002 | Humidity value | 2 | |
Holding register | 0x0101 | Device address ( 1~247 ) | 2 |
0x0102 | Baud rate 0:9600 1:14400 2:19200 | 2 | |
0x0103 | Temperature correction value (/10) -10.0~10.0 | 2 | |
0x0104 | Humidity correction value (/10) -10.0~10.0 | 2 |
Modbus communication format :
The host sends a data frame:
Slave address | function code | Register address High byte | Register address Low byte | Number of registers High byte | Number of registers Low byte | CRC High byte | CRC Low byte |
Slave response data frame:
Slave address | Response function code | Number of bytes | Register1 data High byte | Register1 data Low byte | RegisterN data High byte | RegisterN data Low byte | CRC High byte | CRC Low byte |
MODBUS command frame
The host reads the temperature command frame (0x04) :
Slave address | function code | Register address High byte | Register address Low byte | Number of registers High byte | Number of registers Low byte | CRC High byte | CRC Low byte |
0x01 | 0x04 | 0x00 | 0x01 | 0x00 | 0x01 | 0x60 | 0x0a |
Slave response data frame:
Slave address | function code | Number of bytes | temperature High byte | temperature Low byte | CRC High byte | CRC Low byte |
0x01 | 0x04 | 0x02 | 0x01 | 0x31 | 0x79 | 0x74 |
Temperature value = 0x131, converted to decimal 305 , actual temperature value = 305 / 10 = 30.5 °C
NOTE: Symbol temperature is 16 hexadecimal, temperature = 0xFF33, converted to decimal -205 actual temperature = -20.5deg.] C;
The host reads the humidity command frame (0x04) :
Slave address | function code | Register address High byte | Register address Low byte | Number of registers High byte | Number of registers Low byte | CRC High byte | CRC Low byte |
0x01 | 0x04 | 0x00 | 0x02 | 0x00 | 0x01 | 0xC1 | 0xCA |
Slave response data frame:
Slave address | function code | Number of bytes | humidity High byte | humidity Low byte | CRC High byte | CRC Low byte |
0x01 | 0x04 | 0x02 | 0x02 | 0x22 | 0xD1 | 0xBA |
Humidity value = 0x222, converted to decimal 546 , actual humidity value = 546 / 10 = 54.6% ;
Continuous reading of the temperature and humidity command frame (0x04) :
Slave address | function code | Register address High byte | Register address Low byte | Number of registers High byte | Number of registers Low byte | CRC High byte | CRC Low byte |
0x01 | 0x04 | 0x00 | 0x01 | 0x00 | 0x02 | 0x20 | 0x0B |
Slave response data frame:
Slave address | function code | Number of bytes | temperature High byte | temperature Low byte | humidity High byte | humidity Low byte | CRC High byte | CRC Low byte |
0x01 | 0x04 | 0x04 | 0x01 | 0x31 | 0x02 | 0x22 | 0x2A | 0xCE |
Read the contents of the holding register (0x03) :
Take the slave address as an example:
Slave address | function code | Register address High byte | Register address Low byte | Number of registers High byte | Number of registers Low byte | CRC High byte | CRC Low byte |
0x01 | 0x03 | 0x01 | 0x01 | 0x00 | 0x01 | 0xD4 | 0x0F |
Slave response frame:
Slave address | function code | Number of bytes | Slave address High byte | Slave address Low byte | CRC High byte | CRC Low byte |
0x01 | 0x03 | 0x02 | 0x00 | 0x01 | 0x30 | 0x18 |
Modify the contents of the holding register (0x06) :
To modify the slave address as an example:
Slave address | function code | Register address High byte | Register address Low byte | Register value High byte | Register value Low byte | CRC High byte | CRC Low byte |
0x01 | 0x06 | 0x01 | 0x01 | 0x00 | 0x08 | 0xD4 | 0x0F |
Modify slave address : 0x08 = 8
Slave response frame ( same as send ) :
Slave address | function code | Register address High byte | Register address Low byte | Register value High byte | Register value Low byte | CRC High byte | CRC Low byte |
0x01 | 0x06 | 0x01 | 0x01 | 0x00 | 0x08 | 0xD4 | 0x0F |
Continuously modify the holding register (0x10) :
Slave address | function code | initial address High byte | initial address Low byte | Number of registers High byte | Number of registers Low byte | Number of bytes | Register1 high byte | Register1 low byte | Register2 high byte | Register2 low byte | CRC High byte | CRC Low byte |
0x01 | 0x06 | 0x01 | 0x01 | 0x00 | 0x02 | 0x04 | 0x00 | 0x20 | 0x25 | 0x80 | 0x25 | 0x09 |
Modify slave address : 0x20 = 32
Baud rate : 0x2580 = 9600
Slave response frame:
Slave address | function code | Register address High byte | Register address Low byte | Number of registers High byte | Number of registers Low byte | CRC High byte | CRC Low byte |
0x01 | 0x06 | 0x00 | 0x11 | 0x00 | 0x04 | 0xD4 | 0x0F |
Normal version agreement
The baud rate defaults to 9600 (user can set it by itself), 8 -bit data, 1 bit stop, no parity
RS485 communication
Serial command | Description |
READ | Trigger a temperature and humidity report (27.4 °C , 67.7% temperature27.4 °C humidity 67.7%) |
AUTO | Start the automatic temperature and humidity reporting function ( ibid. ) |
STOP | Stop temperature and humidity automatic reporting |
BR: XXXX | Set baud rate 9600~19200 (BR: 9600 baud rate is9600) |
TC: XX.X | Set temperature calibration (-10.0~10.0) (TC: 02.0 temperature correction value is 2.0°C ) |
HC: XX.X | Set humidity calibration (-10.0~10.0) (HC:-05.1 humidity correction value is-5.1%) |
HZ: XXX | Set the temperature and humidity reporting rate (0.5,1,2,5,10) (HZ: 2 automatic reporting rate 2Hz) |
PARAM | Read system current settings |
PARAM instruction :
TC: 0.0, HC: 0.0, BR: 9600, HZ: 1 -> Temperature correction value 0.0 Humidity correction value 0.0 Baud rate 9600Reporting rate 1 Hz
SLAVE_ADD: 1 -> MODBUS slave address 0x01