Temperature sensor (LM35) interfacing with arduino & LCD in proteus


Temperature sensor (LM35) interfacing with arduino & LCD in proteus

In this article we will learn how to interface arduino with Temperature sensor (LM35) & LCD in proteus.
In the last post we will learn how to interface arduino with IR proximity sensor and LCD in proteus. You can visit our website,
I hope you appreciate my work, let’s discuss about today’s project.

What is Temperature sensor?

 

 

Components which we use in this project are listed below:

  1. Temperature sensor (LM35)
  2. Arduino UNO
  3. I2C
  4. Resistor (10K)
  5. LEDs
  6. LCD display
  7. Jumper wires

Diagram of this project is below:

Temperature sensor (LM35) interfacing with arduino & LCD in proteus
Temperature sensor (LM35) interfacing with arduino & LCD in proteus

Construction of Temperature sensor (LM35) interfacing with arduino & LCD in proteus:

  • Connect the +ve pin of temperature sensor with +ve
  • Connect the –ve point of temperature sensor with the GND
  • Connect the out pin of temperature sensor with the A0 pin of arduino UNO
  • Connect the A5 pin of arduino with the pin 14 of I2C
  • Connect the A4 pin of arduino with the pin 15 of I2C
  • Connect the A0,A1,A2 pins of I2C with the GND
  • Connect the pin 8 of arduino with the one side of R3
  • Connect the other side of R3 with the +ve point of LED1
  • Connect the –ve side of LED1 with the GND
  • Connect the pin 9 of arduino with the one side of R2
  • Connect the other side of R2 with the +ve point of LED2
  • Connect the –ve point of LED2 with the GND
  • Connect the pin 10 of arduino with the one side of R1
  • Connect the other side of R1 with the +ve side of LED1
  • Connect the –ve side of LED1 with the GND
  • Connect the VSS point of LCD display with the GND
  • Connect the VDD point of LCD display with the +ve point
  • Connect the pin 4 of I2C with the point RS of LCD display
  • Connect the pin 5 of I2C with the point RW of LCD display
  • Connect the pin 6 of I2C with the point E of LCD display
  • Connect the pin 7 of I2C with the point D3 of LCD display
  • Connect the pin 9 of I2C with the point D4 of LCD display
  • Connect the pin 10 of I2C with the point D5 of LCD display
  • Connect the pin 11 of I2C with the point D6 of LCD display
  • Connect the pin 12 of I2C with the point D7 of LCD display

Working of Temperature sensor (LM35) interfacing with arduino & LCD in proteus:

Interfacing a temperature sensor with an Arduino is a common project that allows you to measure and display temperature data.

Applications of Temperature sensor (LM35) interfacing with arduino & LCD in proteus:

  1. Weather Station
  2. Thermostat
  3. Incubator Controller
  4. Home Automation

Advantages of Temperature sensor (LM35) interfacing with arduino & LCD in proteus:

  1. Accurate Temperature Measurement
  2. Ease of Interface
  3. Wide Temperature Range
  4. Low Power Consumption
  5. Analog Output

Program code of this project is below:

#include <LiquidCrystal_I2C.h >

LiquidCrystal_I2C lcd(0x20, 16, 2);

int R_LED = 8;

int Y_LED = 9;

int G_LED = 10;

void setup() {

lcd.begin(16, 2);

lcd.init();

 

pinMode(R_LED, OUTPUT);

pinMode(Y_LED, OUTPUT);

pinMode(G_LED, OUTPUT);

lcd.setCursor(2, 0);

 

lcd.backlight();

lcd.print(“Hello”);

lcd.setCursor(0, 1);

lcd.print(“Projectiot123″);

delay(1000);

lcd.clear();

lcd.setCursor(0, 0);

lcd.print(”    Digital    “);

lcd.setCursor(0, 1);

lcd.print(”  Thermometer   “);

delay(500);

lcd.clear();

}

void loop() {

float vol = analogRead(A0) * (5.0 / 1023.0) * 100;

delay(10);

 

lcd.clear();

lcd.setCursor(2, 0);

lcd.print(“Temperature”);

lcd.setCursor(4, 1);

lcd.print(vol);

lcd.write(0);

lcd.print(“C”);

delay(1000);

if (vol <= 31)

{

digitalWrite(G_LED, HIGH);

digitalWrite(Y_LED, LOW);

digitalWrite(R_LED, LOW);

}

else if (vol >= 32 && vol <= 40)

{

digitalWrite(R_LED, LOW);

digitalWrite(Y_LED, HIGH);

digitalWrite(G_LED, LOW);

}

else if (vol >= 41)

{

digitalWrite(G_LED, LOW);

digitalWrite(Y_LED, LOW);

digitalWrite(R_LED, HIGH);

}

delay(100);

}