Cov txheej txheem:

Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280: 5 Cov Kauj Ruam
Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280: 5 Cov Kauj Ruam

Video: Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280: 5 Cov Kauj Ruam

Video: Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280: 5 Cov Kauj Ruam
Video: Обзор умного дома на базе Apple HomeKit от Aqara! 2024, Hlis ntuj nqeg
Anonim
Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280
Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280
Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280
Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280
Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280
Tsim Apple HomeKit Kub Sensor (BME280) Siv RaspberryPI thiab BME280

Kuv tau ua si ib puag ncig nrog IOT cov cuab yeej rau ob peb lub hlis dhau los, thiab tau xa tawm ib ncig 10 qhov sib txawv sib txawv los tshuaj xyuas cov xwm txheej nyob ib puag ncig kuv lub tsev thiab tsev. Thiab kuv tau pib siv AOSONG DHT22 qhov ntsuas huab cua sov, tab sis pom tias tom qab ob peb lub hlis qhov txiaj ntsig los ntawm qhov ntsuas qhov ntsuas qhov ntsuas tawm qhov tseem ceeb. Kuv yuav tau saib ntawm cov av noo thiab nws yuav pom 40% lossis ntau dua siab dua qhov xwm txheej tiag. Yog li kuv saib ib puag ncig thiab pom tias Bosch BME280 Kub/Siab/Vaum ntsuas tau lub koob npe zoo heev rau qhov raug (https://www.kandrsmith.org/RJS/Misc/Hygrometers/ca…). Yog li hauv cov lus qhia no peb yuav txuas Bosch BME280 rau Raspberry PI Model 2, thiab ua cov ntaub ntawv muaj rau Apple HomeKit ntawm Homebridge.

Kauj Ruam 1: Sau Cov Khoom Koj Xav Tau

Sau Qhov Koj Xav Tau
Sau Qhov Koj Xav Tau
Sau Qhov Koj Xav Tau
Sau Qhov Koj Xav Tau
Sau Qhov Koj Xav Tau
Sau Qhov Koj Xav Tau

Rau cov khoom, mus rau qhov chaw koj nyiam tshaj plaws thiab yuav khoom.

  • 1PCS GY-BME280 3.3 precision altimeter atmospheric siab BME280 sensor module

    Muaj ntau qhov kev hloov pauv ntawm pawg thawj coj ntawm cov no. Lub Circuit Court kuv siv yog ua raws GY-BME/P280 breakout board, tab sis yuav ua haujlwm nrog lwm tus thiab

  • 50cm 5pin poj niam rau poj niam DuPont txuas cable

Kuv twb muaj RaspberryPI lawm, yog li kuv tsis xav yuav qhov ntawd.

Txog rooj plaub rau BME280, Kuv siv tus qub SD daim npav nco daim npav uas kuv tau ncaws ib ncig. Tej zaum koj yuav xav saib ib puag ncig thiab pom dab tsi uas koj tuaj yeem pom uas zoo sib xws.

Kauj ruam 2: Txuas lub Sensor

Txuas lub Sensor
Txuas lub Sensor
Txuas lub Sensor
Txuas lub Sensor
Txuas lub Sensor
Txuas lub Sensor

Txhawm rau txuas lub sensor peb yuav siv ib kawg ntawm 5 tus pin poj niam/poj niam dupont cable txuas rau RaspberryPI thiab lwm qhov rau lub ntsuas. Qhov no yuav xav tau kev sib txuas;-)

  1. Txiav 5 tus pin poj niam/poj niam dupont cable ntxhib ib nrab, thiab peb yuav siv ib kawg rau kev txuas rau lub ntsuas. Lwm qhov kawg yog khoom seem thiab tuaj yeem siv rau lub ntsuas thib ob.
  2. Txiav qhov txiav qhov kawg ntawm cov hlau ntxhib 3mm, thiab tin kawg.
  3. Ua raws li cov txheej txheem txuas, muab cov xaim txuas rau qhov tsim nyog txuas ntawm BME280.
  • Dupont tus txuas (RPI) Pin 1 (3.3 VCC) txuas rau Pin 1 - (VCC) ntawm lub sensor
  • Dupont txuas (RPI) Pin 2 (SDA1) txuas rau Pin 4 - (SDA) ntawm lub sensor
  • Dupont txuas (RPI) Pin 3 (SCL1) txuas rau Pin 4 - (SCL) ntawm lub sensor
  • Dupont txuas (RPI) Pin 4 (GPIO4) tsis siv, thiab cov xaim yuav tsum tau txiav ntawm qhov txuas txuas dupont kawg.
  • Dupont txuas (RPI) Pin 5 (GND) txuas rau Pin 4 - (GND) ntawm lub sensor

