Cov txheej txheem:
- Kauj Ruam 1: Tau Txais Cov Khoom Zoo
- Kauj Ruam 2: Txuas Cov Khoom Txuas
- Kauj ruam 3: Casing
- Kauj Ruam 4: Coding Koj RPi
- Kauj Ruam 5: Tso Koj Cov Ntaub Ntawv
- Kauj Ruam 6: Ua kom tiav
Video: Yuav Ua Li Cas Tsim Tib Neeg Suav Nrog Raspberry Pi thiab Ubidots: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Hauv txoj haujlwm yooj yim no peb yuav siv lub ntsuas suab txav mus kuaj yog tias ib qho khoom hla dhau ntawm peb Raspberry Pi. Tom qab ntawd peb yuav suav pes tsawg zaus uas tshwm sim, thiab xa tus nqi no mus rau Ubidots.
Cov neeg suav khoom feem ntau yog cov cuab yeej kim siv hauv kev lag luam muag khoom kom nkag siab tias cov neeg yuav khoom coj li cas. Ua tsaug rau Raspberry Pi thiab Ubidots, peb muaj peev xwm tsim cov neeg ua haujlwm zoo hauv ob peb teev thiab nrog ob peb nyiaj!
Thaum peb xa cov neeg suav cov ntaub ntawv mus rau Ubidots, peb tuaj yeem tsim cov duab zoo rau kev tshuaj xyuas, nrog rau SMS/Email ceeb toom.
Kauj Ruam 1: Tau Txais Cov Khoom Zoo
Txhawm rau ua tiav txoj haujlwm no koj yuav xav tau:
- Raspberry Pi Qauv B.
- PIR Sensor los ntawm Parallax
- Raspberry Pi tau tshaj USB WiFi Dongle
- Ib lub roj teeb USB ntim rau lub hwj chim Raspberry Pi (qhov no yog nyob ntawm qhov xwm txheej koj xav tawm hauv Pi kom tsis muaj wireless kiag li)
- Peb tus poj niam-poj niam jumper xov hlau
- Ubidots tus account - lossis - STEM License
Kauj Ruam 2: Txuas Cov Khoom Txuas
PIR tsab ntawv tsa suab sensor yog qhov yooj yim siv vim tias nws tsuas muaj peb tus pin:
- V+ ua
- GND
- Lub cim teeb liab uas tawm "1" thaum muaj kev txav mus los thiab "0" thaum tsis muaj.
Tsis tas yuav tsum ua dab tsi los xij, lossis sau qhov nyuaj I2C lossis cov haujlwm ua haujlwm kom pom lub teeb liab no; tsuas yog ntsaws cov kab ncaj ncaj rau GPIO pins ntawm koj Raspberry Pi thiab nws yuav ua haujlwm!
Kauj ruam 3: Casing
Vim tias PIR lub ntsuas hluav taws xob nkag tau yooj yim heev, kuv tau siv lub jumper hloov tom qab nws los teeb tsa qhov qis tshaj plaws. Tsis tas li ntawd, Kuv tau nqa cov ntaub ntawv qub los ntawm ob lub looj tsom iav thiab ua lub qhov nyob hauv nws, tom qab ntawd muab RPi thiab PIR sensor tso rau hauv. Txoj kev no, lub suab txav txav tau tsom mus rau ib qho, tsis txhob ua txhua yam.
Kauj Ruam 4: Coding Koj RPi
Txog ntawm qhov no, peb yuav xav tias koj tau ua tiav kev teeb tsa yooj yim ntawm koj li Raspberry Pi thiab koj tab tom saib nws cov kab hais kom ua Linux. Yog tias tsis yog, peb pom zoo kom hla dhau phau ntawv qhia no ua ntej. Koj tseem tuaj yeem tshawb xyuas cov ntawv no hais txog kev siv Wicd los teeb tsa WiFi ntawm koj li Raspberry Pi.
Cia peb pib los ntawm kev ua kom ntseeg tau tias peb muaj txhua lub tsev qiv ntawv xav tau:
$ sudo apt-tau hloov tshiab $ sudo apt-tau upgrade $ sudo apt-tau nruab python-setuptools $ sudo easy_install pip $ pip nruab ubidots
Tsim cov ntawv tshiab hu ua "peoplecounter.py":
$ sudo nano peoplecounter.py
Thiab sau rau hauv nws cov cai hauv qab no. Nco ntsoov hloov qhov tseem ceeb ntawm tus lej API thiab tus lej sib txawv nrog tus lej hauv koj tus kheej Ubidots tus account. (Nco tseg: tus lej tsis zoo nkauj heev, tab sis hav kuv tsis yog Python tus tsim tawm, tsuas yog tus txiv neej kho vajtse:)
Tsab ntawv suav nrog lub voj uas txheeb xyuas lub xeev tus pin #7 (lub suab txav). Yog nws nyeem "1", txhais tau tias muaj kev txav mus los, tom qab ntawd nws nce "cov neeg suav" sib txawv thiab tos 1.5 vib nas this kom lub suab txav mus rov zoo li qub. Qhov no ua tiav 10 zaug, ua kom ntseeg tau tias muaj tsawg kawg 1 thib ob ntawm txhua lub voj voog, tom qab ntawd nws xa tag nrho cov "txav" mus rau Ubidots. Yog tias koj xav tau ntsuas tus neeg suav, koj yuav tsum ua si nrog kab "time.sleep" nrog rau lwm qhov txiaj ntsig.
los ntawm ubidots ntshuam ApiClient
ntshuam RPi. GPIO ua GPIO
lub sij hawm ntshuam
GPIO.setmode (GPIO. BCM)
GPIO.setup (7, GPIO. IN)
sim:
api = ApiClient ("a21ebaf64e14d195c0044fcc3b9f6dab9d653af3")
neeg = api.get_variable ("5238cec3f91b282c7357a140")
tshwj tsis yog: luam tawm "Tsis tuaj yeem txuas rau API, txheeb xyuas koj li Internet txuas"
cov = 0
neeg = 0
thaum (1):
muaj = GPIO.input (7)
yog (muaj):
neeg suav = = 1
muaj = 0
sijhawm.sleep (1.5)
sijhawm.sleep (1)
tus nqi += 1
yog (counter == 10):
luam cov neeg
neeg.save_value ({'tus nqi': neeg coob})
cov = 0
neeg = 0
Kauj Ruam 5: Tso Koj Cov Ntaub Ntawv
Thaum kawg, mus rau koj lub Ubidots dashboard thiab ntxiv cov cuab yeej ntawm hom "Nqe lus". Qhov no yuav tso tawm tag nrho cov neeg tau kuaj pom nyob rau lub sijhawm uas koj qhia
Kauj Ruam 6: Ua kom tiav
Txoj haujlwm no muab cov lus qhia ntawm cov neeg hla dhau qhov tshwj xeeb. Nws tsis muab pes tsawg tus neeg, muab cov kev txwv ntawm lub suab sensor, tab sis hauv qee daim ntawv thov qhov no yuav txaus.
Cov ntaub ntawv sau tuaj yeem xa tau yooj yim mus rau Ubidots Cloud, qhov twg nws tuaj yeem txhais los ntawm kev tsim kev ceeb toom, nyob dashboards lossis txawm tias sib qhia cov ntaub ntawv no hauv kev tshaj xov xwm, raws li cov lej nkag, lossis tsuas yog hauv qhov txuas rau pej xeem. Koj tseem tuaj yeem nyeem cov ntaub ntawv no los ntawm lwm daim ntawv thov siv Ubidots API.
Pom zoo:
Yuav Tsim Li Cas thiab Ntxig Ib Lub Rooj Thiab Ntxiv Kab Ntxiv Thiab/lossis Kab Rau Cov Lus Hauv Microsoft Office Word 2007: 11 Cov Kauj Ruam
Yuav Tsim Li Cas thiab Ntxig Cov Lus Thiab Ntxiv Kab Ntxiv Thiab/lossis Kab Rau Cov Lus Hauv Microsoft Office Word 2007: Koj puas tau muaj cov ntaub ntawv ntau uas koj ua haujlwm nrog thiab xav rau koj tus kheej … " Kuv yuav ua li cas ntawm cov ntaub ntawv no saib zoo dua thiab nkag siab yooj yim dua? " Yog tias yog, tom qab ntawd lub rooj hauv Microsoft Office Word 2007 yuav yog koj cov lus teb
Yuav Ua Li Cas Ua Tib Neeg Tib Neeg: 8 Kauj Ruam
Yuav Ua Li Cas Ua Tib Neeg Tus Neeg Hlau: Hav guys! Kuv vam tias koj twb nyiam kuv cov lus qhia yav dhau los " Online Weather Station (NodeMCU) " thiab koj tau npaj rau qhov tshiab, Tom qab SMARS tus qauv neeg hlau uas peb tau sib sau zaum kawg, hnub no txoj haujlwm, tseem hais txog kev kawm neeg hlau thiab
Yuav Ua Li Cas Tib Neeg Ua Raws Li Neeg Hlau Nrog Arduino: 3 Kauj Ruam
Yuav Ua Li Cas Tib Neeg Ua Raws Li Neeg Hlau Nrog Arduino: Tib neeg ua raws tib neeg lub siab thiab ua raws tib neeg
SMD Soldering Practice Kit, lossis Kuv Yuav Kawm Li Cas Kom Tsis Txhob Txhawj Xeeb Thiab Nyiam Cov Khoom Siv Suav Suav Pheej Yig: 6 Kauj Ruam
SMD Soldering Practice Kit, lossis Kuv Yuav Ua Li Cas Kuv Thiaj Li Tsis Rhuav Txaus Siab Thiab Nyiam Cov Khoom Siv Suav Pheej Yig: Qhov no tsis yog Qhia Qhia txog kev siv tshuaj txhuam. Nov yog Cov Lus Qhia txog yuav tsim cov khoom siv Suav pheej yig li cas. Cov lus hais yog tias koj tau txais yam koj them rau, thiab ntawm no yog qhov koj tau txais: Cov ntaub ntawv tsis zoo. Cov lus nug tsis zoo. Tsis muaj kev txhawb nqa Yog li vim li cas thiaj yuav
Ib qho yooj yim heev/yooj yim/Tsis yooj yim txoj hauv kev kom tib neeg/tib neeg/tsiaj/neeg hlau zoo li lawv muaj txias tiag tiag/Lub zeem muag tshav kub kub (Xim ntawm Koj Xaiv) Siv GIMP: 4 Cov Kauj Ruam
Ib qho yooj yim heev/yooj yim/Tsis yooj yim txoj hauv kev kom tib neeg/tib neeg/tsiaj/neeg hlau zoo li lawv muaj txias tiag tiag/Lub zeem muag tshav kub kub (Xim ntawm Koj Xaiv) Siv GIMP: Nyeem … lub npe