Skip to content

Si7021 Temp Humidity

Jason edited this page Sep 8, 2018 · 4 revisions

Hardware Setup

With the Si7021 it is capable of communicating either through I2C and SPI. Again, I decided to connect it with I2C since we already have multiple I2C devices connected in parallel. Here is how your setup should look like with the Si7021 connected. Note that we would only need to connect 3V/VIN, GND, SCL, and SDA for I2C. The 3Vo pin is left unconnected.

Refer to the following adafruit page for hardware wiring under the "Python Computer Wiring" header.

Software Setup

Unfortunately Adafruit only provided a circuitpython example repository, so i followed this si7021 for the raspberry pi repository. Essentially pigpio is a library that allows us to directly read the bytes being transferred, then we need to convert the two 8 bit into a single 16 bit integer that we can manipulate. The magic numbers that is adjusting the raw RH and temperature values is valid as these are the same numbers from the adafruit si7021 library.

Si7021 Datasheet

  • Temperature Accuracy: ±0.4°C (pg.1)
  • Relative Humidity Accuracy: ±3% (pg.1)