January 1, 2021

#105 - Arduino temperature sensor TMP36

In this post, we will analyze the simple Arduino circuit below that has a temperature sensor type TMP36 and a red LED used for debugging purposes:


Below some of the characteristics of this TMP36 sensor:
  • 3 pins: 1xVin (LEFT), 1xVout (MID), 1xGND (RIGHT)
  • Vin range: [2.7V .. 5.5V]
  • Temperature range: [-40°C .. 150°C] 
  • Accuracy: ±1°C
  • Analog Output signal range: [0.1V .. 2V]
  • Baseline: temperature of 25°C outputs 0.75V 



The code used in this example is on github and it is divided into 3 main sections:

1. declaration and initialization of global constants and variables
2. setup routine: Definition of pin modes, analog reference (in this case an INTERNAL reference of 1.1V built-in Arduino's PCB was chosen), open Serial communication for debugging/callbacks.
3. loop routine: reading and averaging analog input values, limit checking, analog to digital conversion with 10bit resolution, calculation of temperature using formula above 

Results from Serial prompt:

In addition, it is interesting to measure with a multimeter the voltage between the Vout pin of the TMP36 and the GND in order to compare it with the calculated value.

No comments:

Post a Comment