Kukho ukufuma kunye neqondo lobushushu ezahlukeneyo ezikhoyo, ezinje nge i-LM35. Ezinye zakhiwe kwiimodyuli zosetyenziso oluthile kunye neArduino. Kodwa ngokubanzi, kufuneka balinganise ubushushu obomileyo, okt ubushushu bomoya. Kodwa kukho imodeli yekhonkrithi esebenza kuyo Linganisa iqondo lobushushu kulwelo kwaye ibizwa ngokuba yiDS18B20. Into enokuza iluncedo kwezinye zeeprojekthi zakho ze-DIY ezingaqhelekanga apho udlala khona kunye nolunye uhlobo lolwelo ekufuneka uyazi le parameter.
Ngokwenyani i-DS18B20 ayilinganisi ubushushu kuphela ngaphakathi kolwelo, kodwa kunokuba luncedo kakhulu ukulinganisa ubushushu ngaphakathi iimeko ezifumileyo kunye naphantsi kolwelo oluthile. Ke unokuyisebenzisa ukulinganisa ubushushu bomoya ukuba imeko-bume ilayishwe ngokufuma. Kwaye njengoko benditshilo, inqaku lokukwazi ukuntywiliselwa kulwelo ukulinganisa ubushushu bayo yenye yeempawu ezenza ukuba zisebenze ngendlela emangalisayo.
Yintoni i-DS18B20?
Ewe, ndicinga ukuba sele icacile, sisivamvo se-elektroniki esikwaziyo ukulinganisa ubushushu beendaba ezinobushushu okanye ezingamanzi. Ukongeza, zikhona ukuhonjiswa okungafaniyo okanye ukupakishwa kweDS18B20, ezinje ezisisiseko ozibonayo kumfanekiso ophambili, okanye inokudityaniswa kwezinye iiPCB, iiprosesa zangaphantsi, njl. Kwiprojekthi yakho kuya kufuneka ukhethe eyona fomathi ifanelekileyo ngokokufuna kwakho.
Umzekelo, ngaphandle kwe-TO-92 yesiqhelo, kukwakhona ne-microSOP. Ngokunokwenzeka ukudibanisa ngeArduino eyona ilungileyo yi-TO-92, kuba ngezikhonkwane zayo ezintathu kulula kakhulu ukuyifaka kwibhodi yesonka kunxibelelwano.
Phina
El I-DS18B20 ikhonkco kulula ukuyichonga. Umzekelo, uthatha ireferensi iphakheji ye-Dallas TO-92, yenye yezona zidumileyo, uyabona ukuba inezikhonkwane ezintathu. Ukuba uyibeka ngaphambili, oko kukuthi, ngecandelo elijikeleziweyo umva kwaye ujonge ubuso obucwangcisiweyo apho kuvela khona imibhalo, ipini ekhohlo lakho li-1 kwaye enye ngasekunene ngu-3. okanye umhlaba, i-1 yedatha kunye ne-2 yombane wokubonelela.
Apha kufuneka sitsho ukuba, amaxabiso ekufuneka uwazi:
- Phina 1: kufuneka uyixhume kwipini ye-GND yeArduino, oko kukuthi, kwi-0v.
- I-Pin 2: le pin yi-DQ okanye idatha, eya kuthi ithumele amaqondo obushushu alinganiswe yi-sensor kwi-Arduino ngomgaqo othile owaziwa ngokuba yi-1-Wire kwaye oya kufuna ilayibrari ekhethekileyo kunye nemisebenzi ye-Arduino IDE. Oko kuyakuvumela ukusebenzisa ipini enye yeArduino ukudibanisa ii-sensors ezininzi ngale protocol ...
- I-Pin 3: Inokuxhotyiswa ukusuka kwi-3 ukuya kwi-5,5v, ukuze uyiqhagamshele kwimveliso ye-5v yeArduino.
Iimpawu zobuchwephesha zeDS18B20 kunye nedatha
Njengesiqhelo, kunjalo kunomdla ukwazi iinkcukacha Inzwa yokuqonda ukuba isebenza njani, ukuze ingonakalisi, kwaye ngaphezulu kwayo yonke into ukuze sazi ukuba imilinganiselo yayo ikuphi, kuba ukuba amaxabiso esifuna ukuwalinganisa awekho phakathi kwawo, ayizukusinceda kwaye kuya kufuneka ujonge enye indlela.
Ukwenza oku, kungcono ukukhuphela ifayile ye- ugcino lwedatha, njengaleyo iseDallas leyo uyabona apha. Apho uyakufumana lonke ulwazi oluyimfuneko. Kwaye khumbula ukuba nangona yonke i-DS18B20 inokufana, kuxhomekeke kumenzi okanye kwiphakheji onokulufumana utshintsho ...
Kodwa ngaphandle kwee-quirks, nazi ezimbalwa idatha esisiseko yobugcisa:
- Uluhlu lobushushu: -55 ukuya ku-125ºC, ke ngoko, inokulinganisa igesi okanye ulwelo kumaqondo asezantsi kakhulu nakumaqondo obushushu aphezulu.
- IimpazamoI-DS18B20 inovakalelo kwingxolo yangaphandle okanye ukuphazamiseka okunokunika amaxabiso aphosakeleyo kwimilinganiselo. Umda wempazamo udibanisa thabatha u-2ºC, nangona kumaqondo obushushu aphakathi kwe -10ºC kunye nama-85ºC, oko kukuthi, xa singasondelanga kwimida, inokuba sisiqingatha seqondo kuphela.
- IsigqiboUnokusebenza ngezigqibo ezininzi okanye utshintsho oluncinci onokulufumana ngezikhonkwane zeArduino analog. Ixhasa i-9-bit, 10-bit, 11-bit, kunye ne-12-bit (emiselweyo). Oko kukuthi, inokulinganisa ukusuka kwisiqingatha ukuya kwisiqingatha, ukusuka kwikota ukuya kwikota, ukusuka ku-0,125 ukuya ku-0,125ºC, okanye ukusuka ku-0,0625ºC ngokwahlukeneyo. Ungayitshintsha le nkqubo ngekhowudi yenkqubo.
- Umbane wokubonelela: 3 ukuya ku-5,5v
- Ixabiso: 1 ukuya kwi-3 €
Umdibaniso neArduino
Nangona zikhona iindlela ezahlukeneyo zokuyiqhagamshela, eyona ifanelekileyo yile uyibonayo kulo mzobo. Ilula kakhulu, kunye nepini ye-GND kunxibelelwano oluhambelana nebhodi yeArduino, amandla afanayo kunye nedatha kwi-analog yeArduino oyikhethileyo kwikhowudi yakho yenkqubo kwiArduino IDE. Kodwa kulungile ukuseta isitshixo sokutsala esingu-4,7k (ukuba umgama wentambo yesixhobo senzwa mkhulu, uxhathiso kufuneka lube sezantsi, umzekelo, i-5m ye-3,3k, ye-10 ye-2,2, XNUMXk,…) ipini yedatha kwaye ngenxa yoko ihlale iphakama.
Ku Inkqubo kwiArduino IDE kunye nokudityaniswa kwayo okuhle ne-DS18B20 kunye naloo mgaqo, kuyacetyiswa ukuba ukhuphele kumathala eencwadi Ubushushu baseDallas y Enye kwindalo esingqongileyo. Kwaye ikhowudi yesiseko, inokuba yinto efana nalo mzekelo ndiyibonisayo:
#include <OneWire.h> #include <DallasTemperature.h> // Pin donde se conecta el bus 1-Wire (DQ) const int pinDatosDQ = 9; // Instancia a las clases OneWire y DallasTemperature OneWire oneWireObjeto(pinDatosDQ); DallasTemperature sensorDS18B20(&oneWireObjeto); void setup() { // Iniciamos la comunicación serie a 9600 baudios Serial.begin(9600); // Iniciamos el bus 1-Wire del sensor sensorDS18B20.begin(); } void loop() { // Indicamos que tome la temperatura Serial.println("Midiendo temperatura"); sensorDS18B20.requestTemperatures(); // Lee y muestra la temperatura (recuerda que puedes conectar más de uno con 1-wire) Serial.print("La temperatura del sensor 0 es de: "); Serial.print(sensorDS18B20.getTempCByIndex(0)); Serial.println(" C"); Serial.print("La temperatura del sensor x es de: "); Serial.print(sensorDS18B20.getTempCByIndex(1)); Serial.println(" ºC"); delay(1000); }
Iinkcukacha ezithe vetshe - Incwadana yokuLungiselela iArduino (iPDF yasimahla)