Arduino TMP36 Precision Temperature Sensor-Guide
Arduino TMP36 Precision Temperature Sensor-Guide
One extra note, this circuit uses the Arduino IDE's serial monitor. To open this, first upload the void loop() // run over and over
again
program then click the button which looks like a square with an antennae.
The TMP36 Ddatasheet:
http://tinyurl.com/plbx38 Not Working? (3 things to try)
Nothing Seems to Happen Gibberish is Displayed
Temperature Value is
The Circuit: This happens because the serial Unchanging.
This program has no outward
Parts: indication it is working. To see monitor is receiving data at a
CIRC-10 TMP36 Try pinching the sensor with
2 Pin Header Temperature Sensor Wire the results you must open the different speed than expected.
Breadboard sheet your fingers to heat it up or
x4 x1 To fix this, click the pull-down
x1 Arduino IDE's serial monitor.
box that reads "*** baud" and pressing a bag of ice against it
(instructions on previous page)
change it to "9600 baud". to cool it down.
Schematic:
Arduino
analog +5 volts
pin 0 Making it Better
Outputting voltage: this first revert to the original code then change:
This is a simple matter of changing one line. Our sensor Serial.println(temperature);
---->
outputs 10mv per degree centigrade so to get voltage we Serial.print(temperature);
+5v TMP36 Serial.println(" degrees centigrade");
(precision simply display the result of getVoltage().
signal
temperature
The change to the first line means when we next output it will
gnd delete the line temperature = (temperature - .5) * 100;
sensor) appear on the same line, then we add the informative text and
the chip will have Outputting degrees Fahrenheit: a new line.
TMP36 printed on it Again this is a simple change requiring only math. to go Changing the serial speed:
gnd
(ground) (-) degrees C ----> degrees F we use the formula. If you ever wish to output a lot of data over the serial line time
( F = C * 1.8) + 32 ) is of the essence. We are currently transmitting at 9600 baud
add the line but much faster speeds are possible. To change this change
temperature =
(((temperature - .5) * 100)*1.8) + 32; the line:
before Serial.println(temperature); Serial.begin(9600); ----> Serial.begin(115200);
The Internet
Upload the sketch turn on the serial monitor, then change the
.:download:. More informative output: speed from 9600 baud to 115200 baud in the pull down menu.
breadboard layout sheet Lets add a message to the serial output to make what is
http://tinyurl.com/ctdjod You are now transmitting data 12 times faster.
appearing in the Serial Monitor more informative. To do
.:view:.
assembling video
http://tinyurl.com/d85jyx
http://tinyurl.com/c89tvd