arduino uno/temperature sensor TMP36

00-Take an Arduino Uno.
01-Grab a Temperature sensor called TMP36. It has 3 legs. It has a flat surface which is the front.
02-Take 1 jumper wire. Female/Male.
03-Take the TMP36 in your hand with the flat surface in front of you.
04-Bend the TMP36's middle leg toward you.
05-Take the jumper wire.
06-Insert the TMP36's middle leg you just bended into the female part of your TMP36 temperature sensor.
07-Now take your Arduino Uno.
08-Locate the POWER plugs of the Arduino Uno. It's written on it. It says POWER.
09-On the Arduino Uno's group of POWER plugs, locate the 5V plug.
10-Put the TMP36's flat surface in front of you.
11-Insert the TMP36's left pin inside the Arduino Uno's 5V plug.
12-On the Arduino again, locate the GND plug.
13-Insert the TMP36's right pin inside the GND plug.
14-Locate the ANALOG IN plugs of the Arduino Uno.
15-On the Arduino Uno's group of ANALOG IN pins, locate pin A0.
16-Take the jumper wire you already connected to TMP36's middle leg.
17-Now, insert the jumper wire's male pin into the Arduino's pin A0.
18-Open the Arduino software.
19-Open a blank window.
20-Copy the code below line 29.
21-Paste this code into the blank window.
22-Take a USB cable. USB 1 to USB 2.
23-Connect USB 1 of your cable to the Arduino.
24-Connect USB 2 of your cable to your computer.
25-On the top of the Arduino software, locate the Arrow button.
26-Push the arrow button from your Arduino software to send the code to your Arduino Uno.
27-In the Arduino software menu, locate the TOOLS tab.
28-In the TOOLS tab, press the SERIAL MONITOR tab.
29-You should now receive Temperature Data from tmp36.
THE CODE

//initializes/defines the output pin of the TMP36 temperature sensor
int outputpin= 0;
//this sets the ground pin to LOW and the input voltage pin to high
void setup()
{
Serial.begin(9600);
}

//main loop
void loop()
{
int rawvoltage= analogRead(outputpin);
float volts= rawvoltage/205.0;
float celsiustemp= 100.0 * volts - 50;//initializes/defines the output pin of the TMP36 temperature sensor
int outputpin= 0;
//this sets the ground pin to LOW and the input voltage pin to high
void setup()
{
Serial.begin(9600);
}

//main loop
void loop()
{
int rawvoltage= analogRead(outputpin);
float volts= rawvoltage/205.0;
float celsiustemp= 100.0 * volts - 50;
float fahrenheittemp= celsiustemp * 9.0/5.0 + 32.0;
Serial.print(celsiustemp);
Serial.println(" Celsius");
Serial.print(fahrenheittemp);
Serial.println(" Fahrenheit");
delay(300000);
}//initializes/defines the output pin of the TMP36 temperature sensor
int outputpin= 0;
//this sets the ground pin to LOW and the input voltage pin to high
void setup()
{
Serial.begin(9600);
}

//main loop
void loop()
{
int rawvoltage= analogRead(outputpin);
float volts= rawvoltage/205.0;
float celsiustemp= 100.0 * volts - 50;
float fahrenheittemp= celsiustemp * 9.0/5.0 + 32.0;
Serial.print(celsiustemp);
Serial.println(" Celsius");
Serial.print(fahrenheittemp);
Serial.println(" Fahrenheit");
delay(300000);
}
Serial.print(celsiustemp);
Serial.println(" Celsius");
delay(3000);
}
Publicités