|
META TOPICPARENT |
name="WebHome" |
The SHT30 I2C Temperature and Humidity Sensor
Introduction |
|
Write low alert limit |
set |
0x610B |
no |
clear |
0x6100 |
no |
|
|
> > | The SHT30 command codes
The SHt30 uses 16 bit command codes with a 3 bit CRC (cyclic redundancy check) calculated over the upper 13 bit added on the lowest significant 3 bits. Let us have a look at the "one time measurement" commands in order to understand the command layout. Here is the table from the data sheet:
If we analyze the codes we get:
Repeatability |
Clock Stretching |
Command code |
bit for clock stretching |
rest of command code |
bits for repeatability |
CRC |
High |
enabled |
0010 |
1 |
100 |
0000 0 |
110 |
Medium |
0010 |
1 |
100 |
0000 1 |
101 |
Low |
0010 |
1 |
100 |
0001 0 |
000 |
High |
disabled |
0010 |
0 |
100 |
0000 0 |
000 |
Medium |
0010 |
0 |
100 |
0000 1 |
011 |
Low |
0010 |
0 |
100 |
0001 0 |
110 |
As you can see, knowing the repeatability and the clock stretching parameter we can easily construct the command code: Starting from a command code 0x2400 we set bit 11 if clock stretching is enabled and we "or" 01 into bits 3 and 4 for medium and 10 for low repeatability to get the command code. This code we use as a key into a dictionary from where we can pick up the 3 bit checksum, which we or to bits 0..2 . |
| Methods available in the SHT3X class
Here is a list of the available methods of the SHT3Xclass: |
|
META FILEATTACHMENT |
attachment="sht3x.py.txt" attr="" comment="" date="1590263292" name="sht3x.py.txt" path="sht3x.py.txt" size="18915" user="UliRaich" version="1" |
META FILEATTACHMENT |
attachment="sht3xTest.py.txt" attr="" comment="" date="1590263292" name="sht3xTest.py.txt" path="sht3xTest.py.txt" size="2814" user="UliRaich" version="1" |
|
|
> > |
META FILEATTACHMENT |
attachment="sht30commandCode.png" attr="" comment="" date="1590343860" name="sht30commandCode.png" path="sht30commandCode.png" size="25369" user="UliRaich" version="1" |
|