Creative Commons images are CC BY-NC-SA 3.0

Description: The Si7021 is a low-cost, easy-to-use, highly accurate, digital humidity and temperature sensor. This sensor is ideal for environmental sensing and data logging and perfect for build a weather stations or humidor control system. All you need are two lines for I2C communication, and you’ll have relative humidity readings and very accurate temperature readings as a bonus!

There are only four pins that need to be hooked up in order to start using this sensor in a project. One for VCC, one for GND, and two data lines for I2C communication. This breakout board has built-in 4.7KΩ pullup resistors for I2C communications. If you’re hooking up multiple I2C devices on the same bus, you may want to disable these resistors.

Dimensions: 0.6" x 0.6"

Documents:

Recommended Products

Customer Comments

  • I have a Si7021 hooked up to my homebuilt weather station. In the evening as dew starts rising, the reported humidity rises past 100% and swings negative.

    Look here.

    Any idea why this would be happening?

    I’m going to check against another sensor, in case it’s just a linear offset. The datasheet mentions erratic behavior at very high humidity or if it comes in contact with liquid water. So I’m going to do a better job protecting the sensor also.

    • If I remember correctly the library outputs 999 or 998 in the case of an error. I’m guessing the I2C bus is borking for some reason and it’s reporting 998 (0x3E6), which if it is treated as a signed 8-bit, this becomes 0xE6 which is -26. I’m about 30% confident this is your problem. Hard to say without your code.

      There might be a weird bug with the library or sensor if the humidity passes the 100% point. Not sure. Please let us know what you find out!

      • I’ve seen the 999 or 998 issue with wires breaking on my (ahem) prototype I2C connection. This is different. The numbers change, not always 999. Plus they seem realistic, just wrapped around past 100. The temperature values agree with the temperature from a BMP180 barometer right next to the Si7021.

        I haven’t dried out the station yet. It rained heavily yesterday.

        • Looks like it was pilot error. TL;DR: unscrambling the bytes from the sensor was being done incorrectly.

          I actually stripped the Si7021 code out of the library to attempt saving some space in the Arduino code. I think there are errors in the code, or my fork of it. I fixed some things, now here is my current routine to read the Si7021, which aligns a bit better with the data sheet equations:

            int readHumidity(Record *data)
            {
              const int Si7021Address =0x40;
          
              char X0,X1,Y0,Y1;
              unsigned short RH_Code;
              double X,Y,X_out,Y_out1,Y_out2;
          
              /**Send command of initiating relative humidity measurement**/
              Wire.beginTransmission(Si7021Address); Wire.write(0xE5); Wire.endTransmission(); 
          
              /**Read two bytes relative humidity**/
              Wire.requestFrom(Si7021Address,2);
              if(Wire.available()<=2)
              {
                Y0 = Wire.read();
                Y1 = Wire.read();
                RH_Code = ((unsigned char)Y0<<8) | ((unsigned char)Y1 & 0xFF);
                Serial.print("Read bytes from Si7021 MSB: "); 
                Serial.print((unsigned int)Y0); Serial.print("LSB: "); Serial.print((unsigned int)Y1);
                Serial.print("combined: "); Serial.println(RH_Code);
              }
              /**Calculate and store relative humidity**/
              Y = (125.0 * (double)RH_Code) / 65536 - 6.0;
          
              //data->humidity = (float)Y;
              /**Send command of initiating temperature measurement associated with previous         relative   humidity**/
              Wire.beginTransmission(Si7021Address); Wire.write(0xE0); Wire.endTransmission();
          
              Wire.requestFrom(Si7021Address,2);
              if(Wire.available()<=2) {
                X0 = Wire.read();
                X1 = Wire.read();
                X_out = (X0<<8)+X1;
              }
              /**Calculate and store temperature**/
              X=(175.72*X_out)/65536 - 46.85;
              //data->humidityTemp = (float)X;
              Serial.print("Si7021 temperature: "); Serial.print(X, 1);
              Serial.print("C Si7021 humidity: "); Serial.print(Y); Serial.println("%");
            }
          

          and here is output comparing HTU21D and Si7021 readings

          Send OK:
          Read bytes from Si7021 MSB: 65411LSB: 106combined: 33642
          Si7021 temperature: 22.4C Si7021 humidity: 58.17%
          HTU21D Temperature: 23.1C HTU21D Humidity: 57.7%
          Send OK: 
          Read bytes from Si7021 MSB: 65411LSB: 82combined: 33618
          Si7021 temperature: 22.4C Si7021 humidity: 58.12%
          HTU21D Temperature: 23.1C HTU21D Humidity: 57.9%
          Send OK: 
          Read bytes from Si7021 MSB: 65411LSB: 46combined: 33582
          Si7021 temperature: 22.4C Si7021 humidity: 58.05%
          HTU21D Temperature: 23.1C HTU21D Humidity: 58.1%
          Send OK: 
          Send OK: 
          Read bytes from Si7021 MSB: 65411LSB: 106combined: 33642
          Si7021 temperature: 22.4C Si7021 humidity: 58.17%
          HTU21D Temperature: 23.1C HTU21D Humidity: 57.7%
          Send OK: 
          Read bytes from Si7021 MSB: 65411LSB: 82combined: 33618
          Si7021 temperature: 22.4C Si7021 humidity: 58.12%
          HTU21D Temperature: 23.1C HTU21D Humidity: 57.9%
          Send OK: 
          Read bytes from Si7021 MSB: 65411LSB: 46combined: 33582
          Si7021 temperature: 22.4C Si7021 humidity: 58.05%
          HTU21D Temperature: 23.1C HTU21D Humidity: 58.1%
          Send OK: 
          
          • Looks like it was pilot error.

            So you got everything fixed? What was the culprit? Code or hardware failure?

            if(Wire.available()<=2)

            This is slightly wrong - you probably mean >=2. I’m not sure what a .requestFrom(x, 2) will return if slave sensor doesn’t return 2 bytes. Times out? Returns 2 no matter what?

            • I thought “less than” that was a bit strange, but it’s copied directly from the library.

              It looks like the culprit was code.

              New code uploaded in to the station, and humidity values are now greater than 0% and less than 100%!

              Click here to see.

              • Where did you get your library? I don’t see it on our Si7021 lib or on our HTU21D lib. Just want to be sure we’re not pushing bad code.

                • Hmm, I thought it was yours, but I just checked what you have on github, and that’s a lot nicer. Only thing I see is “makeMeasurment” (sic) and some other words in the comments are spelled incorrectly. :)

                  Ah, it’s from here.

  • Jeez, did you have to swap the +/- pins from the HTU21 breakout? Otherwise, seems like a good and cheaper replacement. Since it has the PTFE cover, I think the “Note:” is not required?

    • Sorry for the design change - we’ve been migrating all our I2C designs to a standard pinout (GND, VCC, SDA, SCL) since a few years ago. The HTU21D was one of the oldies that had (my mistake) the old pinout. This board has the correction.

      Good point about the note. I’ll get it fixed.

  • I’m trying to hook this up and I’ve tried it on a couple of different boards; Nano and and Uno. They both display the same thing serial monitor.

     Temp:-51.85F, Humidity:-5.81%
    

    Am I hooking it up wrong? Bad board? Any thoughts on how to get it up and running?

    Thanks Rich

  • Hi, what was the reason for replacing the HTU21D breakout with this si7021 board? What are the differences? A quick look at the datasheets indicate the HTU21D is more a cure and consumes less power than the si7021. Please correct me if I’m wrong. I’m guessing these sensors are related since the similar part number and seem pinout compatible. Will the same software that worked with HTU21D work with si7021? Thanks, keep up the good work :-)

    • Primary reason we moved towards the Si7021 was to get the PTFE filter. We found the HTU21D did fine indoors but many of our customers were using them in the field (and Hawaii) and needed the filter to protect the sensor from damage.

Customer Reviews

4.7 out of 5

Based on 3 ratings:

5 star
2
4 star
1
3 star
0
2 star
0
1 star
0

2 of 2 found this helpful:

Working well

This hooked up to the weather station I built easily. Just pulled in the libraries, added a few calls and cal factors and my station now has humidity and dew point stats. Weather Underground quality checkers gave my homemade station the gold seal once I added this sensor. Easy to use and reports accurately.


2 of 2 found this helpful:

Tiny, nice and simple

Very easy setup, controlled by a Raspberry Pi 2 with CE’s Python script for this module: https://github.com/ControlEverythingCommunity/SI7021/blob/master/Python/SI7021.py

Highly recommended for temp and humidity in one package.


Really Good Sensor

I spent 20 minutes (figuratively) pulling out my hair trying to get this thing connected to my Arduino. Then I realized: I had not physically connected all four jumper wires!

In all seriousness, this sensor works very well and I have had no real problems with it. It’s connected to my ESP8266 Thing Dev Board for logging data to ThingSpeak.


Related Tutorials

Si7021 Humidity and Temperature Sensor Hookup Guide

May 5, 2016

The Si7021 humidity and temperature sensor is an easy to use, digital, low-cost sensor to aid you in all your environment sensing needs.