Difference: SHT30NopI2CTemperatureAndHumiditySensor (5 vs. 6)

Revision 62020-10-12 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

The SHT30 I2C Temperature and Humidity Sensor

Introduction

Changed:
<
<
The SHT30 is a temperature and humidity sensor for the I2C bus. Typical accuracy for temperature is +- 0.1 °C and +- 1.5% relative humidity. Sensirion, the company behind the SHT30 supplies a series of documents including the data sheet, several application notes and sample code, written in C for the STM32F10x micro-controller. You can find them at https://www.sensirion.com/en/download-center/humidity-sensors/digital-humidity-sensors-for-various-applications.
>
>
The SHT30 is a temperature and humidity sensor that communicates over the I2C bus. Typical accuracy for temperature is +- 0.1 °C and +- 1.5% relative humidity. Sensirion, the company behind the SHT30 supplies a series of documents including the data sheet, several application notes and sample code, written in C for the STM32F10x micro-controller. You can find them at https://www.sensirion.com/en/download-center/humidity-sensors/digital-humidity-sensors-for-various-applications.
 
Changed:
<
<
There is also a SHT30 driver written for MicroPython on the ESP8266 but unfortunately it did not work on the ESP32 out of the box. Making it work for the ESP32 is not too difficult however and this is the subject of an exercise on the SHT30 ( The I2C bus and the SHT30 Temperature and Humidity Sensor ). Since the SHT30 driver only implements a small subset of the SHT30 functionality I developed a driver called SHT3X translating the Sensirion code into MicroPython and taking over some of the SHT30 code.
>
>
There is also a SHT30 driver written for MicroPython on the ESP8266 but unfortunately it did not work on the ESP32 out of the box. Making it work for the ESP32 is not too difficult however. This is the subject of an exercise on the SHT30 ( The I2C bus and the SHT30 Temperature and Humidity Sensor ). Since the SHT30 driver only implements a small subset of the SHT30 functionality, I developed a driver called SHT3X translating the Sensirion code into MicroPython and taking over some of the SHT30 code.
  Here is a list of functions, their command codes and if they are implemented in the SHT30 driver:
Line: 51 to 51
 

The SHT30 command codes

Changed:
<
<
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:
>
>
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:
  sht30commandCode.png
Line: 97 to 96
  sht30.getTempAndHumi(clockStretching=!SHT3X.CLOCK_STRETCH, repeatability=!SHT3X.REP_S_LOW, raw=False, timeout=100)
Changed:
<
<
get temperature and humidity in the selected mode. If clock stretching as been selected the corresponding command 0x2cxx is issued followed by a wait until the measurement has been completed. The wait time used is the maximum measurement time for that mode found in table 4 chapter 2.2 of the data sheet.
>
>
gets temperature and humidity in the selected mode. If clock stretching as been selected the corresponding command 0x2cxx is issued followed by a wait until the measurement has been completed. The wait time used is the maximum measurement time for that mode found in table 4 chapter 2.2 of the data sheet.
 
Changed:
<
<
If no clock stretching is selected the method will poll the sht30 every ms for the result data. It within "timeout ms" the sht30 does not return the result an SHT3X.TIMEOUT error is raised.
>
>
If no clock stretching is selected, the method will poll the sht30 every ms for the result data. It within "timeout ms" the sht30 does not return the result an SHT3X.TIMEOUT error is raised.
  After the wait, the data are read out and the checksum checked. If the checksum received is wrong an SHT3X.CRC_ERROR is raised.
Changed:
<
<
If raw mode has been selected the 6 byte result (16 bits for temperature, 16 bits humidity and 2*8 bits checksums) is returned. Otherwise the raw values are converted to physical temperature values (in °C) and relative humidity (in %) which are returned to the caller.
>
>
If raw mode has been selected, the 6 byte result (16 bits for temperature, 16 bits humidity and 2*8 bits checksums) is returned. Otherwise the raw values are converted to physical temperature values (in °C) and relative humidity (in %) which are returned to the caller.
  sht30.Celsius2Fahrenheit(tempC): takes a temperature value in °C and converts it to °F
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback