Cov txheej txheem:
- Kauj ruam 1: Cov ntaub ntawv
- Kauj ruam 2: Kev thaiv kab
- Kauj Ruam 3: Teeb Koj Li Ubidots Account thiab Cov Hloov
- Kauj Ruam 4: Xaiv Raspberry Pi Raws Li Koj Cov Ntaub Ntawv Tshiab thiab Ua Daim Ntawv
- Kauj Ruam 5: Tam sim no Nyem rau ntawm Qhov Chaw Tshiab "Kuv Raspberry Pi"
- Kauj Ruam 6: Ntxiv qhov hloov pauv tshiab hu ua "pub dawb lossis tsis khoom" thiab tsis txhob hnov qab ua kom tiav Cov Npe Lub Npe thiab Chav
- Kauj Ruam 7: Nco Ntsoov Koj Tus Kheej Tus ID
- Kauj Ruam 8: Coding Koj Raspberry Pi
- Kauj Ruam 9: Tsim Qhov Taw Qhia hauv Ubidots Dashboard
- Kauj Ruam 10: Xaiv "Qhov Taw Qhia" Widget thiab Ua Raws Cov Kauj Ruam:
- Kauj Ruam 11: Tam sim no Koj Muaj Koj Qhov Ntsuas
- Kauj Ruam 12: Xaus
Video: Yuav Ua Li Cas Tsim Lub Chaw Nres Tsheb txhawm rau daws qhov mob ntawm Nrhiav Qhov Chaw Dawb: 12 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Hauv qhov haujlwm no peb yuav tsim qhov chaw nres tsheb yooj yim uas siv Raspberry Pi. Nws hloov tawm tias txhua tag kis kuv yuav tsum ntsib cov lus nug no: Puas yog XAUS qhov chaw nres tsheb nyob rau ntawm kuv lub chaw haujlwm twb tau coj lawm? Vim tias thaum nws yog tiag tiag, Kuv yuav tsum mus ncig qhov thaiv thiab siv tsawg kawg 10 feeb ntxiv los nres tsheb thiab taug kev mus rau tom chaw ua haujlwm.
Yog li kuv xav tias nws yuav txias kom paub tias qhov chaw pub dawb lossis tsis yog, ua ntej txawm tias sim mus txog qhov ntawd. Thaum kawg, qhov tshwm sim yog lub cuab yeej zoo uas kuv tuaj yeem tshawb xyuas los ntawm kuv Ipod lossis xov tooj ntawm tes
Kauj ruam 1: Cov ntaub ntawv
1. Raspberry Pi Qauv B:
2. USB WiFi Dongle
3. Tsab ntawv tsa suab sensor los ntawm Parallax
4. Peb tus poj niam rau poj niam xaim
5. Ubidots tus account - lossis - STEM License
Kauj ruam 2: Kev thaiv kab
Lub suab txav tau yooj yim rau nruab vim nws tsuas muaj peb tus pin: GND, VCC (+5v) thiab OUT (digital signal "1" lossis "0"). Yog tias muaj kev txav ncig nws, nws yuav tso tawm "1", yog tias tsis muaj, "0".
Koj tuaj yeem pom qhov kev sib txuas hauv daim duab hauv qab no, cov hlua txuas ncaj qha mus rau GPIO pins ntawm Raspberry Pi. Yog tias koj xav tau cov ntaub ntawv ntau ntxiv txog GPIO pins koj tuaj yeem mus ntsib phau ntawv qhia no los ntawm makezine.com; nws yog qhov chaw zoo los paub nrog Raspberry Pi pins.
Kauj Ruam 3: Teeb Koj Li Ubidots Account thiab Cov Hloov
Yog tias koj tshiab rau Ubidots, tsim ib tus as khauj ntawm no.
Nkag mus rau "Cov Chaw" tab thiab ntxiv qhov tshiab
Kauj Ruam 4: Xaiv Raspberry Pi Raws Li Koj Cov Ntaub Ntawv Tshiab thiab Ua Daim Ntawv
Kauj Ruam 5: Tam sim no Nyem rau ntawm Qhov Chaw Tshiab "Kuv Raspberry Pi"
Kauj Ruam 6: Ntxiv qhov hloov pauv tshiab hu ua "pub dawb lossis tsis khoom" thiab tsis txhob hnov qab ua kom tiav Cov Npe Lub Npe thiab Chav
Kauj Ruam 7: Nco Ntsoov Koj Tus Kheej Tus ID
Nco tseg ntawm koj tus lej API pom hauv "Kuv Cov Ntaub Ntawv - API Ntsiab Lus"
Kauj Ruam 8: Coding Koj Raspberry Pi
Koj yuav tsum tau teeb tsa koj li Raspberry Pi, muaj Internet nkag tau los ntawm nws. Yog tias tsis yog, ua raws phau ntawv qhia no, lossis tshawb xyuas qhov blog no hais txog teeb tsa WiFi.
Thaum npaj txhij, nkag mus rau koj li Raspberry Pi los ntawm lub davhlau ya nyob twg (LxTerminal yog tias koj nkag mus rau koj tus Pi ncaj qha los ntawm nws GUI), mus rau lub nplaub tshev uas koj xav khaws qhov haujlwm no thiab tsim cov ntaub ntawv tshiab hu ua "presence.py"
$ sudo nano វត្តមាន.py
Tam sim no muab tshuaj txhuam cov cai hauv qab no:
ntshuam RPi. GPIO li GPIO ## GPIO lub tsev qiv ntawv los ntawm ubidots ntshuam ApiClient ## Ubidots Library lub sijhawm ntshuam ## lub sijhawm qiv ntawv rau qeeb GPIO.setmode (GPIO. BCM) ## teeb tsa BCM ua tus lej lej rau nkag GPIO.setup (7, GPIO. IN) ## Tshaj tawm GPIO7 ua cov tswv yim rau lub ntsuas
sim:
api = ApiClient ("75617caf2933588b7fd0da531155d16035138535") ## muab koj tus kheej apikey cov neeg = api.get_variable ("53b9f8ff76254274effbbace") ## tso koj tus kheej tus lej sib txawv tshwj tsis yog: luam "cant txuas" ## yog tias qhov no tshwm sim koj li internet): muaj = GPIO.input (7)#)#txuag tus nqi ntawm lub sensor yog (muaj == 0): ## yog tias muaj yog xoom uas txhais tau tias lwm lub tsheb tseem muaj: (people.save_value ({'tus nqi ': វត្តមាន}) ## xa tus nqi mus rau ubidots time.sleep (1) ## txheeb xyuas txhua 5 vib nas this yog tias lwm lub tsheb txav luam "cero" yog (muaj): people.save_value ({' value ': presence})# #lwm lub tsheb sab laug tam sim no yog khoob tam sim no:) sijhawm.sleep (1) luam "uno" GPIO.cleanup () ## rov pib dua cov xwm txheej ntawm GPIO pins
Khiav koj qhov program:
$ sudo nab hab sej muaj nyob.py
Kauj Ruam 9: Tsim Qhov Taw Qhia hauv Ubidots Dashboard
Tam sim no peb tab tom tau txais cov ntaub ntawv nyob los ntawm lub cuab yeej, peb yuav tsum tsim tus txheej txheem tshwj xeeb uas qhia peb tias qhov chaw nres tsheb raug coj los lossis tsis. Nyem rau ntawm lub dashboard tab, tom qab ntawd ntxiv cov cuab yeej tshiab:
Kauj Ruam 10: Xaiv "Qhov Taw Qhia" Widget thiab Ua Raws Cov Kauj Ruam:
Kauj Ruam 11: Tam sim no Koj Muaj Koj Qhov Ntsuas
Zoo kawg! tam sim no koj yuav tsum pom tus widget nyob qhia lub xeev ntawm qhov chaw nres tsheb. Btw koj tuaj yeem teeb tus widget no hauv ib lub vev xaib lossis mobile app:
Kauj Ruam 12: Xaus
Qhov ntawd yog txhua yam rau txoj haujlwm no! Peb tau kawm paub yuav ua li cas txhawm rau ntsuas lub suab txav mus rau Ubidots huab siv Raspberry Pi thiab tso tawm nws cov ntaub ntawv hauv cov widget nyob. Txoj haujlwm tuaj yeem txhim kho los ntawm kev siv lub ntsuas ntsuas lub ntsej muag thiab tsis yog lub suab txav (uas rov qab mus rau "0" tom qab lub zog txav mus lawm). Nws kuj tseem tuaj yeem txuas ntxiv los ntawm teeb tsa SMS lossis Email ceeb toom, uas tuaj yeem tsim nyob hauv "Cov Txheej Txheem" tab hauv koj tus lej Ubidots.
Muaj lus nug? xav tias dawb los tawm tswv yim hauv qab no lossis tawm ib daim pib hauv peb nplooj ntawv txhawb nqa.
Nov yog lwm qhov haujlwm txias siv Raspberry Pi thiab lub suab txav:
Pom zoo:
Siv Kev Cia Siab Lub Hauv Paus txuas ntxiv txhawm rau Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Txoj Cai Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: 11 Kauj Ruam
Siv Kev Cia Siab Lub Hauv Paus Txuas Ntxiv kom Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: Lub hom phiaj ntawm cov lus qhia no yog los qhia seb yuav tshawb nrhiav koj tsev neeg tsob ntoo li cas hauv Tsev Neeg Nrhiav rau cov poj koob yawm txwv nrog kev ua haujlwm hauv lub tuam tsev tsis tiav siv Kev Cia Siab lub hauv siab txuas ntxiv. Siv Kev Cia Siab Lub Hauv Paus tuaj yeem ua rau koj qhov kev tshawb nrhiav tsis tiav
Chaw Nres Tsheb Huab Cua DIY & WiFi Chaw Nres Tsheb Sensor: 7 Kauj Ruam (nrog Duab)
Chaw Tshawb Xyuas Huab Cua DIY & WiFi Chaw Nres Nkoj: Hauv qhov haujlwm no kuv yuav qhia koj yuav tsim lub chaw nres tsheb huab cua nrog rau qhov chaw nres tsheb WiFi sensor. Lub chaw nres tsheb ntsuas ntsuas cov ntaub ntawv kub thiab av noo hauv cheeb tsam thiab xa nws, los ntawm WiFi, mus rau chaw nres tsheb huab cua. Cov chaw nres tsheb huab cua tom qab ntawd qhia t
Ultrasonic Sensor txhawm rau txhawm rau Hloov Txoj Haujlwm ntawm Cov Hom Phiaj: 3 Kauj Ruam
Ultrasonic Sensor txhawm rau txhawm rau Hloov Txoj Haujlwm ntawm Cov Hom Phiaj: Nws yog ib qho tseem ceeb kom koj cov khoom muaj txiaj ntsig muaj kev nyab xeeb, nws yuav ceg tawv yog tias koj saib xyuas koj lub tsev fuabtais tas hnub. Siv lub koob yees duab raspberry pi koj tuaj yeem siv lub snaps ntawm lub sijhawm. Phau ntawv qhia no yuav pab koj tua video lossis thaij duab
FinduCar: Lub Ntsej Muag Tsheb Ntsuas Qhia Cov Neeg rau Qhov Chaw Lub Tsheb Nres Tsheb: 11 Cov Kauj Ruam (nrog Duab)
FinduCar: Ntse Lub Ntsiab Tseem Ceeb Qhia Tib Neeg rau Qhov Chaw Tsheb Nres Tsheb: Txhawm rau daws cov teeb meem saum toj no, txoj haujlwm no tawm tswv yim txhawm rau txhim kho tus yuam sij tsheb ntse uas tuaj yeem coj tib neeg mus rau qhov chaw lawv nres tsheb. Thiab kuv txoj kev npaj koom nrog GPS rau hauv lub tsheb tseem ceeb. Tsis tas yuav siv lub smartphone app los taug qab
Ua Lub Sijhawm Tawm Ntawm Lub Tsheb Nres Nres Nres Disc: 7 Kauj Ruam
Ua Lub Sijhawm Tawm Ntawm Lub Tsheb Nres Nres Nres: Nov yog qhov koj tuaj yeem ua nrog txhua qhov qub/qub tsheb kauj vab nres uas koj tau dag ib puag ncig! ntsia liaj qhov rooj thiab 2 txiv ntoo kom haum lawv (xaiv tau)- brasso- daim txhuam cev hauv chav ua noj + phuam