Home Chipkit Chipkit uno and Si7021 temperature sensor example

Chipkit uno and Si7021 temperature sensor example

by shedboy71

The  Si7021  I2C Humidity  and  Temperature  Sensor  is  a  monolithic  CMOS  IC integrating   humidity   and   temperature   sensor   elements,   an   analog-to-digital converter, signal processing, calibration data, and an I2C Interface.

The Si7021 offers an accurate, low-power, factory-calibrated digital solution ideal for measuring humidity, dew-point, and temperature, in applications ranging from HVAC/R and asset tracking to industrial and consumer platforms.

Features

Precision Relative Humidity Sensor ± 3% RH (max), 0–80% RH
High Accuracy Temperature Sensor ±0.4 °C (max), –10 to 85 °C
0 to 100% RH operating range
Up to –40 to +125 °C operating range
Wide operating voltage – (1.9 to 3.6 V)
Low Power Consumption – 150 μA active current

Connection

Code

This example uses the Adafruit Si7021 library

[codesyntax lang=”cpp”]

#include "Adafruit_Si7021.h"

Adafruit_Si7021 sensor = Adafruit_Si7021();

void setup() 
{
  Serial.begin(9600);

  // wait for serial port to open
  while (!Serial) 
  {
    delay(10);
  }

  Serial.println("Si7021 test!");
  
  if (!sensor.begin()) 
  {
    Serial.println("Did not find Si7021 sensor!");
    while (true);
  }
}

void loop() 
{
  Serial.print("Humidity:    "); 
  Serial.print(sensor.readHumidity(), 2);
  Serial.print("\tTemperature: "); 
  Serial.println(sensor.readTemperature(), 2);
  delay(1000);
}

[/codesyntax]

 

Testing

Open the serial monitor and you should see something like this

Si7021 test!
Humidity: 40.31 Temperature: 26.22
Humidity: 40.18 Temperature: 26.12
Humidity: 40.05 Temperature: 26.05
Humidity: 40.65 Temperature: 28.02
Humidity: 41.37 Temperature: 29.86
Humidity: 41.69 Temperature: 30.28
Humidity: 41.66 Temperature: 29.88
Humidity: 41.60 Temperature: 29.51

 

Link

Industrial High Precision Si7021 Humidity Sensor with I2C Interface for Arduino

Share

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More