Cov txheej txheem:

Openhab MQTT PIR Motion Sensor: 7 Kauj Ruam
Openhab MQTT PIR Motion Sensor: 7 Kauj Ruam

Video: Openhab MQTT PIR Motion Sensor: 7 Kauj Ruam

Video: Openhab MQTT PIR Motion Sensor: 7 Kauj Ruam
Video: PIR Motion sensor with #OpenHAB 2024, Kaum ib hlis
Anonim
Openhab MQTT PIR Tsab ntawv tsa suab Sensor
Openhab MQTT PIR Tsab ntawv tsa suab Sensor

Nyob zoo, Hauv cov lus qhia no kuv yuav qhia koj yuav ua li cas koj tuaj yeem ua koj tus kheej Motion sensor rau Openhab.

Kauj Ruam 1: Nqi Khoom

Nqi Khoom
Nqi Khoom
Nqi Khoom
Nqi Khoom
Nqi Khoom
Nqi Khoom

rau qhov project no koj yuav xav tau:

  • HC-sr501
  • 1X3 poj niam lub taub hau
  • 1X3 txiv neej lub taub hau
  • 3 xim hlau koj tuaj yeem siv txuas txuas ntxiv yog tias koj xav tau
  • 1 10K resistor
  • Arduino uno lossis mega
  • 3d qhov chaw luam tawm.

Kauj ruam 2: PIR los ua ke

PIR los ua ke
PIR los ua ke
PIR los ua ke
PIR los ua ke
PIR los ua ke
PIR los ua ke
PIR los ua ke
PIR los ua ke

1. Muab lub taub hau tso rau ntawm cov hlau uas pom hauv daim duab.

2. Ntxiv 10K resistor nruab nrab ntawm GND thiab Lub Teeb.

3. Muab lub sensor tso rau hauv rooj plaub

4. Mout lub phaj rov qab rau ntawm phab ntsa.

5. Ntxiv mount lub tsev nyob rau sab nraum qab phaj nrog 3M ntsia liaj qhov rooj thiab ntsia hlau.

Kauj Ruam 3: Kev sib txuas rau Microcontroller

Kev sib txuas rau Microcontroller
Kev sib txuas rau Microcontroller

1. Txuas 5V rau 5V ntawm lub microcontroller.

2. Txuas GND mus rau GND ntawm lub microcontroller.

3. Txuas lub xov tooj liab mus rau A0 ntawm lub microcontroller.

Kauj Ruam 4: Sib dhos ntawm Arduino

Sib dhos ntawm Arduino
Sib dhos ntawm Arduino
Sib dhos ntawm Arduino
Sib dhos ntawm Arduino
Sib dhos ntawm Arduino
Sib dhos ntawm Arduino

1. Muab daim thaiv thaiv ethernet tso rau ntawm arduino.

2. Txuas Ethernet-cable mus rau arduino.

3. Hwj chim lub arduino.

Kauj ruam 5: Code

1. Rub tawm thiab teeb tsa lub tsev qiv ntawv rau qhov kos duab.

1. MQTT PubSubClient

2. Muab lub tsev qiv ntawv tso rau hauv phau ntawv teev npe ntawm koj li Arduino-IDE.

3. Hloov tus IP server mus rau koj li openhab server IP.

4. Hloov lub ncauj lus mus rau lub ncauj lus uas koj xav tau.

5. Upload Code rau arduino.

Kauj ruam 6: Teeb meem tua

  1. Case: Arduino yuav tsis txuas rau server.

    1. Txheeb xyuas tias lub ethernet cable tau ntsaws.
    2. Puas yog tus pin 13 coj hlawv?
    3. kos tus IP server hauv tus lej.
  2. Case: Openhab server yuav tsis tau txais cov lus.

    1. Cov khoom teeb tsa puas yog?
    2. Puas yog mqtt lub ntsiab lus raug hauv cov cai?
    3. Puas muaj mqtt server?
  3. Case: Cov xwm txheej yuav tsis hloov.

    1. Puas yog lub ntsuas hluav taws xob ntsaws rau hauv qhov txuas txuas?
    2. Puas muaj lub hwj chim mus rau lub sensor?
    3. Puas yog lub ntsuas ntsuas tau raug?

Kauj Ruam 7: Qhov Kawg

Nov yog kuv thawj qhov kev qhia paub tsis pub tawm tswv yim rau nws.

Yog tias muaj lus nug xav nug lawv.

Pom zoo: