User Manual
Table Of Contents
User Guide
©2008-2020 Seeed Technology Co., Ltd. All rights reserved. solution.seeedstudio.com
23 / 23
When the host receives the 11 byte data returned by the sensor, the following CRC calculation is
performed, where num=11
Pseudo code as follows:
unsigned char response[11]={ 01 04 06 08 90 0E 93 02 4E D2 57};// The last two byte are the CHECK
CRC that the sensor returns
unsigned char num=11;// Calculate the entire return of the 11 CRC CHECK byte
unsigned int crc16=0;
crc16= calc_crc16 (response, num);
if(crc16==0)
{
// Check CRC correctly, you can use the returned data
}
else
{
// Check CRC error, can not be used to return the data
}
To get results back to 0 so the success of Check, if Check fails to return to a nonzero value.If the Check
does not succeed, it shows that the transmission process is wrong, should give up the collected data, re
collection.
The success of the Check, use the following formula to calculate the temperature (negative to
complement representation) and conductivity of H at the end of the 16 hexadecimal data:
temperature=(08H*256+90H)/100=2192/100=21.92 ℃
volumetric water content =(0EH*256+93H)/100=3731/100=37.31%
conductivity =02H*256+4EH=2*256+78 =590 μs/cm