Add a BMP280 Pressure & 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

$ sudo i2cdetect -y 1 There must now be a number in the matrix, this is the address of the sensor. This is default 0x77.


Install the CircuitPython BMP280 Library

Check if the library does exist on pypi.org with the search command CircuitPython bmp280

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


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_BMP280/blob/master/examples/bmp280_simpletest.py

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 bmp280_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 BMP280 Python Library)