»óÇ°Ä«Å×°í¸® > ¼¾¼­ > ¿Âµµ/½Àµµ

DS18B20 µðÁöÅÐ ¿Âµµ°è Digital Thermometer
ÆǸŰ¡°Ý : 1,540¿ø (ºÎ°¡¼¼ Æ÷ÇÔ)
»óÇ°ÄÚµå : [3127]MIZ-DS18B2-ZAS
¹è¼ÛÀÏ : ´çÀϹ߼Û
Á¦Á¶»ç : OEM
³²Àº¼ö·® : 6°³
±¸¸Å¼ö·® :
°³
ÃÑ ±Ý¾× :
Ãß°¡&´ë·®±¸¸Å ¿äû 053-588-4080

  • »óÇ°»ó¼¼
  • °ü·Ã»óÇ°
  • ¹è¼Û/±³È¯/¹ÝÇ° ¾È³»
  • »óÇ°¸®ºä

1°³ÀÇ ÇÉÀ¸·Î ¿Âµµ°ªÀ» ÀоîµéÀÏ ¼ö ÀÖ´Â ¼¾¼­ÀÔ´Ï´Ù.


ºÎ°¡ÀûÀ¸·Î Ç®¾÷ÀúÇ×ÀÌ ÇÊ¿äÇÕ´Ï´Ù.


µðÁöÅÐ Çü½ÄÀ¸·Î ½ÅÈ£¸¦ Ãâ·ÂÇϱ⿡ ¶óÁ¸®ÆÄÀ̵¼­µµ ½±°Ô »ç¿ëÀÌ °¡´ÉÇÕ´Ï´Ù.



´ëü »óÇ° : ¹ÝµµÃ¼ ¿Âµµ¼¾¼­(TMP36 - Temperature Sensor) ¶Ç´Â KEV-6601 À» °Ë»öÇØÁÖ¼¼¿ä.


µ¥ÀÌÅͽÃÆ®http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf





¼Ò½ºÄÚµå

#include

int SensorPin = 13; //Our sensor is connected to digital pin 10


//Initiate OneWire communication
OneWire ds(SensorPin);

void setup(void) {
//Initiate serial communication with our computer
  Serial.begin(9600);
  digitalWrite(8,HIGH);
}

void loop(void) {

float T = readT(); // call function to read from sensor
Serial.print("Temperature is: "); // print out results to us
Serial.print(T);
Serial.println(" deg.C"); // print out results to us
delay(750);

}

float readT(){
//returns the temperature from our sensor

byte data[12];
byte addr[8];

if ( !ds.search(addr)) {
ds.reset_search();
return -300; // if there is no sensor on OneWire Bus, return -300 value
}

ds.reset();
ds.select(addr);
ds.write(0x44,1); // tell sensor to start converting
ds.reset();
ds.select(addr);
ds.write(0xBE); // tell sensor to start sending data

for (int i = 0; i < 9; i++) { // we receive data in this loop
data[i] = ds.read();
}

ds.reset_search();

byte MSB = data[1];
byte LSB = data[0];

float raw = ((MSB << 8) | LSB); // move MSB left for 8 spaces, join that with LSB
float realTempC = raw / 16; // move decimal point left for 4 spaces, result our temperature
return realTempC;

}
¸ÞÄ«¸®¿öÁî






°ßÀû¿äû
±¸¸Å´ëÇà
Äü/¹æ¹®¼ö·É
ÈĺҰáÁ¦
±â¼ú¹®ÀÇ