Adafruit Si7021 Скачать руководство пользователя страница 13

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

Содержание Si7021

Страница 1: ...Adafruit Si7021 Temperature Humidity Sensor Created by lady ada Last updated on 2018 11 21 06 58 57 PM UTC...

Страница 2: ...t_Si7021 library Load Demo Library Reference Python CircuitPython CircuitPython Microcontroller Wiring Python Computer Wiring CircuitPython Installation of Si7021 Library Python Installation of Si7021...

Страница 3: ...perature Humidity Sensor the best way to prove the weatherman wrong This lovely sensor for Silicon labs has 3 relative humidity measurements with a range of 0 80 RH and 0 4 C temperature accuracy at a...

Страница 4: ...3V or 5V power logic There s a PTFE filter to keep the sensor clean that s the white flat thing on top Also comes with some pin header Some light soldering is required to attach the header but it s e...

Страница 5: ...or on board that will take 3 5VDC and safely convert it down To power the board give it the same power as the logic level of your microcontroller e g for a 5V micro like Arduino use 5V 3v3 this is the...

Страница 6: ...soldering procedure is identical Prepare the header strip Cut the strip to length if necessary It will be easier to solder if you insert it into a breadboard long pins down Adafruit Industries https...

Страница 7: ...akout board Place the breakout board over the pins so that the short pins poke through the breakout pads Adafruit Industries https learn adafruit com adafruit si7021 temperature plus humidity sensor P...

Страница 8: ...ps on soldering be sure to check out our Guide to Excellent Soldering https adafru it aTk You re done Check your solder joints visually and continue onto the next steps Adafruit Industries https learn...

Страница 9: ...ro digital 3 Connect the SDA pin to the I2C data SDA pin on your Arduino On an UNO 328 based Arduino this is also known as A4 on a Mega it is also known as digital 20 and on a Leonardo Micro digital 2...

Страница 10: ...uit all about arduino libraries install use https adafru it aYM Load Demo Open up File Examples Adafruit_Si7021 si7021 and upload to your Arduino wired up to the sensor Thats it Now open up the serial...

Страница 11: ...it was not found Once initialized you can query the temperature in C with Which will return floating point decimal fractional temperature You can convert to Fahrenheit by multiplying by 1 8 and adding...

Страница 12: ...find handy Call sensor readSerialNumber to read out the 8 bytes of unique ID Then you can access them from sensor sernum_a and sensor sernum_b Adafruit Industries https learn adafruit com adafruit si...

Страница 13: ...an 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...

Страница 14: ...inux guide to get your computer ready https adafru it BSN Once that s done from your command line run the following command sudo pip3 install adafruit circuitpython si7021 If your default Python is ve...

Страница 15: ...7021 Create library object using our Bus I2C port i2c busio I2C board SCL board SDA sensor adafruit_si7021 SI7021 i2c while True print nTemperature 0 1f C sensor temperature print Humidity 0 1f sensor...

Страница 16: ...Python Library Docs Python Library Docs https adafru it C3f Adafruit Industries https learn adafruit com adafruit si7021 temperature plus humidity sensor Page 16 of 19...

Страница 17: ...y on GitHub https adafru it rAw EagleCAD PCB files on GitHub https adafru it rAB Si7021 A20 datasheet https adafru it rAC K R Smith calibration notes https adafru it BfU Schematic Fabrication Print Ad...

Страница 18: ...Adafruit Industries https learn adafruit com adafruit si7021 temperature plus humidity sensor Page 18 of 19...

Отзывы: