Différences entre versions de « ENG-CANSAT-TMP36 »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 46 : Ligne 46 :
  
 
== Wiring ==
 
== Wiring ==
To use the TMP36, connect the pin 1 (on the left) to a power source (3.3V), the pin 3 (the the right droite) to the ground. Finally, the pin 2 (middle one) is the analogue output to wire on the microcontroler.
+
To use the TMP36, connect:
 +
* The pin 1 (on the left) to a power source (3.3V),  
 +
* The pin 3 (the the right droite) to the ground/GND.  
 +
* The pin 2 (middle one) to the A3 analogue input.
  
The output voltage would range from 0V @ -50°C to 1.75V @ 125°C. So no risk for our 3V based microcontroler.
+
[[Fichier:ENG-CANSAT-TMP36-01.png|480px]]
  
[[Fichier:ENG-CANSAT-TMP36-01.png|480px]]
+
The TMP36 output voltage would range from 0V @ -50°C to 1.75V @ 125°C. So no risk for our 3V based microcontroler.
 +
 
 +
== The code ==
  
  
 
{{ENG-CANSAT-TRAILER}}
 
{{ENG-CANSAT-TRAILER}}

Version du 3 octobre 2018 à 16:35

About the TMP36 Sensor

The TMP36 is the reference analogue temperature sensor in the Arduino world. It is affordable, small et power efficient. For sure there are better temperature sensors but this one will do the job for almost nothing :-)

This sensor is very common and easy to use. It is also one of the components of the ARDX development kit.


With the TMP36, it is possible to measure a temperature from -50°C to 125°C, the output voltage is proportional to the temperature.

Don't be fooled, the TMP36 looks like a transistor (eg: P2N2222AG) but it isn't a transistor. It is a complex sensor within a package identical to a transistor.

There are 3 pins on the TMP36.

  • the ground (on the left),
  • the output signal (center position),
  • the +5 volts (on the right)

TMP36-pinout.jpg

The sensor output signal does output 10 millivolts per degree (with 500mV offset for temperature under 0°C).

Eg:

  • 25° C --> output = 750 mV
  • 0° C --> output = 500mV

Technical detail

  • Analog output (see graphics)
  • Temperature range: from -50°C to 125°C
  • Power supply range: 2.7 to 5.5v
  • TMP36 datasheet (analog.com, html)

How to measure the temperature

It will be necessary to convert the analogue voltage intro degree. As the TMP36 can also measure negative temperature, the 0 degree Celcius is placed at 500 mV offset. So, any voltage under 0.5 Volt is a negative temperature.

TMP36-Graph.png

Here is the formula to use with a TMP36 powered at 3.3v:

Temp in °C = ( output_voltage_in_mV - 500) / 10

So, if we do have an output voltage of exactly 1 Volt (1000 mV) then the temperature would be

temp = (1000 - 500)/10

So 50 Celcius degrees.

Wiring

To use the TMP36, connect:

  • The pin 1 (on the left) to a power source (3.3V),
  • The pin 3 (the the right droite) to the ground/GND.
  • The pin 2 (middle one) to the A3 analogue input.

ENG-CANSAT-TMP36-01.png

The TMP36 output voltage would range from 0V @ -50°C to 1.75V @ 125°C. So no risk for our 3V based microcontroler.

The code


Written by Meurisse D. from MC Hobby - License: CC-SA-BY.