Pins 5 (CSB) thiab 6 (SDO) tsis siv rau ntawm qhov kawg sensor

Kauj Ruam 3: Txuas lub Sensor mus rau RaspberryPI

Txuas lub Sensor mus rau RaspberryPI
Txuas lub Sensor mus rau RaspberryPI
Txuas lub Sensor mus rau RaspberryPI
Txuas lub Sensor mus rau RaspberryPI

Txhawm rau txuas lub ntsuas hluav taws xob mus rau RaspberryPI, thov tso koj lub zog PI tseg. Thiab txuas lub dupont txuas rau 40 tus pin GPIO txuas, hlua kab pins raws li hauv qab no. Qhov no yuav sib haum rau sab laug ntawm 40 tus pin header, pib rau saum.

1. Txuas lub sensor

  • Dupont txuas tus Pin 1 (3.3 VCC) txuas rau RPI Pin 1
  • Dupont txuas tus pin 2 (SDA1) txuas rau RPI Pin 3
  • Dupont txuas tus pin 3 (SCL1) txuas rau RPI Tus Pin 5
  • Dupont txuas tus pin 4 (GPIO4) txuas rau RPI Tus Pin 7
  • Dupont txuas tus Pin 5 (GND) txuas rau RPI Pin 9

2. Fais fab ntawm koj li RaspberryPI

Kauj Ruam 4: Kho Koj Lub RaspberryPI txuas rau lub Sensor

Txog cov theem no peb xav tau koj RaspberryPI siv, thiab koj yuav tsum nkag mus rau nws.

1. Saib seb koj puas tuaj yeem pom lub sensor ntawm lub tsheb npav i2c

sudo i2cdetect -y 1

Thiab cov zis yuav tsum zoo li qhov no, qhov tseem ceeb ntawm qhov tso tawm no yog 76 hauv kab 70:. Nov yog koj lub sensor

0 1 2 3 4 5 6 7 8 9 a b c d e f

00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- 76 --

Yog tias koj tau txais cov lus txib tsis pom lossis lwm qhov yuam kev, thov ua raws cov theem hauv qab no.

Adafruit - Kho I2C

Rau txhua qhov kuv RaspberryPI kuv yuav tsum ua raws cov theem no.

2. Ntxiv kev tso cai rau tus as khauj uas koj yuav tau khiav hauv tsev los ntawm kev txuas mus rau i2c npav ntawm RaspberryPI. Ua qhov no raws li tus neeg siv koj yuav tau khiav homebridge los ntawm.

sudo adduser $ USER i2c

Kauj Ruam 5: Nruab Homebridge-bme280 Plugin

Nruab Homebridge-bme280 Plugin
Nruab Homebridge-bme280 Plugin
Nruab Homebridge-bme280 Plugin
Nruab Homebridge-bme280 Plugin
Nruab Homebridge-bme280 Plugin
Nruab Homebridge-bme280 Plugin

Kuv yuav xav tias koj twb tau teeb tsa lub tsev nyob thiab ua haujlwm ntawm RaspberryPI, thiab yog tias koj tsis muaj ntau cov lus qhia hauv internet kom tau txais nws thiab ua haujlwm ntawm RaspberryPI.

