Temperature sensor interfacing with arduino

In this tutorial, we will learn temperature sensor interfacing with arduino to measure temperature and to control devices according to temperature. Lm35 provide 10mv /degree changes, so if temperature is 28*c, lm35 will provide 280mv at output pin 2. As we know, these are analog output, so connect output of lm35 to arduino analog channel A0 as shown in circuit below.

Materials required

  • Arduino uno
  • LM35 (Temperature sensor)
  • Lcd JHD162A
  • Power supply
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Temp= ");
lcd.print("The Electronics");

void loop ()
int sense= analogRead(A0);
int temp= sense*4.88/10;