Sunteți pe pagina 1din 5

let's make Explore Contests Classes Publish Login | Sign Up

Featured: Fidget Spinner Design Invention Class #Vanlife

Challenge advertisement

Vote!
Arduino Temperature Indicator by TechMartian in arduino

Download h 4 Steps  Collection I Made it!  Favorite  Share 

advertisement

About This Instructable

License:
8 115 views
 11 favorites

TechMartian

This is the sixth module in a series of lesson for the Arduino 101 Follow 28

centred around the use of a temperature sensor.

This project uses a cheap temperature sensor to measure the surface Bio: Born in Pluto in 001/010/008
(plutonian year) and raised in Mars.
temperature of any objects or the surrounding air and then outputting
it to an Arduino Console via serial communication. The circuitry is
More by TechMartian:
quite simple although the code is relatively more complicated for this
proje

Step 1: Tools and Materials

Related

TMP36 Temperature
Sensor
by Spaceman Spiff

Office Room
Temperature Logging
with pcDuino and
Yeelink Server
by Yanny Guo
Arduino 101 Essentials:
How to use a
Potentiometer
by TechMartian

How to use the TMP36


temp sensor - Arduino
Tutorial
by codebender_cc

Arduino Temperature
Sensor With LCD
by RayTechnologies

advertisement

Arduino 101 or Arduino Uno


Breadboard
Temperature Sensor - TMP36 -
https://www.sparkfun.com/products/10988
Jumper Wires

advertisement

Step 2: Circuitry
Connecting the Arduino Power to the breadboard
Connect the 3.3V pin and GND pin from the Arduino to the red and
black power rails in the breadboard, respectively.
The temperature sensor has polarity so it is crucial that you do not
reverse the polarity when connecting it.
Connect the red power rail from the breadboard to the bottom most
pin of the temperature sensor with the flat side facing right with an
orange jumper cable
Connect the black power rail from the breadboard to the top most
pin of the temperature sensor with the flat side facing right with a
black jumper cable
Connect the middle pin to the A0 header of the Arduino board.

Step 3: Coding

Depending on the voltage supplied to the temperature sensor, the


temperature reading will vary linearly, thus we will multiply the
voltage, in this case, 3.3V used by the voltage readings from the
analog pin.

//analog input pin constant

const int tempPin = 0;

//raw reading variable int tempVal;

//voltage variable float volts;

//final temperature variables float tempC; float tempF;

void setup() { // start the serial port at 9600 baud Serial.begin(9600);


}

void loop() { //read the temp sensor and store it in tempVal tempVal =
analogRead(tempPin);

//print out the 10 value from analogRead Serial.print("TempVal = ");


Serial.print(tempVal);

//print a spacer Serial.print(" **** ");

//converting that reading to voltage by multiplying the reading by 3.3V


(voltage of //the 101 board) volts = tempVal * 3.3; volts /= 1023.0;

//print out the raw voltage over the serial port Serial.print("volts: ");
Serial.print(volts, 3);

//print out divider Serial.print(" **** ");

//calculate temperature celsius from voltage //equation found on the


sensor spec. tempC = (volts - 0.5) * 100 ;

// print the celcius temperature over the serial port Serial.print("


degrees C: "); Serial.print(tempC);

//print spacer Serial.print(" **** ");

// Convert from celcius to fahrenheit tempF = (tempC * 9.0 / 5.0) +


32.0;

//print the fahrenheit temperature over the serial port Serial.print("


degrees F: "); Serial.println(tempF);

//wait a bit before taking another reading delay(1000); }

Step 4: Demo

The temperature is printed on Serial Monitor of the Arduino IDE. You


can verify it is running by touching the temperature sensor and see
the temperature change as it detects your body temperature at your
hand.
We have a be nice comment policy.
Please be positive and constructive.

w I Made it!  Add Images Post Comment

advertisement

Ad
Instapage Landing Pages
Customizable landing pages that give your
brand the emphasis it deserves
Instapage

FEATURED CHANNELS

Woodworking Paper Kitchen Hacks Puzzles Laser Cutting Space Homesteading 3D Printing Sewing

Newsletter About Find Us Resources


Let your inbox help you
Us Facebook For Teachers
discover our best projects, Who We Are Youtube Residency Program
classes, and contests. Advertise Gift Premium Account
Twitter
Instructables will help you Contact Forums
learn how to make anything! Pinterest
Jobs Answers
Google+
enter email I'm in! Help Sitemap

© 2016 Autodesk, Inc. Terms of Service | Privacy Statement | Legal Notices & Trademarks | Mobile Site

S-ar putea să vă placă și