Kernel driver sht3x

Supported chips:

Author:

Description

This driver implements support for the Sensirion SHT3x-DIS chip, a humidityand temperature sensor. Temperature is measured in degrees celsius, relativehumidity is expressed as a percentage. In the sysfs interface, all values arescaled by 1000, i.e. the value for 31.5 degrees celsius is 31500.

The device communicates with the I2C protocol. Sensors can have the I2Caddresses 0x44 or 0x45, depending on the wiring. SeeDocumentation/i2c/instantiating-devices.rst for methods to instantiate the device.

There are two options configurable by means of sht3x_platform_data:

  1. blocking (pull the I2C clock line down while performing the measurement) ornon-blocking mode. Blocking mode will guarantee the fastest result butthe I2C bus will be busy during that time. By default, non-blocking modeis used. Make sure clock-stretching works properly on your device if youwant to use blocking mode.
  2. high or low accuracy. High accuracy is used by default and using it isstrongly recommended.

The sht3x sensor supports a single shot mode as well as 5 periodic measuremodes, which can be controlled with the update_interval sysfs interface.The allowed update_interval in milliseconds are as follows:

0 single shot mode
20000.5 Hzperiodic measurement
10001 Hzperiodic measurement
5002 Hzperiodic measurement
2504 Hzperiodic measurement
10010 Hzperiodic measurement

In the periodic measure mode, the sensor automatically triggers a measurementwith the configured update interval on the chip. When a temperature or humidityreading exceeds the configured limits, the alert attribute is set to 1 andthe alert pin on the sensor is set to high.When the temperature and humidity readings move back between the hysteresisvalues, the alert bit is set to 0 and the alert pin on the sensor is set tolow.

sysfs-Interface

temp1_input:temperature input
humidity1_input:humidity input
temp1_max:temperature max value
temp1_max_hyst:temperature hysteresis value for max limit
humidity1_max:humidity max value
humidity1_max_hyst:humidity hysteresis value for max limit
temp1_min:temperature min value
temp1_min_hyst:temperature hysteresis value for min limit
humidity1_min:humidity min value
humidity1_min_hyst:humidity hysteresis value for min limit
temp1_alarm:alarm flag is set to 1 if the temperature is outside theconfigured limits. Alarm only works in periodic measure mode
humidity1_alarm:alarm flag is set to 1 if the humidity is outside theconfigured limits. Alarm only works in periodic measure mode
heater_enable:

heater enable, heating element removes excess humidity fromsensor:

  • 0: turned off
  • 1: turned on
update_interval:update interval, 0 for single shot, interval in msecfor periodic measurement. If the interval is not supportedby the sensor, the next faster interval is chosen