Ukulinganisa ubushushu kunye nokufuma kuqheleke kakhulu kwiiprojekthi ezininzi zokwenza umbane. Kwi-DIY kuyinto eqhelekileyo ukuba ulinganise ezi paramitha ukulawula iinkqubo ezithile. Umzekelo, ukuze ukwazi ukwenza ifriji, ukhathalelo lwezityalo, okanye inkqubo yomoya oqala ukuba ubushushu okanye ukufuma kufikelela kwixabiso elithile. Kodwa ukuze oko kwenzeke kufuneka ufuna isivamvo esinjenge-DHT11.
Kwimarike zininzi izivamvo Uluhlu lwamaqondo obushushu ahluke kakhulu, anamaqondo obushushu axhaswayo okanye ulungelelwaniso olwahlukileyo. Umzekelo woku i-LM35, enye yezona zidumileyo kwaye zisetyenziswa kwi-elektroniki. Kukho nezinye iisenzi zokufuma ezisebenza ngokwahluka kwe-conductivity njenge-AD22103KTZ kwii-Analog Devices. Kodwa ukuba ufuna ukulinganisa zombini iiparameter, mhlawumbi isixhobo esixoxa ngaso kweli nqaku namhlanje sinomdla ngakumbi ...
Yintoni i-DHT11?
El I-DHT11 sisixhobo esilula esilinganisa ubushushu kunye nokufuma, zonke kwenye. A) Ewe Awuyi kuthenga iisenzi ezimbini ngokwahlukeneyo. Ixabiso layo li malunga ne- € 2, ke ngexabiso eliphantsi, nangona ungayifumana ikwimodyuli (inyuswe kwi-PCB ukulungiselela ukusetyenziswa kwayo) njengesiqhelo kolu hlobo lwezinto ze-elektroniki zeArduino. Kwimeko yebhodi, ibandakanya i-5 yeekhilogram ohm yokutsala kunye ne-LED esilumkisa ngalo msebenzi.
I-DHT11 inayo ukuthembeka okuphezulu kunye nozinzo ngenxa yomqondiso wedijithali olinganisiweyo. Kwakhona, ukuba ujonga kwiphepha ledatha, uyakubona ukuba inezinto ezinomdla njengoko uza kubona kumacandelo exesha elizayo.
Iimveliso ezifanayo
Kukho imveliso efana ne-DHT11 onokuba nomdla kuyo. Yi i-DHT22. Ikwayiqondo lobushushu elihlanganisiweyo kunye nokufuma, kodwa kule meko ixabiso layo liphezulu kancinci, malunga ne- € 4. Ukuchaneka ukulinganisa ubushushu yi-5% yokwahluka kwakhona njenge-DHT11, kodwa ngokungafaniyo nayo, ilinganisa ngaphaya koluhlu lokufuma phakathi kwama-20 nama-80%. Ke ngoko, unokuba nomdla kwi-DHT22 yeeprojekthi apho ufuna ukulinganisa ukufuma ukusuka kwi-0 ukuya kwi-100%.
La ukuqokelelwa kwedatha rhoqo Iphindwe kabini leyo ye-DHT11, kwi-DHT22 iisampulu ezi-2 zithathwa ngomzuzwana endaweni yesampulu enye nge-DHT1. Ngokubhekisele kwiqondo lobushushu, lingalinganisa ukusuka -11 toC ukuya ku-40ºC ngokuchaneka ngakumbi, kuba iyakwazi ukulinganisa amaqhezu eedigri, ngakumbi inokukuqonda ukwahluka kokudibanisa / thabatha 125ºC.
Ukuphuma, amanqaku kunye neenkcukacha zedatha
Unokufumana ulwazi oluncinci lobuchwephesha malunga I-DHT11 kuxwebhu lwakho lwedatha. Umvelisi ngamnye wale fowuni unokunika amaxabiso anokwahluka, ke ndihlala ndicebisa ukufunda iPDF yomenzi othile wesixhobo osithengileyo. Nangona uninzi lwamaxabiso anokujongeka ngokufanayo kuwe, kunokubakho ukwahluka okuncinci ukusuka kwelinye ukuya kwelinye. Iimpawu zayo zobugcisa ezibaluleke kakhulu zezi:
- Ukunikezelwa kwamandla ukusuka kwi-3,5v ukuya kwi-5v
- Ukusetyenziswa kwe-2,5mA yangoku
- Umqondiso wemveliso yedijithali
- Uluhlu lobushushu ukusuka ku-0ºC ukuya ku-50ºC
- Ukuchaneka ukulinganisa ubushushu kuma-25ºC malunga no-2ºC umahluko
- Isisombululo sokulinganisa ubushushu ngu-8-bit, 1ºC
- Ukufuma kunokulinganisa ukusuka kwi-20% RH ukuya kwi-90% RH
- Ukufuma ngokuchanekileyo yi-5% RH kumaqondo obushushu aphakathi kwe-0-50ºC
- Isisombululo yi-1% RH, ngekhe uthabathe umahluko apha ngezantsi
- Iphepha ledatha leMouser
Ngokumalunga nedatha, usasazo lwedijithali. Ke ngoko, akukho mfuneko yokuba uhambe ukusuka kwi-analog ukuya kwidijithali njengakwezinye iisenzi. Oko kunzima ikhowudi ukubhala kwi-Arduino IDE, kodwa kule meko ayifuneki kwaye kulula kakhulu. Nangona inzwa ngokwayo iyi-analog, kodwa ibandakanya inkqubo yokwenza uguquko kwaye inokudityaniswa ngokuthe ngqo kwigalelo ledijithali yeArduino.
Uphawu lwe-analog, olwahlukileyo kumandla ombane, ovela kwisenzi woluvo uguqulwa ube yifomathi yedijithali ukuze ithunyelwe kwi-Arduino microcontroller. Idluliselwa kwi isakhelo se-40-bit Ehambelana nokufuma kunye nolwazi lobushushu olufakwe yi-DHT11. Amaqela amabini okuqala angama-8-bit enzelwe ukufuma, oko kukuthi, ezona zinto zibalulekileyo ezili-16 zesakhelo. Emva koko amanye ama-2 aseleyo angama-8-bit amaqela ashushu. Oko kukuthi, inee-byte ezimbini zokufuma kunye nee-byte ezimbini kubushushu. Umzekelo:
0011 0101 0000 0010 0001 1000 0000 0000 0011 1001
Kule meko, 0011 0101 0000 0010 lixabiso lokufuma, kwaye 0001 1000 0000 0000 bubushushu. Inxalenye yokuqala yeyenani elipheleleyo kwaye icandelo lesibini lelidesimali. Ngokubhekisele ku-0011 1001, oko kukuthi, i ii-bit-8 zokugqibela ziyinxalenye ukunqanda iimpazamo. Ngale ndlela unokujonga ukuba yonke into ichanekile ngexesha lothumelo. Iyahambelana nesibalo seebhithi zangaphambili, ke ngoko, ukuba isixa-mali silingana nomlinganiso, iya kuchaneka. Kumzekelo endiwubekileyo, ngekhe ubekho, kuba njengoko ubona awuhambelani ... Oko kuya kubonisa ukusilela.
Nje ukuba oku kwaziwe, into elandelayo kwinqanaba lobuchwephesha le-DHT11 ekufuneka iqatshelwe zizikhonkwane. Inkqubo ye- abafowunelwa okanye i-pinout kwesi sixhobo kulula, kuba inee-4 zazo. Esinye sezikhonkwane sesamandla okanye i-Vcc, enye ye-I / O yokuhambisa idatha, ipini ye-NC engadibaniyo, kunye ne-GND yonxibelelwano lomhlaba.
Umdibaniso neArduino
Nje ukuba uyazi i-pinout ye-DHT11 kunye nayo Ibhodi yeArduino, unxibelelwano lulula kakhulu. Khumbula ukuba ukuba ukhethe imodyuli ye-DHT11 edityaniswe kwi-PCB, izikhonkwane ziya kuba zintathu, kuba i-NC isuswe ukwenza izinto zibe lula. Konke okufuneka ukwenze kukudibanisa ipini yomhlaba kwenye yonxibelelwano ye-Arduino's GND njengoko ibonakala kumzobo kumfanekiso ongaphambili.
Kwelinye icala, ipini yamandla kufuneka iqhagamshelwe Unxibelelwano lwe5v oluvela kwiArduino, Yiyo loo nto inzwa iya kuxhotyiswa ngokupheleleyo nge-GND kunye neVcc, kodwa ngoku idatha ilahlekile. Ukuhambisa idatha ukusuka kwisenzisi se-DHT11 ukuya kwibhodi yeArduino, ungasebenzisa naliphi na igalelo ledijithali, elinjenge-7 ebonakala emfanekisweni ... ikhowudi ...
Ukuba inzwa ikude kwiprojekthi yakho kwaye uza kusebenzisa intambo ixesha elingaphezu kweemitha ezingama-20, emva koko usebenzise isixhobo sokuthintela ukutsala esingaphezulu kwe-5k, kwiintambo ezinkulu kufanele ukuba zikhulu ngokulinganayo. Qaphela ukuba usebenzisa amandla e-3,5v endaweni ye-5v, ke intambo akufuneki ibe nde kune-20cm ngenxa yokuhla kwamandla ombane.
Khumbula ukuba into abayicebisayo yile thatha imilinganiselo rhoqo kwimizuzwana emi-5, nangona isampuli frequency apho i-DHT11 inokusebenza iphezulu, kodwa ukuba yenziwa rhoqo kunokuba isenokungachaneki.
Ikhowudi kwiArduino IDE
Ukuya ngqo kwikhowudi, yitsho ngaphakathi I-Arduino IDE ungasebenzisa inani lamathala eencwadi asele enempawu eziza kwenza ubomi bakho bube lula nge-DHT11. Umzekelo, enye yazo yile ibonelela ngeAdafruit. Khumbula ukuba sinesikhokelo somqali esiqala ngeArduino kwiPDF onakho khuphela simahla apha kwaye inokukunceda.
Nje ukuba ufake ithala leencwadi elingqinelanayo, unokuphawula ku ngenisa ikhowudi ukulawula ubushushu be-DHT11 kunye ne-humidity sensor yeprojekthi yakho kunye neArduino. Umzekelo:
#include "DHT.h" const int DHTPin = 7; DHT dht(DHTPin, DHTTYPE); void setup() { Serial.begin(9600); Serial.println("Midiendo..."); dht.begin(); } void loop() { delay(2000); float h = dht.readHumidity(); float t = dht.readTemperature(); if (isnan(h) || isnan(t)) { Serial.println("Fallo en la lectura del sensor DHT11"); return; } Serial.print("Humedad relativa: "); Serial.print(h); Serial.print(" %\t"); Serial.print("Temperatura: "); Serial.print(t); Serial.print(" ºC "); }