DS18B20: firikwensin zafin jiki na ruwa

Saukewa: DS18B20

Akwai na'urori masu auke da zafi da zafi iri iri, kamar su da LM35. Wasu an gina su cikin kayayyaki don takamaiman amfani tare da Arduino. Amma gabaɗaya, sune zasu auna zafin jiki busashshe, ma'ana, zafin yanayin iska. Amma akwai samfurin kankare wanda ke aiki don auna zafin jiki a cikin ruwa kuma ana kiran sa DS18B20. Wani keɓaɓɓen abu wanda zai iya zama mai amfani don wasu daga cikin ayyukan ku na DIY masu ban mamaki inda kuke wasa tare da wani nau'in ruwa wanda kuke buƙatar sanin wannan sigar.

A zahiri DS18B20 baya auna zafin jiki a cikin ruwa kawai, amma yana iya zama da amfani sosai don auna zafin jiki a ciki yanayin danshi da kuma karkashin wani ruwa. Don haka kuma zaku iya amfani dashi don auna yanayin zafin idan yanayi ya cika da danshi. Kuma kamar yadda na ce, fasalin iya nutsar da shi a cikin ruwa don auna zafin nasa yana daga cikin siffofin da ke sanya shi aiki mai ban mamaki.

Menene DS18B20?

Da kyau, ina tsammanin ya riga ya bayyana sarai, yana da na'urar firikwensin lantarki da ke iya auna zafin zafin iskar gas ko na ruwa. Bugu da kari, akwai fakiti daban-daban ko kunshin DS18B20, kamar na asali wanda kuke gani a babban hoto, ko kuma za'a iya haɗa shi cikin wasu PCBs, bincike mai nutsuwa, da dai sauransu. Don aikinku ya kamata ku zaɓi mafi dacewa tsari bisa ga abin da kuke so.

Misali, banda na TO-92 na yau da kullun, akwai kuma microSOP. Yiwuwa don haɗawa tare da Arduino mafi dacewa shine TO-92, tunda tare da fil nasa uku yana da sauƙin sakawa cikin allon burodi don haɗi.

Pinout

Ds18b20 fil

El DS18B20 mai kashe ido abu ne mai sauki gano. Misali, ɗaukar kunshin Dallas TO-92, wanda shine ɗayan shahararru, azaman tunani, zaku ga cewa yana da fil uku. Idan ka sa shi daga gaba, ma'ana, tare da zagaye sashin baya da kallon faffadar fuskar inda rubutun ya bayyana, pin din da ke hannun hagun ka 1 ne kuma wanda ke hannun dama shine 3. Saboda haka, 1 zai kasance na GND ko ƙasa, 2 na bayanai ne da 3 don ƙarfin lantarki.

A nan ya kamata mu ce, dabi'un da ya kamata ku sani:

  • Pin 1: dole ne ka haɗa shi da GND pin na Arduino, wato, zuwa 0v.
  • Pin 2: wannan fil din DQ ne ko kuma bayanai, wanda zai aiko da yanayin zafi da firikwensin ya auna shi zuwa Arduino ta wata yarjejeniya da aka sani da 1-Waya kuma hakan na buƙatar ɗakunan karatu na musamman da ayyuka don IDAN Arduino. Wannan zai ba da izinin amfani da lambar Arduino guda ɗaya kawai don haɗa na'urori masu auna firikwensin tare da wannan yarjejeniya ...
  • Pin 3: Za a iya amfani da shi daga 3 zuwa 5,5v, don haka zaka iya haɗa shi da 5v na Arduino.

DS18B20 halaye na fasaha da takaddun bayanai

Kamar koyaushe, haka ne mai ban sha'awa don sanin halaye na fasaha na firikwensin don sanin yadda yake aiki, don kar a lalata shi, kuma sama da komai don mu san inda iyakokin ma'aunin sa suke, tunda idan ƙimar da muke son aunawa ba tsakanin su bane, ba zai taimaka mana ba ya kamata ka nemi wani madadin.

Don yin wannan, ya fi kyau sauke a Takaddun bayanan masana'anta, kamar wanda yake a Dallas wancan zaka iya gani anan. A can za ku sami duk bayanan da suka dace. Kuma ku tuna cewa kodayake duk DS18B20 na iya zama kama, dangane da masana'anta ko kunshin zaku sami wasu canje-canje ...

Amma ba tare da la'akari da quirks ba, ga 'yan kaɗan bayanan fasaha na asali:

  • Yanayin zafin jiki: -55 zuwa 125ºC, sabili da haka, yana iya auna cikin gas ko ruwa a ƙasa ƙan ƙasa da kuma yanayin zafi mai ƙarfi.
  • Kuskure: DS18B20 yana da saurin amo na waje ko hargitsi wanda zai iya ba da ƙididdiga masu ƙima a cikin ma'aunai. Mararin kuskure ya haɗu da ragin 2ºC, kodayake a yanayin zafi tsakanin -10ºC da 85ºC, ma'ana, lokacin da bamu kusanci iyaka ba, zai iya zama rabin digiri ne kawai.
  • Yanke shawara: Kuna iya aiki tare da shawarwari da yawa ko ƙananan sauye-sauye waɗanda zaku iya ganowa tare da gwanayen analog ɗin Arduino. Na goyon bayan 9-bit, 10-bit, 11-bit, da 12-bit (tsoho). Wato, tana iya auna daga rabin zuwa rabi, daga kwata zuwa kwata, daga 0,125 zuwa 0,125ºC, ko daga 0,0625ºC bi da bi. Kuna iya canza wannan shirin ta lambar code.
  • Voltagearfin wuta: 3 zuwa 5,5v
  • Farashin: 1 zuwa 3 €

Haɗuwa tare da Arduino

Shafin haɗin Arduino - ds18b20

Kodayake akwai hanyoyi daban-daban don haɗa shi, mafi dacewa shine wanda kuke gani a wannan zane. Abu ne mai sauqi, tare da pin din GND a cikin alaqar da ta dace da hukumar Arduino, samar da wuta iri daya sannan bayanan zuwa ga kayan aikin ana duba su na Arduino analog da kuka zaba a cikin lambar shirye-shiryenku a cikin Arduino IDE. Amma kuma yana da kyau a saita 4,7k mai tsayayya (idan nisan kebul na bincike ya fi girma, juriya ya zama ƙasa, misali, na 5m na 3,3k, na 10 na 2,2, XNUMXk,…) don fil ɗin bayanan kuma ta haka ne koyaushe ya ɗaukaka shi.

Ga shirye-shirye a cikin Arduino IDE da kuma kyakkyawan hadewarsa da DS18B20 da kuma waccan yarjejeniya, ana bada shawarar ka sauke dakunan karatu Zazzabi na Dallas y OneWire daga muhalli. Kuma lambar tushe, yana iya zama wani abu kamar wannan misalin da na nuna:

#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); 
}

Infoarin bayani - Littafin Shirye-shiryen Arduino (PDF kyauta)


Abubuwan da ke cikin labarin suna bin ka'idodinmu na ka'idojin edita. Don yin rahoton kuskure danna a nan.

Kasance na farko don yin sharhi

Bar tsokaci

Your email address ba za a buga. Bukata filayen suna alama da *

*

*

  1. Mai alhakin bayanan: Miguel Ángel Gatón
  2. Dalilin bayanan: Gudanar da SPAM, gudanar da sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.