Project 003: Arduino LM35 Temperature Sensor Project

Project 003: Arduino LM35 Temperature Sensor Project © GPL3+

This simple beginner project makes an excellent tool for everyday applications, utilising a common LM35 temperature sensor and an Arduino.

  • 43 views
  • 0 comments
  • 2 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
You could use any other Arduino board as well. The Keyestudio Uno is used in this example.
×1
Adafruit industries ada62 image 75px
USB-A to B Cable
Depends on the Arduino.
×1
11026 02
Jumper wires (generic)
1 Male to Male Jumper Wire.
×1
Texas Instruments LM35 Temperature Sensor
×1
12002 04
Breadboard (generic)
×1
Pcbway qeheggiidg
PCBWay Custom PCB
×1

Apps and online services

About this project

Before starting this project...

Credits go to Tapan Mojodra on www.instructables.com/id/ARDUINO-TEMPERATURE-SENSOR-LM35/

This project is a simple project which can be use as a thermometer. It can sense the temperature it is put around and transmit it to degrees Celsius. It consists of very little parts which is cheap and reliable. This project consists of a LM35 Temperature Sensor which is the most often used. To make this project, the parts needed are:

  • 1 Arduino (the Keyestudio Uno is used in this example)
  • 1 LM35 Temperature Sensor
  • 3 Jumper Wires (Male to Male)
  • 1 USB Data Cable (depends on the Arduino)
  • 1 breadboard

Mounting the circuit

Let's start making the circuit. Remove the USB cable from the Arduino before starting this project. First, place the LM35 anywhere horizontally on your breadboard, the flat side of the sensor must be facing you. Then, connect three wires under the three pins of the sensor. The wire on the left will go to the 5v (+5 volts) on the Arduino. The middle wire will go to A1 (analog pin 1). The wire on the right will go to GND (-) on the Arduino. Upload the code and open the serial monitor as readings of the temperature is shown. Make sure that the serial monitor is on 9600 bauds. Use the code below:

About the code

The two first lines of the code are variables. It shows which pin the wire connects to. They are integers and you can prove that they do start with int. The void setup is really simple. You only start a serial connection with the Arduino at 9600 bauds. The four first lines of void loop, they are calculating what the Arduino will do to determine the temperature. It's just some math equations you don't need to worry about. The five other lines, in void loop, will print the required words for the temperature readings to be intelligible by you in serial monitor. The words are temperature, cel and C. The other second half will print the same thing except for cel, which will be farh and C, which will be F (it's optional). Uncomment that section if you want to use it by taking away the first line of that section. The code might have looked indomitable before, but it looks way less impressive now.

Amazing opportunities

Also, be sure to check out PCBWay, a leading manufacturer and distributor in PCB design and manufacturing. They have amazing prices and excellent quality in their services, so don't miss out on them! Plus, right now, they are having an amazing Christmas promotion, where free gifts and packages will be gifted, so make sure you check out the link below:

https://www.pcbway.com/PCBWayShoppingFestival2018.aspx

Enjoy! Contact us for any inquiries!

Code

Arduino LM35 Temperature Sensor Project CodeC/C++
int val;
int tempPin = 1;

void setup()
{
  Serial.begin(9600);
}
void loop()
{
  val = analogRead(tempPin);
  float mv = ( val/1024.0)*5000;
  float cel = mv/10;
  float farh = (cel*9)/5 + 32;
  Serial.print("TEMPRATURE = ");
  Serial.print(cel);
  Serial.print("*C");
  Serial.println();
  delay(1000);
/* uncomment this to get temperature in farenhite
Serial.print("TEMPRATURE = ");
Serial.print(farh);
Serial.print("*F");
Serial.println();
*/
}

Schematics

Circuit Diagram
Diagram nlis4ibrvc
Schematics
Schem vpmjx0j8go

Comments

Similar projects you might like

How To Use DS18B20 Water Proof Temperature Sensor

Project showcase by IoTBoys

  • 40,714 views
  • 11 comments
  • 17 respects

Ultrasonic Sensor with Alarm, LCD and Temperature

Project tutorial by MichDragstar

  • 4,645 views
  • 7 comments
  • 19 respects

Room temperature sensor with display on Mobile

Project showcase by Kaustubh Agarwal

  • 23,932 views
  • 8 comments
  • 54 respects

Arduino Temperature - Humidity - Rain Sensor

Project showcase by Rick_Findus

  • 8,128 views
  • 6 comments
  • 13 respects

DHT11 /DHT22 Temperature Sensor

Project tutorial by Daniel Porrey

  • 82,654 views
  • 106 comments
  • 133 respects

Temperature sensor

Project tutorial by Grant

  • 12,343 views
  • 6 comments
  • 30 respects
Add projectSign up / Login