www.dragino.com
LSN50 LoRa Sensor Node User Manual
25
/
60
2.4.6
I2C Interface (SHT20)
The PB6(SDA) and PB7(SCK) are I2C interface lines. You can use these to connect to an I2C
device and get the sensor data.
We have made an example to show how to use the I2C interface to connect to the SHT20
Temperature and Humidity Sensor. This is supported in the stock firmware since v1.5 with
AT+MOD=1 (default value).
Below is the connection to SHT20.
The device will be able to get the I2C sensor data now and upload to IoT Server.
Convert the read byte to decimal and divide it by ten.
Example:
Temperature: Read:0116(H) = 278(D) Value: 278 /10=27.8
℃
;
Humidity: Read:0248(H)=584(D) Value: 584 / 10=58.4, So 58.4%
If you want to use other I2C device, please refer the SHT20 part source code as reference.