The SHT 40, manufactured by DFRobot (Part ID: SEN0428), is a digital humidity and temperature sensor that delivers highly accurate measurements for both parameters. It is designed with a compact form factor, low power consumption, and high precision, making it ideal for applications in environmental monitoring, HVAC systems, IoT devices, and industrial automation.
This sensor leverages advanced CMOSens® technology to ensure reliable performance and long-term stability. Its I2C interface simplifies integration into microcontroller-based systems, including Arduino and Raspberry Pi platforms.
Below are the key technical details of the SHT 40 sensor:
Parameter | Value |
---|---|
Supply Voltage | 2.4V to 5.5V |
Average Current | 0.4 µA (at 1 Hz measurement rate) |
Humidity Measurement Range | 0% RH to 100% RH |
Humidity Accuracy | ±1.8% RH (typical) |
Temperature Measurement Range | -40°C to 125°C |
Temperature Accuracy | ±0.2°C (typical) |
Communication Interface | I2C |
I2C Address | 0x44 (default) |
Operating Temperature | -40°C to 125°C |
Dimensions | 2.5 mm x 2.5 mm x 0.9 mm |
The SHT 40 sensor has four pins, as described in the table below:
Pin | Name | Description |
---|---|---|
1 | VDD | Power supply pin (2.4V to 5.5V) |
2 | GND | Ground pin |
3 | SDA | I2C data line |
4 | SCL | I2C clock line |
Below is an example of how to use the SHT 40 sensor with an Arduino UNO. This code reads temperature and humidity data and displays it on the serial monitor.
#include <Wire.h>
#include "DFRobot_SHT40.h" // Include the SHT 40 library
DFRobot_SHT40 sht40; // Create an instance of the SHT 40 sensor
void setup() {
Serial.begin(9600); // Initialize serial communication
Wire.begin(); // Initialize I2C communication
if (!sht40.begin()) {
Serial.println("SHT 40 initialization failed!");
while (1); // Halt execution if initialization fails
}
Serial.println("SHT 40 initialized successfully.");
}
void loop() {
float temperature, humidity;
// Read temperature and humidity from the sensor
if (sht40.readTemperatureAndHumidity(temperature, humidity)) {
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %RH");
} else {
Serial.println("Failed to read data from SHT 40.");
}
delay(1000); // Wait 1 second before the next reading
}
DFRobot_SHT40
library from the Arduino Library Manager before running the code.Sensor Not Detected on I2C Bus:
Incorrect or Unstable Readings:
Library Not Found:
DFRobot_SHT40
library from the Arduino Library Manager.#include
.Q: Can the SHT 40 measure both temperature and humidity simultaneously?
A: Yes, the SHT 40 can measure both parameters simultaneously and provides the data via the I2C interface.
Q: What is the maximum cable length for I2C communication with the SHT 40?
A: The maximum cable length depends on the pull-up resistor values and the I2C clock speed. For standard applications, keep the cable length under 1 meter to ensure reliable communication.
Q: Is the SHT 40 suitable for outdoor use?
A: The SHT 40 is not waterproof and should be protected from direct exposure to water or extreme environmental conditions. Use a protective enclosure if deploying outdoors.
Q: Can the sensor operate at 5V logic levels?
A: Yes, the SHT 40 supports a supply voltage range of 2.4V to 5.5V, making it compatible with both 3.3V and 5V systems.