![Adafruit Si7021 Скачать руководство пользователя страница 13](http://html1.mh-extra.com/html/adafruit/si7021/si7021_user-manual_2845846013.webp)
Python & CircuitPython
It's easy to use the Si7021 sensor with Python or CircuitPython and the
Adafruit CircuitPython
SI7021
(https://adafru.it/BfV)
module. This module allows you to easily write Python code that reads the humidity and
temperature, pressurefrom the sensor.
You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python
thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library
(https://adafru.it/BSN)
.
CircuitPython Microcontroller Wiring
First wire up a SI7021 to your board exactly as shown on the previous pages for Arduino. Here's an example of wiring a
Feather M0 to the sensor with I2C:
Board 3V to sensor VIN
Board GND to sensor GND
Board SCL to sensor SCL
Board SDA to sensor SDA
Python Computer Wiring
Since there's
dozens
of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms,
please visit the guide for CircuitPython on Linux to see whether your platform is supported
(https://adafru.it/BSN)
.
Here's the Raspberry Pi wired with I2C:
Pi 3V3 to sensor VIN
Pi GND to sensor GND
Pi SCL to sensor SCL
Pi SDA to sensor SDA
CircuitPython Installation of Si7021 Library
You'll need to install the
Adafruit CircuitPython SI7021
(https://adafru.it/BfV)
library on your CircuitPython board.
First make sure you are running the
latest version of Adafruit CircuitPython
(https://adafru.it/tBa)
for your board.
Next you'll need to install the necessary libraries to use the hardware--carefully follow the steps to find and install these
libraries from
Adafruit's CircuitPython library bundle
(https://adafru.it/zdx)
. For example the Circuit Playground Express
guide has
a great page on how to install the library bundle
(https://adafru.it/Bf2)
for both express and non-express
© Adafruit Industries
https://learn.adafruit.com/adafruit-si7021-temperature-plus-humidity-sensor
Page 13 of 19