Product description:
? ? ???The product adopts industrial-grade chip, high-precisionSHT20The temperature and humidity sensors, excellent reliability, high precision and interchangeability of the product.usingRS485Hardware interface(With lightning protection design), the protocol layer is compatible with industry standardModbus Rtu -The agreement.This product setMODBUSAgreement with ordinary at an organic whole, the user can choose communication protocols, common agreement with automatic upload function (The connectionRS485Through a serial port is automatically output mode tool temperature and humidity).
Product highlights:
Industrial products, high progressSHT20The temperature and humidity sensors,RS485Communication;
standardMODBUSAgreement 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.?
Product parameters:
Working voltage:DC4-30 v(the highest do not exceed33 v)
The most powerful:0.2 W.
Working temperature:The temperature- 20¡É+ 60¡ÉHumidity,0% RH to 100% RH
Accuracy:The temperature+ / - 0.3¡É(25¡É)Humidity,(25 + / - 3% RH¡É)
Output interface:RS485Communication (standardMODBUSProtocol and custom ordinary), as shown in the agreement
Device address:Can be set up1-247.By default,1
Baud rate:The default9600(the user can set),8Bits of data,1A stop, without checking
Size:60 * 30 * 18
?MODBUS?agreement
Function code used for the product:
0 x03:Reading a keep register
0 x04:?Read input register
0 x06:Write a single register
0 x10:Write more keep registers
Register type | Register address | The data content | The number of bytes |
The input registers | 0x0001 | Temperature value | 2 |
0 x0002 | Humidity value | 2 |
Keep a register | 0 x0101 | Device address (1-247) | 2 |
0 x0102 | Baud rate 0:9 600 And 400 200: | 2 |
0 x0103 | The temperature at(/ 10) 10.0 ~ 10.0 | 2 |
0 x0104 | Humidity is revised(/ 10) 10.0 ~ 10.0 | 2 |
Modbus?The communication format:
The host to send data frames:
From the machine address | Function code | Register address High byte | Register address The low byte | Register number High byte | Register number The low byte | CRC High byte | CRC The low byte |
|
|
|
|
|
|
|
|
The response data from the machine frame:
From the machine address | The response function code | The number of bytes | register1data High byte | register1data The low byte | registerNdata High byte | registerNdata The low byte | CRC High byte | CRC The low byte |
|
|
|
|
|
|
|
|
|
?MODBUSThe command frame
Host read temperature command frame(0 x04):
From the machine address | Function code | Register address High byte | Register address The low byte | Register number High byte | Register number The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x04 | 0x00 | 0 x01 | 0x00 | 0 x01 | 0 x60 | 0 x0a |
The response data from the machine frame:
From the machine address | Function code | The number of bytes | The temperature High byte | The temperature The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x04 | 0 x02 | 0 x01 | 0 x31 | 0 x79 | 0 x74 |
Temperature value= 0 x131,Converted to a decimal305, the actual temperature?= 305/10 = 30.5¡É
Note: the temperature is a symbol16Hexadecimal number, temperature= 0 xff33,Converted to a decimal?- 205., the actual temperature= 20.5¡É;
Host read humidity command frame(0 x04):
From the machine address | Function code | Register address High byte | Register address The low byte | Register number High byte | Register number The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x04 | 0x00 | 0 x02 | 0x00 | 0 x01 | 0 xc1 | 0 xca |
The response data from the machine frame:
From the machine address | Function code | The number of bytes | humidity High byte | humidity The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x04 | 0 x02 | 0 x02 | 0 x22 | 0 xd1 | 0 xba |
Humidity value= 0 x222,Converted to a decimal546, the moisture content of the actual value= 546/10 = 54.6%;
Continuous read temperature and humidity command frame(0 x04):
From the machine address | Function code | Register address High byte | Register address The low byte | Register number High byte | Register number The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x04 | 0x00 | 0 x01 | 0x00 | 0 x02 | 0 x20 | 0 x0b |
The response data from the machine frame:
From the machine address | Function code | The number of bytes | The temperature High byte | The temperature The low byte | humidity High byte | humidity The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x04 | 0 x04 | 0 x01 | 0 x31 | 0 x02 | 0 x22 | 0 x2a | 0 xce |
Read the contents of the registers(0 x03):
Take the case of reading from the machine address:
From the machine address | Function code | Register address High byte | Register address The low byte | Register number High byte | Register number The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x03 | 0 x01 | 0 x01 | 0x00 | 0 x01 | 0 xd4 | 0 x0f |
Response from the machine frame:
From the machine address | Function code | The number of bytes | From the machine address High byte | From the machine address The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x03 | 0 x02 | 0x00 | 0 x01 | 0 x30 | 0 x18 |
Modify the contents of the registers(0 x06):
To modify the machine address, for example:
From the machine address | Function code | Register address High byte | Register address The low byte | Register values High byte | Register values The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x06 | 0 x01 | 0 x01 | 0x00 | 0 x08 | 0 xd4 | 0 x0f |
Modify the machine address: 0 x08 = 8
The response from the machine frame(And send the same):
From the machine address | Function code | Register address High byte | Register address The low byte | Register values High byte | Register values The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x06 | 0 x01 | 0 x01 | 0x00 | 0 x08 | 0 xd4 | 0 x0f |
Continuously change keep registers(0 x10):
From the machine address | Function code | The starting address High byte | The starting address The low byte | Register number High byte | Register number The low byte | The number of bytes | register1High byte | register1The low byte | register2High byte | register2The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x06 | 0 x01 | 0 x01 | 0x00 | 0 x02 | 0 x04 | 0x00 | 0 x20 | 0 x25 | 0 x80 | 0 x25 | 0 x09 |
Modify the machine address: 0 x20 = 32
Baud rate: 0 x2580 = 9600
Response from the machine frame:
From the machine address | Function code | Register address High byte | Register address The low byte | Register number High byte | Register number The low byte | CRC High byte | CRC The low byte |
0 x01 | 0 x06 | 0x00 | 0x11 | 0x00 | 0 x04 | 0 xd4 | 0 x0f |
? ? ? ? ? ? ? ? ? ?Ordinary version of the agreement
The default baud rates,9600(the user can set),8Bits of data,1A stop, without checking
RS485 communication
A serial port command | instructions |
READ | Report triggered a temperature and humidity (27.4¡É67.7%,?The temperature27.4¡É humidity67.7%) |
AUTO | Start the temperature and humidity automatically report function (Same as above) |
STOP | Stop the temperature and humidity automatically report function |
BR: XXXX | Set the baud rate 9600 ~ 19200 (BR: 9600?Baud rate for9600). |
TC: XX. X | Set the temperature calibration (10.0 ~ 10.0) (TC: 02.0Revised for temperature2.0¡É) |
HC: XX. X | Set the humidity calibration (10.0 ~ 10.0) (HC: 05.1?Humidity is revised- 5.1%) |
HZ: XXX | Set the temperature and humidity reporting rate (0.5, 1,2,5,10) (HZ: 2?Automatically report rate?2 hz) |
PARAM | Read the system current Settings |
PARAMinstruction:
TC: 0.0, HC: 0.0, BR: 9600 HZ: 1- >The temperature at0.0Humidity is revised0.0Baud rate9600Report the rate?1 hz
SLAVE_ADD: 1.?- >MODBUSFrom the machine address?0 x01