TMP36 Analog Temperature Sensor

TMP36 Analog Temperature Sensor

Temperature Sensor - TMP36

TMP 36

  • Analog temperature sensor
  • Measures environment temperature and returns a voltage
  • Output voltage is linearly proportional to temperature
    • What does this mean?

TMP 36

Temperature Sensor - TMP36

TMP 36 Datasheet

  • What are the most important elements we should be looking for?
  • Datasheet

Conversion

  • 10 mV / deg Celsius with a 500 mV offset (since voltage is 500 mv at 0 deg Celsius)
  • Try this: if Vout is 1.2V, what is the temperature in Celsius? in Fahrenheit?
  • Remember:
    • T(fahr) = T(cel) * (9/5) + 32
    • T(cel) = (T(fahr) - 32 ) * (5/9)

Important: C++ int and float

  • Division with ints in C++ truncates decimals
int x = 3;
int y = 6;
float result = x / y; // 0 since 3/6 is truncated` 
  • Instead, make sure to cast (convert) one of the int values to be a float
int x = 3;
int y = 6;
float result = (float) x / y;

‚Äč

TMP36 Wiring

TMP36 wiring

  • Note that is BOTTOM VIEW

Exercise Wiring

tmp36_bb

Exercise

  • Connect a TMP36 and output the current temperature to the serial monitor
  • Consider what type of input is this signal? How will this value be read by Argon?

Credit

Updated: