Datasheet

You can also download the adafruit_si7021.mpy from its releases page on Github.
Before continuing make sure your board's lib folder or root filesystem has
the adafruit_si7021.mpy, and adafruit_bus_device files and folders copied over.
Next connect to the board's serial REPL so you are at the CircuitPython >>> prompt.
Usage
To demonstrate the usage of the sensor we'll initialize it and read the temperature and humidity,from the board's
Python REPL. First run the following code to import the necessary modules and initialize the I2C bus:
Remember if you're using a board that doesn't support hardware I2C (like the ESP8266) you need to use
the bitbangio module instead:
Now you're ready to read values from the sensor using any of these properties:
temperature - The sensor temperature in degrees Celsius.
relative_humidity - The percent humidity as a value from 0 to 100%.
That's all there is to using the Si7021 sensor with CircuitPython!
import board
import busio
import adafruit_si7021
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
import board
import bitbangio
import adafruit_bmp280
i2c = bitbangio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
print('Temperature: {} degrees C'.format(sensor.temperature))
print('Humidity: {}%'.format(sensor.relative_humidity))
© Adafruit Industries https://learn.adafruit.com/adafruit-si7021-temperature-plus-humidity-sensor Page 14 of 17