LM35 Thermometer With LCD, Fan, Speaker and LED

by Vincent Cheng in Circuits > Arduino

220 Views, 0 Favorites, 0 Comments

LM35 Thermometer With LCD, Fan, Speaker and LED

IMG_2371.jpeg

Let everyone to know the precise temperature inside the house and everywhere in the house. Automatically turn on USB fan, and high temperature sound warning. LED light warning.

Step 1: Prepare Your Supplies

IMG_2369.jpeg
IMG_2367.jpeg
IMG_2368.jpeg

Arduino Leonardo

Breadboard

Jumper Wires

USB Cord

LM35 temperature sensor

USB fan

16*2 LCD screen

1 red LED, 1 green LED

1 speaker

30 Wires

Welding torch

Box

Powerbank

Step 2: Wiring

IMG_2372.jpeg
IMG_2375.jpeg
IMG_2374.jpeg
IMG_2373.jpeg

Connect supplies voltage to 5V

Connect output to A2

Connect Ground to GND

make sure LM35 face your Leonardo boards.

Connect LCD to Leonardo

Connect fan to board

extend LED wires

Connect speaker

Step 3: LCD Screen

IMG-2377.jpg

GND to GND

VCC to 5V

SDA to SDA

SCL to SCL

Steps 4: LED

IMG-2378.jpg

Extend your LED make it go though the box

Do the same thing to red LED

Step 5: Fans

IMG-2381.jpg
IMG-2383.jpg

Connect to digital 12 and GND

Step 6: Speaker

IMG-2380 (1).jpg
IMG-2382.jpg

Step 3: Coding

Screenshot (3).png
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd_I2C_27(0x27,16,2); // set the LCD address for a 16 chars and 2 line display
void setup(){  // put your setup code here, to run once:
  lcd_I2C_27.init (); // initialize the lcd
  lcd_I2C_27.backlight();
  pinMode( 7 , OUTPUT);
  pinMode( 8 , OUTPUT);
  pinMode( 12 , OUTPUT);
}
void loop()
{
  int sensorValue = analogRead(A0);
  float millivolts = (sensorValue / 1024.0) * 5000; 
  float celsius = millivolts / 10;
  lcd_I2C_27.setCursor(2, 0);
  lcd_I2C_27.print( "Temperature" );
  lcd_I2C_27.setCursor(4, 1);
  lcd_I2C_27.print(celsius);
  lcd_I2C_27.setCursor(10, 1);
  lcd_I2C_27.print("C");
 
  if ( celsius >= 28 ) {
    digitalWrite( 8 , HIGH );
    digitalWrite( 7 , LOW );
    digitalWrite( 12 , HIGH );
    tone(11, 1000, 100);
  }
  else
  {
    digitalWrite( 7 , HIGH );
    digitalWrite( 8 , LOW );
    digitalWrite( 12 , LOW );
  }
  delay(50);
}

Step 4: Video

LCD Fan Thermometer with LED and speaker

When temperature over 28degC, the LED with change from Green to RED with Speaker alert, Fan will start to cooling,

When temperature back to under 28degC, the LED will change back to Green, fan and Speaker will stop.