Materials:-
- Arduino uno = https://bit.ly/30v5XcY
- LM35 = https://bit.ly/3bUPLWK
- LCD display = http://bit.ly/37SLuRJ
- Relay = https://bit.ly/2ZPVydK
Diagram:-
Connections:-
LCD display to arduino
- Vss = Arduino GND
- VDD = Arduino 5V
- V0 = Potentiometer center pin
- RS = Digital pin 2
- RW = Arduino GND
- E = Digital pin 3
- D4 = Arduino digital pin 4
- D5 = Arduino digital pin 5
- D6 = Arduino digital pin 6
- D7 = Arduino digital pin 7
- A = Arduino 5V
- K = Arduino GND
Potentiometer to arduino
- Left pin = Arduino GND
- Right pin = Arduino 5v
- center pin = Display VO
temperature sensor(LM35) to arduino
- Sensor VCC = Arduino 5V
- Sensor GND = Arduino GND
- Sensor center = Arduino A0
Relay module to arduino
- Sensor VCC = Arduino 5V
- Sensor GND = Arduino GND
- Sensor center = Arduino D13
Downloads:-
- LCD display library(LiquidCrystal.h) = http://bit.ly/2VeF5xt
- Code = https://bit.ly/2yLGUcm
Code#include <LiquidCrystal.h>LiquidCrystal lcd(2, 3, 4, 5, 6, 7);int tempin = A0; // the output pin of LM35int temp;int cel;int tempmin = 69.632;int fan = 13;void setup() {pinMode(tempin, INPUT);Serial.begin(9600);lcd.begin(16, 2);pinMode(fan, OUTPUT);}void loop() {temp = analogRead(tempin);cel = temp * 0.48828125;Serial.print(cel);Serial.println();if (tempmin < temp) {lcd.setCursor(0, 1);// move cursor to next linelcd.print("fan status : ");lcd.print("ON"); // display the temperaturedigitalWrite(fan, LOW);}else {lcd.setCursor(0, 1);// move cursor to next linelcd.print("fan status : ");lcd.print("OFF"); // display the temperaturedigitalWrite(fan, HIGH);}lcd.setCursor(0, 0);lcd.print("temperature: ");lcd.print(cel); // display the temperaturelcd.print("C ");delay(200);lcd.clear();}