1. Nruab homebridge-bme280 nrog cov lus txib

sudo npm nruab -g NorthernMan54/homebridge-bme280-tsis muaj kev nyab xeeb-perm

Yog tias qhov no ua tsis tau nrog qhov yuam kev no

npm ERR! chaws 128npm ERR! Hais kom ua tsis tau tiav:/usr/bin/git clone -q git: //github.com/NorthernMan54/homebridge-bme280.git /var/root/.npm/_cacache/tmp/git-clone-7237d51c npm ERR! ua rau tuag: tsis tuaj yeem tsim cov ntawv teev npe ntawm '/var/root/.npm/_cacache/tmp/git-clone-7237d51c': Kev tso cai tsis pom zoo npm ERR!

Sim no

sudo ua -

npm nruab -g NorthernMan54/homebridge-bme280-tsis muaj kev nyab xeeb-perm

2. Tsim koj cov ntawv config.json hauv ~/.homebridge nrog cov hauv qab no:

{

"choj": {

"lub npe": "Homebridge",

"username": "CC: 22: 3D: E3: CE: 30", "chaw nres nkoj": 51826,

"tus pin": "031-45-154"

},

"kev piav qhia": "Nov yog qhov piv txwv teeb tsa cov ntaub ntawv nrog ib qho khoom siv dag siv thiab ib lub platform dag. Koj tuaj yeem siv qhov no los ua tus qauv tsim koj tus kheej cov ntaub ntawv teeb tsa uas muaj cov khoom siv uas koj muaj.",

"accessories": [Cov.

{

"accessory": "BME280",

"lub npe": "Sensor", "name_temperature": "Kub",

"name_humidity": "Vaum", "kev xaiv": {

"i2cBusNo": 1, "i2cAddress": "0x76" yog

}

}

], "platforms": [Cov.

]

}

3. Pib homebridge, cov zis yuav tsum zoo li no.

[2016-11-12, 6:25:29 AM] Loaded plugin: homebridge-bme280 [2016-11-12, 6:25:29 AM] Sau npe cov khoom siv ntxiv 'homebridge-bme280. BME280' [2016-11-12, 6:25:29 AM] --- [2016-11-12, 6:25:30 AM] Loaded config.json nrog 1 cov khoom siv ntxiv thiab 0 lub platform. [2016-11-12, 6:25:30 AM] --- [2016-11-12, 6:25:30 AM] Thauj 0 platform… [2016-11-12, 6:25:30 AM] Loading 1 khoom siv… [2016-11-12, 6:25:30 AM] [Sensor] Pib BME280 accessory… [2016-11-12, 6:25:30 AM] [Sensor] BME280 sensor xaiv: {"i2cBusNo": 1, "i2cAddress": 118} Pom BME280 nti id 0x60 ntawm npav i2c-1 chaw nyob 0x76 [2016-11-12, 6:25:31 AM] [Sensor] BME280 pib ua tiav [2016-11-12, 6:25]: 31 AM] [Sensor] cov ntaub ntawv (temp) = {"temperature_C": 18.23, "humidity": 39.1710189421353, "pressure_hPa": 1016.8910377944043} Luam theej kab ntawv no nrog koj HomeKit App ntawm koj lub cuab yeej iOS los ua ke nrog Homebridge: ^

4. Pair koj qhov homebridge piv txwv nrog koj iPhone yog xav tau.

5. Txaus siab rau

Thov nco ntsoov tias lub ntsuas ntsuas siab ntsuas barometric tsuas yog pom hauv cov neeg thib peb homekit apps, thiab tsis yog hauv "Tsev", 6. Khab nias

  • Ua tsaug rau Robert X. Seger rau lub homebridge-bme280 plugin.
  • Ua tsaug rau Skylar Stein rau node.js bme280-sensor module
  • Adafruit rau tshaj tawm I2C teeb tsa phau ntawv qhia.

Pom zoo: