디지털 컨버전스/Arduino

[아두이노] 온도 센서

gimyeondong 2020. 6. 22. 11:20

초도 초음파 맵, 지난주, 오늘 까지 포함해서 내일 평가

 

온도 lcd

 


void setup()
{
  Serial.begin(9600);
}

void loop()
{
  int input = analogRead(A0);
    
  //온도 구하는 공식
  float volt = input * 5.0 / 1024.0;
  float celsius = (volt - 0.5) * 100;
  
  Serial.println(celsius);
  
}

lm35

https://gent.tistory.com/80

 

[Arduino|아두이노] 온도센서 (LM35) 사용방법

아두이노 온도센서(LM35) 사용방법 아날로그 온도센서 LM35를 사용하여 온도를 측정하는 방법을 알아보자. LM35는 0도~100도까지 측정가능 하고 빠른 온도 변화에는 적합하지 않은 센서라고 한다. ��

gent.tistory.com

float temperature;  
int reading;  
int lm35Pin = A0;


void setup()
{
    analogReference(INTERNAL);
    Serial.begin(9600);
}

void loop()
{
    reading = analogRead(lm35Pin);
    temperature = reading / 9.31;
    
    Serial.println(temperature);
    delay(1000);
  
}

온도 센서는 GND랑 전원이랑 바꾸어 끼면 즉각적으로 뜨거워짐

 

 

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  int input = analogRead(A0);
  int temp = input / 9.31;
  Serial.println(temp);
  delay(1000);
}