Add a Si7021 Temperature Sensor to the Pi


Power down the Pi before you connect anything to the GPIO pins!


Install i2c-tools

To see the I²C address matrix: $ sudo apt-get install i2c-tools -y


Check sensor address

Type in de commandline: $ sudo i2cdetect -y 1 There must now be a number in the matrix, this is the address of the sensor. This must be 0x40.


Install the CircuitPython Si7021 Library

Although this breakout board is from Sparkfun, you can use the Adafruit libraries, since Adafruit also has a breakout board with the Si7021. Check if the library does exist on pypi.org with the search command CircuitPython si7021

Once you know the name, install it with: $ pip3 install adafruit-circuitpython-si7021


Run that code!

The finish line is right up ahead. You can now run one of the (many in some cases) example scripts we've written for you. Check out the examples for your library by visiting the repository for the library and looking in the example folder. In this case, it would be https://github.com/adafruit/Adafruit_CircuitPython_SI7021/tree/master/examples

Save this code to your Pi by copying and pasting it into a text file, downloading it directly from the Pi, etc. Then in your command line run: $ python3 si7021_simpletest.py If the code is in a continuous loop, you can stop this by Ctrl C


Python

External addresses to Adafruit:
Python & CircuitPython
Python Docs (Adafruit SI7021 Python Library)