Description
Temperature Module TMP36, the scale factor of 10 mV/C.
Temperature Module TMP36
Item No. : KR08133
1. Introduction
The TMP36 is a low voltage, precision centigrade temperature sensor. It provides a voltage output that is linearly proportional to the Celsius temperature. It also doesn’t require any external calibration to provide typical accuracies of ±1°C at +25°C and ±2°C over the ?40°C to +125°C temperature range. Eeasy to use : just give the device a ground and 2.7 to 5.5 VDC and read the voltage on the Vout pin. The output voltage can be converted to temperature easily using the scale factor of 10 mV/°C.
You may need : 4 Pin Mini GPU Connector (#KR20048) and Base Shield for pcDuino/ Arduino (#KR03049)
2. Features:
- Voltage Input: 2.7 V to 5.5 VDC
- 10 mV/°C scale factor
- ±2°C accuracy over temperature
- ±0.5°C linearity
- Operating Range: -40°C to +125°C
3. Koneksi dengan Arduino :
Vcc (Sensor) >> 5V (Arduino)
Gnd (Sensor) >> Gnd (Arduino)
NC = tidak dihubungkan
Out (Sensor) >> A0 (Arduino)
4. Script yang digunakan (dengan AREF / Tegangan Referensi 5 Volt DC) – keakurasian normal
/* * Created by ArduinoGetStarted.com * * This example code is in the public domain * * Tutorial page: https://arduinogetstarted.com/tutorials/arduino-tmp36-temperature-sensor */ #define ADC_VREF 5.0 // in volt #define ADC_RESOLUTION 1024.0 #define PIN_TMP36 A0 void setup() { Serial.begin(9600); } void loop() { // get the ADC value from the TMP36 temperature sensor int adcVal = analogRead(PIN_TMP36); // convert the ADC value to voltage float voltage = adcVal * (ADC_VREF / ADC_RESOLUTION); // convert the voltage to the temperature in Celsius float tempC = (voltage - 0.5) * 100; // convert the Celsius to Fahrenheit float tempF = tempC * 9 / 5 + 32; // print the temperature in the Serial Monitor: Serial.print("TMP36 Temperature: "); Serial.print(tempC); // print the temperature in Celsius Serial.print("°C"); Serial.println(" "); //Serial.print(" ~ "); // separator between Celsius and Fahrenheit //Serial.print(tempF); // print the temperature in Fahrenheit //Serial.println("°F"); delay(1000); }
5. Script yang digunakan (dengan AREF / Tegangan Referensi 3.3 Volt DC) – keakurasian lebih baik
Pada kode No.4, kita menggunakan tegangan 5 Volt DC (5000mV) sebagai tegangan referensi, dimana resolusi/ ketelitian suhu dapat kita tingkatkan dengan menurunkan tegangan referensi menjadi 3.3Volt DC, dengan cara menarik kabel jumper antara 3.3V dengan pin AREF (pada board Arduino).
Kemudian script Arduino nya menjadi sebagai berikut :
/* * Created by ArduinoGetStarted.com * * This example code is in the public domain * * Tutorial page: https://arduinogetstarted.com/tutorials/arduino-tmp36-temperature-sensor */ #define ADC_VREF 3.3 // in volt #define ADC_RESOLUTION 1024.0 #define PIN_TMP36 A0 void setup() { Serial.begin(9600); analogReference(EXTERNAL); // set the voltage reference from VREF pin } void loop() { // get the ADC value from the TMP36 temperature sensor int adcVal = analogRead(PIN_TMP36); // convert the ADC value to voltage float voltage = adcVal * (ADC_VREF / ADC_RESOLUTION); // convert the voltage to the temperature in Celsius float tempC = (voltage - 0.5) * 100; // convert the Celsius to Fahrenheit float tempF = tempC * 9 / 5 + 32; // print the temperature in the Serial Monitor: Serial.print("TMP36 Temperature: "); Serial.print(tempC); // print the temperature in Celsius Serial.print("°C"); Serial.println(" "); //Serial.print(" ~ "); // separator between Celsius and Fahrenheit //Serial.print(tempF); // print the temperature in Fahrenheit //Serial.println("°F"); delay(1000); }
Video Tutorial Penjelasan mengenai Tegangan Referensi dan Resolusi Sensor TMP36