Home ArduinoArduino Code TMP36 and Arduino example

TMP36 and Arduino example

The TMP36 is a low voltage, precision centigrade temperature sensors. It provides a voltage output that is linearly proportional to the Celsius (Centigrade) temperature.
The TMP36 does not 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

 

tmp36-pinout

 

The low output impedance of the TMP36 and its linear output and precise calibration simplify interfacing to temperature control circuitry and A/D converters. The device is intended for single-supply operation from 2.7 V to 5.5 V maximum.

Features:

  • Low Voltage Operation (+2.7 V to+5.5 V)
  • Calibrated Directly in °C
  • 10 mV/8°C Scale Factor (20 mV/8°C on TMP37)
  • ±2°C Accuracy OverTemperature
  • ±0.5°C Linearity
  • Specified -40 °C to +125 °C, Operation to +150 °C
  • Less than 50 µA Quiescent Current
  • Shutdown Current 0.5 µA max

layout

The TMP36 is very easy to connect to your Arduino, here is a breadboard layout

arduino-and-tmp36_bb

 

Code

[codesyntax lang=”cpp”]

int sensorPin = 0;
 
void setup()
{
  Serial.begin(9600);
}
 
void loop()
{

 int reading = analogRead(sensorPin);  
 // measure the 5v with a meter for an accurate value
 //In particular if your Arduino is USB powered
 float voltage = reading * 4.68; 
 voltage /= 1024.0; 
 
 // now print out the temperature
 float temperatureC = (voltage - 0.5) * 100;
 Serial.print(temperatureC); 
 Serial.println(" degrees C");
 
 delay(1000);
}

[/codesyntax]

 

Testing

Open the serial monitor

22.67 degrees C
23.12 degrees C
24.50 degrees C
25.87 degrees C
26.78 degrees C
26.32 degrees C
26.32 degrees C
25.87 degrees C
25.41 degrees C

 

Link
5pcs/lot TMP36 TMP36GT9Z Low Voltage Precision Celsius temperature sensor

You may also like