Cov txheej txheem:

Nrhiav Thaum Ib Tus Neeg Nkag Mus Hauv Chav: 7 Kauj Ruam
Nrhiav Thaum Ib Tus Neeg Nkag Mus Hauv Chav: 7 Kauj Ruam

Video: Nrhiav Thaum Ib Tus Neeg Nkag Mus Hauv Chav: 7 Kauj Ruam

Video: Nrhiav Thaum Ib Tus Neeg Nkag Mus Hauv Chav: 7 Kauj Ruam
Video: lam yuam kuv lub siab by tsom xyooj 2021 2024, Kaum ib hlis
Anonim
Image
Image

Hauv qhov kev qhia no peb yuav kawm paub yuav nrhiav li cas thaum ib tus neeg nkag mus hauv chav siv RTC module, PIR sensor, OLED zaub thiab arduino.

Saib daim vis dis aus.

Kauj ruam 1: Yam Koj Yuav Tsum Tau

Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
  • Arduino UNO (lossis lwm yam Arduino)
  • PIR Sensor Cov
  • RTC DS1307 Lub Sijhawm Sijhawm Sijhawm Tiag
  • OLED zaub
  • Jumper xov hlau
  • Visuino program: Rub tawm Visuino

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit
  • Txuas PIR sensor tus pin [GND] rau Arduino tus pin [GND]
  • Txuas PIR sensor tus pin [VCC] rau Arduino tus pin [5V]
  • Txuas PIR sensor tus pin [Teeb liab] rau Arduino tus lej digital [8]
  • Txuas RTC module tus pin [GND] rau Arduino tus pin [GND]
  • Txuas RTC module tus pin [VCC] rau Arduino tus pin [5V]
  • Txuas RTC module tus pin [SDA] rau Arduino tus pin [SDA]
  • Txuas RTC module tus pin [SCL] rau Arduino tus pin [SCL]
  • Txuas OLED Display pin [GND] rau Arduino tus pin [GND]
  • Txuas OLED Display pin [VCC] rau Arduino tus pin [5V]
  • Txuas OLED Display pin [SDA] rau Arduino tus pin [SDA]
  • Txuas OLED Display pin [SCL] rau Arduino tus pin [SCL]

Kauj Ruam 3: Pib Visuino, thiab Xaiv Arduino UNO Board Type

Pib Visuino, thiab Xaiv Arduino UNO Board Type
Pib Visuino, thiab Xaiv Arduino UNO Board Type
Pib Visuino, thiab Xaiv Arduino UNO Board Type
Pib Visuino, thiab Xaiv Arduino UNO Board Type

Txhawm rau pib ua haujlwm rau Arduino, koj yuav tsum muaj Arduino IDE teeb tsa los ntawm no:

Thov nco ntsoov tias muaj qee qhov teeb meem tseem ceeb hauv Arduino IDE 1.6.6. Nco ntsoov tias koj nruab 1.6.7 lossis siab dua, txwv tsis pub Cov Lus Qhia no yuav tsis ua haujlwm! Yog tias koj tsis tau ua raws cov kauj ruam hauv Phau Ntawv Qhia no teeb tsa Arduino IDE rau program Arduino UNO! Visuino: https://www.visuino.eu tseem yuav tsum tau teeb tsa. Pib Visuino raws li pom hauv thawj daim duab Nyem rau ntawm "Cov cuab yeej" khawm ntawm Arduino tivthaiv (Daim Duab 1) hauv Visuino Thaum qhov kev sib tham tshwm, xaiv "Arduino UNO" raws li qhia hauv daim duab 2

Kauj Ruam 4: Hauv Visuino Ntxiv Cheebtsam

Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
  • Ntxiv "Lub Sijhawm Tiag (RTC) DS1307" tivthaiv
  • Ntxiv "SSD1306/SH1106 OLED Display (I2C)" tivthaiv
  • Ntxiv "Digital (Boolean) Hloov Xwb" tivthaiv
  • Ntxiv "Ntug Ntug" tivthaiv
  • Ntxiv "Clock On/Off Switch" tivthaiv
  • Ntxiv "Timer" tivthaiv Hauv cov khoom qhov rai teeb tsa "Interval (uS)" mus rau 10000000 Qhov no txhais tau tias lub ntsuas cua yuav "tsaug zog" rau 10s (10000000uS) tom qab txhua qhov kev tshawb pom, qhov no yuav tiv thaiv ntau lub sijhawm sau ib zaug, Qhov zoo tshaj koj yuav teeb tsa qhov no rau qee yam xws li 5 feeb
  • Ntxiv "Inverter" tivthaiv

Kauj Ruam 5: Hauv Visuino Connect Components

Hauv Visuino Connect Components
Hauv Visuino Connect Components
  • Txuas Arduino digital Out pin [8] rau "ChangeOnly1" tus pin [Hauv]
  • Txuas "ChangeOnly1" tus pin [Tawm] rau "DetectEdge1" tus pin [Hauv]
  • Txuas "DetectEdge1" tus pin [Tawm] rau "ClockSwitch1" tus pin [Hauv]
  • Txuas "ClockSwitch1" tus pin [Tawm] rau "RealTimeClock1" tus pin [Clock] thiab "Timer1" tus pin [Pib]
  • Txuas "Timer1" tus pin [Tawm] rau "Inverter1" tus pin [Hauv]
  • Txuas "Inverter1" tus pin [Tawm] rau "ClockSwitch1" tus pin [Pab kom]
  • Txuas "RealTimeClock1" tus pin [Tswj] mus rau Arduino I2C [Hauv]
  • Txuas "RealTimeClock1" tus pin [Tawm] rau "DisplayOLED1" tus pin [Hauv]
  • Txuas "DisplayOLED1" tus pin [Tswj] mus rau Arduino I2C [Hauv]

Kauj Ruam 6: Tsim, Ua Ke, thiab Tshaj Tawm Arduino Code

Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code

Hauv Visuino, Nias F9 lossis nyem rau ntawm lub pob uas qhia ntawm daim duab 1 los tsim Arduino code, thiab qhib Arduino IDE

Hauv Arduino IDE, nyem rau ntawm Upload khawm, txhawm rau sau thiab xa cov cai (Daim duab 2)

Kauj ruam 7: Ua si

Yog tias koj ua lub zog Arduino UNO tus qauv, thiab ua kom txav mus rau PIR sensor yuav tsum ntsuas nws thiab ua lub sijhawm teev tseg ntawm OLED Zaub. Nyob ntawm lub caij nyoog uas koj teeb tsa hauv Timer tivthaiv nws yuav tsum txheeb xyuas lwm qhov kev txav chaw tom qab lub sijhawm dhau mus.

Nrog koj zoo siab! Koj tau ua tiav koj txoj haujlwm nrog Visuino. Kuj txuas nrog yog Visuino project, uas kuv tau tsim rau Cov Lus Qhia no, koj tuaj yeem rub tawm nws ntawm no thiab qhib nws hauv Visuino:

Pom zoo: