The Adafruit Si7021 sensor is a compact, high-precision digital humidity and temperature sensor that offers reliable performance in a wide range of applications. With its I2C interface, it is easy to integrate with microcontrollers such as the Arduino UNO. The Si7021 is ideal for environmental monitoring in greenhouses, HVAC systems, weather stations, and other applications where accurate humidity and temperature readings are crucial.
Pin Number | Name | Description |
---|---|---|
1 | VDD | Power supply (1.9 to 3.6 V) |
2 | GND | Ground |
3 | SDA | I2C Data |
4 | SCL | I2C Clock |
Connecting the Sensor:
Library Installation:
Sample Code:
#include <Wire.h>
#include <Adafruit_Si7021.h>
Adafruit_Si7021 sensor = Adafruit_Si7021();
void setup() {
Serial.begin(9600);
// Wait for serial console to open, useful for native USB port only
while (!Serial) { delay(10); }
Serial.println("Si7021 test!");
if (!sensor.begin()) {
Serial.println("Did not find Si7021 sensor!");
while (true);
}
}
void loop() {
float humidity = sensor.readHumidity();
float temperature = sensor.readTemperature();
Serial.print("Humidity: ");
Serial.print(humidity, 2);
Serial.print("%\t");
Serial.print("Temperature: ");
Serial.print(temperature, 2);
Serial.println("°C");
delay(1000);
}
delay(1000);
at the end of the loop causes the sensor to take a reading every second.Q: Can the Si7021 sensor be used with 5V systems? A: The Si7021 operates at 1.9 to 3.6 V. A logic level converter should be used when interfacing with 5V systems.
Q: How can I calibrate the sensor? A: The Si7021 is factory-calibrated. However, if calibration is necessary, refer to the sensor's datasheet for calibration procedures.
Q: Is the sensor waterproof? A: No, the Si7021 is not waterproof. It should be protected from moisture that can condense on the sensor.
For further assistance, consult the Adafruit Si7021 datasheet or contact Adafruit's support forums.