Sele inqaku elidlulileyo thaca iDHT11, enye yeqondo lobushushu kunye nomswakama onawo. Kodwa kweli nqaku litsha siza kukuxelela yonke into ofuna ukuyifumana malunga ne-DHT22. Ngokwesiqhelo, ekuboneni kuqala umahluko kuphela phakathi kwe-DHT11 kunye ne-DHT22 kukuba eyokuqala iza ngesitadi esiluhlaza kwaye eyokugqibela imhlophe. Ngapha koko, bobabini ngabazalwana bosapho olunye lweenzwa.
El I-DHT11 ngubhuti omncinciOko kukuthi, ineentsilelo okanye izibonelelo ezingaphantsi ngokubhekisele kwi-DHT22, kwaye ke ixabiso eliphezulu. I-DHT11 inokusetyenziselwa iiprojekthi apho ungadingi ngqo imilinganiselo ephezulu, ngelixa ufuna into echanekileyo ngakumbi kufuneka ukhethe i-DHT22. I-22 ayichanekanga ngokuchanekileyo nokuba kunjalo, kodwa inezinto ezingaphezulu kwezamkelekileyo kwiiprojekthi ezininzi ze-DIY.
Yintoni i-DHT22?
El I-DHT22 bubushushu kunye nesenzi sokuziva esineempawu ezisondele kakhulu kukuchaneka okuphezulu. Ungayifumana ngokulula kwiivenkile ezizodwa okanye kwiivenkile zesebe, apho Akukho mveliso ifunyenweyo. Oku kukuvumela ukuba ungaxhomekeki kwisenzi sobushushu kunye nesenzi sokufuma ngokwahlukeneyo, kodwa ukuba nayo yonke into idityaniswe kwisixhobo esinye.
Ungayifumana ikhululekile okanye kwiimodyuli ezenzelwe ngokukodwa iArduinookt i-DHT22 inyuswe kwibhodi ye-PCB ekulungele ukusetyenziswa, ngaphandle kokongeza ii-resistors zokutsala, njl. Ukuza kuthi ga ngoku yonke into ijongeka njenge-DHT11. Kwaye uya kuba nokuthembeka okuphezulu kunye nozinzo kwimilinganiselo ngenxa yomqondiso wedijithali olinganisiweyo oyisebenzisayo.
Ukuphuma, amanqaku kunye neenkcukacha zedatha
Kumfanekiso ongentla ungabona uthelekiso lwe I-DHT22 kunye ne-DHT11 pinout, kwaye njengoko ubona ziyafana ngokwe-sideburns. Ke ngoko, indibano yayo iya kufana ncam, kwaye eyona nto intle kukuba, unokutshintsha i-DHT11 nge-DHT22 ngalo naliphi na ixesha, kwaye ngokufanayo, kwiprojekthi yakho ngaphandle kokwenza utshintsho oluninzi.
Khumbula ukuba banezikhonkwane ezi-3 ekufuneka uzisebenzisile: GND, Vcc kunye neDatha. I-Pin # 3 ayisetyenziswanga kwaye kwiimodyuli zidlulile, oko kukuthi, uya kubona izikhonkwane ezintathu kuphela. Ukuba ufuna ukubona iinkcukacha ezithe kratya malunga nemveliso oyithengileyo, unokukhangela kwiphepha ledatha lemodeli ethile kunye nomenzi ukufumana lonke ulwazi olupheleleyo. Nangona uninzi lwamaxabiso anokujongeka ngokufanayo kuwe, kunokubakho ukwahluka okuncinci ukusuka kwelinye ukuya kwelinye. Iimpawu zayo zobugcisa ezibaluleke kakhulu zezi:
- Ukunikezelwa kwamandla ukusuka kwi-3,3v ukuya kwi-6v
- Ukusetyenziswa kwe-2,5mA yangoku
- Umqondiso wemveliso yedijithali
- Uluhlu lobushushu ukusuka -40ºC ukuya ku-125ºC
- Ukuchaneka ukulinganisa ubushushu kwi-25ºC ye-0.5ºC umahluko
- Isisombululo sokulinganisa ubushushu ngu-8-bit, 0,1ºC
- Ukufuma kunokulinganisa ukusuka kwi-0% RH ukuya kwi-100% RH
- Ukufuma ngokuchanekileyo 2-5% RH kumaqondo obushushu aphakathi kwe0-50ºC
- Isisombululo yi-0,1% RH, ngekhe uthabathe umahluko apha ngezantsi
- Isampulu yenqanaba leesampulu ezi-2 ngomzuzwana: 2Hz
- Iphetshana ledatha leSparkfun
Ukuba uyifundile incwadi yethu yesikhokelo kwi-DHT11 uyakuyazi loo nto idlulisa kwidijithali i-pin yayo yeDatha, ke, enye inzuzo kwezi zivamvo. Akusayi kubakho mfuneko yokuvelisa ikhowudi kwi-IDE yeArduino ukusuka kwi-analog ukuya kumaxabiso aqondakalayo omntu, kodwa isiginali yedijithali inokuqhubekeka ngokuthe ngqo ukuyidlulisela kwiidigri okanye ipesenti yokufuma okuhambelana.
Ngokuyinxenye, oku ikwsi sizathu sokuba ichaneke kangako, kuba i Isakhelo se-40-bit Ukuhambisa, ukuchaneka kuphezulu. Ikwaquka iibitits ezimbalwa zokufumanisa ukusilela komqondiso. Awunayo loo nto ngesiginali ye-analog, ngaphandle kwento yokuba uphawu lwe-analog lubuthathaka kakhulu kukwahluka kwamandla ...
Umdibaniso neArduino
Njengakwi-DHT11, ukufaka i-DHT22 ngeArduino kulula kakhulu. Khumbula ukuba ukuba uyisebenzisa wedwa, ngaphandle kokuba inyuswe kwimodyuli kwaye isivamvo sikude (okanye ukuba usebenzisa ombane osezantsi ukuyinika amandla), kuyakufuneka usebenzise isichasi sokutsala esenza ibhulorho phakathi kwe Iphini yeVcc kunye nephini yedatha. Kodwa ukuba usebenzisa imodyuli, ungagcina kwaye uyixhume ngokuthe ngqo njengoko kubonakala kumfanekiso ongentla… Kwakhona, khumbula ukuba kwimodyuli ikhonkco le-NC elingasetyenziswanga alizukubakho, ke kuya kubalula kuwe ukungadideki.
Kufuneka udibanise i-GND kunye neVcc kwi unxibelelwano olufanelekileyo lwebhodi yakho yeArduinoOko kukuthi, kwabo baphawulwe njenge-GND kunye no-5v kule meko. Kwaye kwipini yedatha, ungayidibanisa nayo nayiphi na igalelo ledijithali ye-Arduino, kwimeko yethu siyenzile ngo-7. Ukuba usebenzisa enye, khumbula ukulungisa ikhowudi ukuze isebenze nendlela yakho yokudibanisa izinto ( kubonakala icacile kodwa yimpazamo eqhelekileyo xa ukopa kwaye uncamathisela iikhowudi kwiArduino IDE).
Ikhowudi kwiArduino IDE
Ngoku ukuba uqhagamshele, masibone umzekelo olula wekhowudi yeArduino IDE. . Khumbula ukuba sinesikhokelo somqali esiqala ngeArduino kwiPDF onakho khuphela simahla apha kwaye inokukunceda. Kwakhona, ukuba ulifundile inqaku lethu kwi-DHT11, khumbula oko Kwakukho ithala leencwadi lokusebenzisa i-DHTxx sensorsKungoko enye ibisetyenziselwa i-DHT11 inokusetyenziselwa i-DHT22.
Nje ukuba unayo ufake ilayibrari kwaye yonke into ilungile, ngoku kulapho kufuneka ufake ikhowudi ukucwangcisa i-Arduino microcontroller ukwenza ukuba iprojekthi yakho isebenze. Umzekelo osisiseko uya kuba:
#include "DHT.h" // Ejemplo sencillo de uso para el DHT22 const int DHTPin = 7; DHT dht(DHTPin, DHTTYPE); void setup() { Serial.begin(9600); Serial.println("Test DHT22"); dht.begin(); } void loop() { // Tiempo de espera entre tomas de mediciones de 2 segundos. delay(2000); // Lee temperatura y humedad durante unos 250ms float h = dht.readHumidity(); float t = dht.readTemperature(); if (isnan(h) || isnan(t)) { Serial.println("Fallo en la lectura"); return; } Serial.print("Humedad relativa: "); Serial.print(h); Serial.print(" %\t"); Serial.print("Temperatura: "); Serial.print(t); Serial.print(" *C "); }
Ndiyanqwena ukuba Izikhokelo zethu kwi-DHTxx zisebenze njengesikhokelo sakhoNangona iiprojekthi zihlala zenziwa zinzima ngakumbi, kodwa ezi khowudi ukubona indlela esebenza ngayo inzwa iyalatha kwaye uguqule ikhowudi kwaye ungeze nantoni na oyifunayo ...
ulwazi olulungileyo luthunyelwe. Inqaku elinye kuphela elinokubandakanya umhla wokupapashwa. ngamanye amaxesha siyayifuna njengesalathiso semisebenzi ebhalwe ngemigangatho. Enkosi.