Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Yuav Tsum Tau
- Kauj Ruam 2: Tsim Koj Li Circuit Court
- Kauj Ruam 3: Tsim Python Tsab Ntawv Nyeem thiab Sau Koj Cov Ntaub Ntawv
Video: Ua Cov Ntaub Ntawv Logger Nrog Raspberry Pi: 3 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Tus neeg siv cov ntaub ntawv yooj yim no ntsuas ntsuas lub teeb ib txwm nrog qhov sib piv LDR (Photoresistor) thiab khaws cia hauv cov ntawv sau ntawm koj li Raspberry Pi. Cov ntaub ntawv logger no yuav ntsuas thiab sau lub teeb theem txhua 60 vib nas this, tso cai rau koj los saib xyuas qhov ci ci hloov pauv mus li cas.
Yog tias peb xav siv cov ntsuas sib piv nrog Raspberry Pi, peb yuav tsum muaj peev xwm ntsuas qhov tsis kam ntawm lub ntsuas. Tsis zoo li Arduino, Raspberry Pi's GPIO pins tsis tuaj yeem ntsuas qhov tsis kam thiab tuaj yeem nkag siab tau yog tias qhov hluav taws xob muab rau lawv siab dua qee qhov hluav taws xob (kwv yees li 2 volts). Txhawm rau kov yeej qhov teeb meem no, koj tuaj yeem siv Analogue to Digital Converter (ADC), lossis koj tuaj yeem siv tus nqi hluav taws xob pheej yig dua.
Kauj Ruam 1: Yam Koj Yuav Tsum Tau
- RaspberryPi nrog Raspbian twb tau teeb tsa. Koj tseem yuav tsum muaj peev xwm nkag tau Pi siv Monitor, Mouse thiab Keyboard lossis los ntawm Remote Desktop. Koj tuaj yeem siv txhua tus qauv ntawm Raspberry Pi. Yog tias koj muaj ib qho ntawm Pi Zero cov qauv, koj yuav xav muab qee lub taub hau txuas rau GPIO chaw nres nkoj.
- Lub Teeb Ntsuas Tus Kheej (Kuj tseem hu ua LDR lossis Photoresistor)
- A 1 uF Ceramic Capacitor
- Ib Lub Cuab Yeej Tsis Txaus Siab Prototyping Breadboard
- Qee tus txiv neej rau poj niam jumper xov hlau
Kauj Ruam 2: Tsim Koj Li Circuit Court
Ua kom muaj cov kab lus saum toj no ntawm koj daim ntawv qhia zaub mov kom ntseeg tau tias tsis muaj ib feem ntawm cov khoom coj los kov. Lub Teeb Ntsuas Tus Kws Tiv Thaiv thiab Cov Khoom Siv Hluav Taws Xob tsis muaj qhov sib txawv uas txhais tau tias qhov tsis zoo thiab qhov zoo tam sim no tuaj yeem txuas nrog ob qho tib si. Yog li koj tsis tas yuav txhawj xeeb txog txoj kev uas cov khoom siv no tau txuas nrog hauv koj lub Circuit.
Thaum koj tau txheeb xyuas koj lub Circuit Court, ua tib zoo txuas lub jumper cables rau koj Raspberry Pi's GPIO pins los ntawm kev ua raws daim duab saum toj no.
Kauj Ruam 3: Tsim Python Tsab Ntawv Nyeem thiab Sau Koj Cov Ntaub Ntawv
Qhib IDLE ntawm koj li Raspberry Pi (Ntawv Qhia> Programming> Python 2 (IDLE)) thiab qhib qhov haujlwm tshiab (Cov Ntaub Ntawv> Cov Ntaub Ntawv Tshiab). Tom qab ntawv ntaus cov hauv qab no:
ntshuam RPi. GPIO ua GPIO
ntshuam lub sij hawm ntshuam datetime loginterval = 60 #log luv hauv vib nas this savefilename = "lightlevels.txt" SensorPin = 17 TriggerPin = 27
GPIO.setmode (GPIO. BCM)
cap = 0.000001 #1uf adj = 2.130620985
def ntsuas kev tiv thaiv (mpin, tpin):
GPIO.setup (mpin, GPIO. OUT) GPIO.setup (tpin, GPIO. OUT) GPIO.output (mpin, False) GPIO.output (tpin, False) time.sleep (0.2) GPIO.setup (mpin, GPIO. IN) time.sleep (0.2) GPIO.output (tpin, True) starttime = time.time () endtime = time.time () thaum (GPIO.input (mpin) == GPIO. LOW): endtime = time.time () xa rov qab kawg-pib lub sijhawm def sau ntawv (txt, fn): f = qhib (fn, 'a') f.write (txt+'\ n') f.close () i = 0 t = 0 thaum Tseeb: stime = time.time () rau hauv thaj tsam (1, 11): res = (ntsuas kev ntsuas (SensorPin, TriggerPin)/cap)*adj kuv = kuv+1 t = t+res yog a == 10: t = t/i print (t) writeline (str (datetime.datetime.now ())+","+str (t), savefilename) i = 0 t = 0 thaum lub sij hawm stime+loginterval> time.time (): #tos kom txog thaum teev sijhawm muaj dhau sijhawm.s pw (0.0001)
Txuag koj txoj haujlwm li datalogger.py (Cov Ntaub Ntawv> Txuag Raws Li) hauv koj cov ntawv tais ceev tseg.
Tam sim no qhib Terminal (Ntawv Qhia> Accessories> Terminal) thiab ntaus cov lus txib hauv qab no:
nab hab sej datalogger.py
Tsab ntawv yuav tsim cov ntawv sau npe "lightlevels.txt" thiab hloov kho nws txhua 60 vib nas this. Koj tuaj yeem hloov pauv cov npe no ntawm kab 6. Koj tseem tuaj yeem hloov kho cov ntaub ntawv hloov pauv ntau npaum li cas los ntawm hloov kab 5.
Pom zoo:
Ua Cov Phiaj Xwm Zoo Los Ntawm Cov Ntaub Ntawv Nyob Arduino (thiab Txuag Cov Ntaub Ntawv rau Excel): 3 Cov Kauj Ruam
Ua Cov Phiaj Xwm Zoo Los Ntawm Cov Ntaub Ntawv Nyob Arduino (thiab Txuag Cov Ntaub Ntawv rau Excel): Peb txhua tus nyiam ua si nrog peb tus lej L … cov ntsiab lus tau ntxiv thiab nws tsis tshwj xeeb rau lub qhov muag. Arduino IDE cov phiaj xwm tsis
Yuav Ua Li Cas Vaum Thiab Kub Tiag Tiag Cov Ntaub Ntawv Teev Npe Nrog Arduino UNO thiab SD-Card - DHT11 Cov ntaub ntawv-logger Simulation hauv Proteus: 5 Cov Kauj Ruam
Yuav Ua Li Cas Vaum Thiab Kub Tiag Tiag Cov Ntaub Ntawv Teev Npe Nrog Arduino UNO thiab SD-Card | DHT11 Cov ntaub ntawv-logger Simulation hauv Proteus: Taw qhia: nyob zoo, qhov no yog Liono Maker, ntawm no yog YouTube txuas. Peb tab tom tsim txoj haujlwm muaj tswv yim nrog Arduino thiab ua haujlwm ntawm cov kab ke. Cov ntaub ntawv-Logger: Cov ntaub ntawv logger (tseem cov ntaub ntawv-logger lossis cov ntaub ntawv kaw) yog cov cuab yeej siv hluav taws xob uas sau cov ntaub ntawv dhau sijhawm
Txoj hauv kev zoo dua los Saib/Ntaub Ntawv Cov Ntaub Ntawv ntawm Cov Lus Qhia: 4 Cov Kauj Ruam
Txoj hauv kev zoo dua los Saib/Cov Ntaub Ntawv ntawm Kev Qhia: Tib neeg feem ntau suav nrog cov ntaub ntawv rau qhov haujlwm ntawm Instructables upload.Ua ntej qhov no yog software cov ntaub ntawv cov ntaub ntawv uas tej zaum tseem yuav yog lub plawv dhia ntawm kev qhia. Tab sis Instructables tsis muab txoj hauv kev rau tus nyeem yooj yim nyeem thiab tshuaj xyuas cov cai. (
RAWS LI COV NTAUB NTAWV NTSEEG NTAWV NTAWV MUAJ NTAWV TSHUAJ NTAWV TSO CAI RAU RASPBERRY PI: 6 Kauj Ruam (nrog Duab)
RAWS LI COV NTAUB NTAWV NTAWV MUAJ NTAWV TSHUAJ NTXIV RAU RASPBERRY PI: Hauv qhov haujlwm no, peb yuav txuas peb ntawm Atlas Scientific's EZO sensors (pH, yaj cov pa thiab kub) mus rau Raspberry Pi 3B+. Hloov chaw ntawm txuas cov kab hluav taws xob mus rau Raspberry Pi, peb yuav siv Whitebox Labs Tentacle T3 daim ntaub thaiv. T
IoT Cov Ntaub Ntawv Kev Tshawb Fawb PiNet rau Lub Sijhawm Tiag Smart Screen Cov Ntaub Ntawv Viz: 4 Cov Kauj Ruam
IoT Cov Ntaub Ntawv Kev Tshawb Fawb PiNet rau Lub Sij Hawm Tiag Smart Screen Cov Ntaub Ntawv Viz: Koj tuaj yeem yooj yim ua ke IoT network ntawm cov lus qhia ntse rau cov ntaub ntawv pom tau los ua kom muaj zog ntxiv koj li kev tshawb fawb hauv Cov Ntaub Ntawv Kev Tshawb Fawb lossis ib qho kev ua haujlwm ntau. Koj tuaj yeem hu rau " thawb " ntawm koj cov phiaj rau cov neeg siv khoom raug cai los ntawm koj li