Introduction: Arduino Temperature Sensor

Picture of Arduino Temperature Sensor

I am an eleven year old kid. I just started Arduino a few years ago. Arduino used to be really tough so my goal is to help beginners like I was.

Step 1: This Will Be Your Inventory

Picture of This Will Be Your Inventory

You will need:

5 jumper wires

1 LM35 temperature sensor

1 Arduino Uno

1 breadboard

Step 2: This Is the LM35 Temperature Sensor.

Picture of This Is the LM35 Temperature Sensor.

This looks a lot like a transistor. I've posted an image of a closeup so that you don't get confused.

Step 3: Wire the Temperature Sensor Like This

Picture of Wire the Temperature Sensor Like This

Notice that the red wire is going to 5v, the black wire to ground, and the blue to analog read pin 0.

Step 4: Here Is the Code

Picture of Here Is the Code

This is the code:


void setup() {
Serial.begin(9600); // set up the connection between the arduino board and the computer.

}

void loop() {

float x; // we are telling it that there is a random decimal number which we will call x.(this being the value that the temperature sensor has read.)

x = analogRead(0); //read this number through the analog input pin that we plugged the middle leg of the sensor into.

Serial.print(x); // display this number on the serial monitor

}

Comments

DIY Hacks and How Tos (author)2016-01-22

Great tutorial. Thanks for sharing.