Temperature Sensor Module(KY-013)

아두위키 : Arduwiki
ArduWiki (토론 | 기여)님의 2024년 4월 3일 (수) 15:02 판 (Created page with "{{#seo:|title=아두위키 : 아두이노 아날로그 온도 감지 모듈 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, 아날로그 온도 감지 모듈, 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 아날로그 온도 감지 모듈을 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}} ...")
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

This module detects temperature and outputs it in analog form.

Specifications

  • Operating Voltage [V]: 5
  • Error Range [°C]: -5 ~ +5

Example Usage Hardware

  • Arduino board
  • Jumper cables
  • Analog Temperature Sensing Module

Connection

Arduino Uno KY-013
5V +
GND -
A0 S

Example Code

This example outputs the temperature.

const int ThermistorPin = A0;
const float R1 = 10000;
const float c1 = 0.001129148, c2 = 0.000234125, c3 = 0.0000000876741;
int Vo;
float logR2, R2, T;

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

void loop() {
  Vo = analogRead(ThermistorPin);
  R2 = R1 * (1023.0 / (float)Vo - 1.0);
  logR2 = log(R2);
  T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
  T = T - 273.15;
  Serial.print("Temperature: ");
  Serial.print(T);
  Serial.println(" C");
  delay(500);
}

Execution Result

When the temperature sensing part is covered with a hand, the change in temperature is displayed on the serial monitor.