Wemos and TMP36 example

The TMP35, TMP36, and TMP37 are low voltage, precision centigrade temperature sensors. They provide a voltage output that is linearly proportional to the Celsius (Centigrade) temperature.
The TMP35/TMP36/TMP37 do 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

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

tmp36-pinout

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

 

Schematics

The TMP36 is very easy to connect to your Wemos, here is a schematic and breadboard layout

wemos and tmp36_bb

wemos and tmp36_schem

 

 

Code

[codesyntax lang=”cpp”]

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

 int reading = analogRead(sensorPin); 
 // measure the 3.3v with a meter for an accurate value
 //In particular if your Arduino is USB powered
 float voltage = reading * 3.3; 
 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

1 COMMENT

  1. Hi, I’m Lutz, from Germany. It’s a god description. My Proble, I’ve bought 5 pieces, labeled “tmp36GZ 1702” and all shows me -48.39 degrees C, no matter if there’s the tmp26 connected or not. All is the same like on this page, also the script. The A0 on Wemos D1 mini is OK, when a connect a resistor between A0 and 3,5V the output change. Is there an Idee, I think the prices are death, but all of them are new and unused (I hope).

LEAVE A REPLY

Please enter your comment!
Please enter your name here