Sensirion SHT30-DIS I2C Humidity & Temperature Sensor
Sensirion SHT30-DIS I2C Humidity & Temperature Sensor
The Sensirion SHT30-DIS is a high-accuracy, low-power digital humidity and temperature sensor that communicates over the I2C bus. This sensor is designed for a wide range of applications, including industrial, consumer, and IoT devices, where precise and reliable environmental monitoring is essential.
| The SHT30-DIS sensor measures relative humidity (RH) and temperature with high precision and accuracy. The sensor's functionality can be summarized as follows |
Measures relative humidity (RH) in the range of 0-100% RH
Measures temperature in the range of -40C to 125C
Provides accurate and reliable measurements with low power consumption
Communicates with a microcontroller or other devices over the I2C bus
The Sensirion SHT30-DIS I2C humidity and temperature sensor is a high-accuracy, low-power digital sensor that offers reliable and accurate measurements for a wide range of applications. Its compact form factor, low power consumption, and I2C interface make it an ideal choice for integrating into a variety of systems and devices.
Sensirion SHT30-DIS I2C Humidity & Temperature Sensor DocumentationOverviewThe Sensirion SHT30-DIS is a high-accuracy, low-power humidity and temperature sensor that communicates over I2C. It is designed for use in a wide range of applications, including IoT devices, wearables, and industrial automation systems. This documentation provides a detailed overview of the sensor's features, pinout, and usage examples.FeaturesHigh accuracy: 2% RH, 0.2C
Low power consumption: 2.1mA (typical)
I2C interface: 100 kHz, 400 kHz, and 1 MHz
Operating temperature range: -40C to 125C
Humidity range: 0% to 100% RH
Supply voltage: 1.8V to 3.6VPinoutThe SHT30-DIS sensor has a 6-pin package with the following pinout:VCC (1): Power supply (1.8V to 3.6V)
GND (2): Ground
SCL (3): I2C clock line
SDA (4): I2C data line
NC (5): Not connected
ADDR (6): I2C address pin (pull-up or pull-down for address selection)Usage ExamplesExample 1: Arduino SketchThis example demonstrates how to use the SHT30-DIS sensor with an Arduino board to read temperature and humidity values.```cpp
#include <Wire.h>#define SHT30_ADDRESS 0x40 // Default I2C addressvoid setup() {
Serial.begin(9600);
Wire.begin();
}void loop() {
uint16_t humidity, temperature;// Read humidity and temperature values
humidity = readHumidity();
temperature = readTemperature();Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %RH");
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" C");delay(1000);
}uint16_t readHumidity() {
uint8_t data[2];
Wire.beginTransmission(SHT30_ADDRESS);
Wire.write(0x00); // Command to read humidity
Wire.endTransmission();
Wire.requestFrom(SHT30_ADDRESS, 2);
data[0] = Wire.read();
data[1] = Wire.read();
return (data[0] 256 + data[1]) 0.00190734863; // Convert to %RH
}uint16_t readTemperature() {
uint8_t data[2];
Wire.beginTransmission(SHT30_ADDRESS);
Wire.write(0x00 | 0x8100); // Command to read temperature
Wire.endTransmission();
Wire.requestFrom(SHT30_ADDRESS, 2);
data[0] = Wire.read();
data[1] = Wire.read();
return -45.0 + (data[0] 256 + data[1]) 0.002116695; // Convert to C
}
```Example 2: Python Script with Raspberry PiThis example demonstrates how to use the SHT30-DIS sensor with a Raspberry Pi to read temperature and humidity values using Python.```python
import smbus
import time# I2C bus and address
bus = smbus.SMBus(1)
address = 0x40def read_humidity():
bus.write_byte(address, 0x00) # Command to read humidity
data = bus.read_i2c_block_data(address, 0x00, 2)
return (data[0] << 8 | data[1]) 0.00190734863def read_temperature():
bus.write_byte(address, 0x00 | 0x8100) # Command to read temperature
data = bus.read_i2c_block_data(address, 0x00, 2)
return -45.0 + (data[0] << 8 | data[1]) 0.002116695while True:
humidity = read_humidity()
temperature = read_temperature()
print(f"Humidity: {humidity:.2f}%RH")
print(f"Temperature: {temperature:.2f}C")
time.sleep(1)
```Example 3: C Code for MicrocontrollersThis example demonstrates how to use the SHT30-DIS sensor with a microcontroller (e.g., STM32) to read temperature and humidity values using C code.```c
#include <i2c.h>#define SHT30_ADDRESS 0x40uint16_t readHumidity() {
uint8_t data[2];
i2c_start();
i2c_send(SHT30_ADDRESS, 0x00); // Command to read humidity
i2c_restart();
i2c_recv(SHT30_ADDRESS, data, 2);
i2c_stop();
return (data[0] << 8 | data[1]) 0.00190734863;
}uint16_t readTemperature() {
uint8_t data[2];
i2c_start();
i2c_send(SHT30_ADDRESS, 0x00 | 0x8100); // Command to read temperature
i2c_restart();
i2c_recv(SHT30_ADDRESS, data, 2);
i2c_stop();
return -45.0 + (data[0] << 8 | data[1]) 0.002116695;
}int main() {
while (1) {
uint16_t humidity = readHumidity();
uint16_t temperature = readTemperature();
printf("Humidity: %d.%02d%%RH
", humidity / 100, humidity % 100);
printf("Temperature: %d.%02dC
", temperature / 100, temperature % 100);
delay(1000);
}
return 0;
}
```These examples demonstrate the basic usage of the SHT30-DIS sensor in various contexts. You can modify and expand upon these examples to fit your specific application requirements.