Automatic Temperature Controlled Fan

Intro: Automatic Temperature Controlled Fan

This is a project on a automatic fan which changes it's speed with change in temperature . The temperature of the room is displayed on the lcd.
It is a cheap, fun and easy project to do.

Step 1: Materials Required

Arduino -1
Motor(with fan)-1
16,2 lcd display-1. (I have used a development board)
L293d( motor driver)-1(I have used a development board)
Bread board-1
LM 35 (temperature sensor)-1
Card board or any platform
Few jumper wires
Potentiometer-1

Tools
- computer with Arduino software
- cable to connect Arduino to computer

Step 2: Building the Circuit

Connecting the Lcd display to Arduino
- RW to ground
- RS to 12
- Enable to 11
- D7 to 2
- D6 to 3
- D5 to 4
- D4 to 5
- wiper to VO
- pin A of potentiometer to ground
- pin B of potentiometer to Vcc

Connecting l293D to Arduino
- Pin 1 of l293D to enable (5v)
- pin 2 of l293D to pin 7 Arduino
- pin 3 of l 293D to pin motor
- pin 6 of l293D to pin motor
- pin 4 of l293D to ground
- pin 7 of l293D to pin 8 Arduino
- pin 8 of l293D to 5v
- pin 16 of l293D to 5v

Connecting LM35 to Arduino
- Vcc (1st pin) to 5v
- Output (2nd pin) to Ao of Arduino
-Ground(3rd pin) to ground

(You can also use a development board with combined lcd and motor driver)

Connect the motors to pin 3 and 6 of l293D

Step 3: Coding Arduino

#include <LiquidCrystal.h>
float temp;
int temppin= 0;
int in1=7;
int in2=8;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{ lcd.begin(16, 2);
Serial.begin(9600);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
}
void loop()
{
temp=analogRead(temppin);
temp=temp*0.48828125;
lcd.setCursor(0, 1);
lcd.println(temp);
lcd.print("*f");
delay(500);
if(temp<100)
{
digitalWrite(in1,HIGH);
digitalWrite(in2,LOW); }
if(temp<90)
{ digitalWrite(in1,HIGH);
digitalWrite(in2,LOW);
delay(1500);
digitalWrite(in1,LOW);
digitalWrite(in2,LOW); }
if(temp<80)
{
digitalWrite(in1,HIGH);
digitalWrite(in2,LOW);
delay(1000);
digitalWrite(in1,LOW);
digitalWrite(in2,LOW);
}
else;
{
digitalWrite(in1,HIGH);
digitalWrite(in2,LOW);
delay(1500);
digitalWrite(in1,LOW);
digitalWrite(in2,LOW); } }

Share

    Recommendations

    • Audio Contest 2018

      Audio Contest 2018
    • Tiny Home Contest

      Tiny Home Contest
    • Metalworking Contest

      Metalworking Contest

    14 Discussions

    0
    None
    lat2143

    2 years ago

    Hi, I've got a code verification problem like this:

    sketch_may18a:5: error: 'LiquidCrystal' does not name a type

    sketch_may18a.ino: In function 'void setup()':

    sketch_may18a:8: error: 'lcd' was not declared in this scope

    sketch_may18a.ino: In function 'void loop()':

    sketch_may18a:16: error: 'lcd' was not declared in this scope

    sketch_may18a:45: error: expected `}' at end of input

    This error was verified on this line; LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

    1 reply
    0
    None
    RemeAlat2143

    Reply 1 year ago

    Click the Sketch tab

    click include Library

    select Liquid Crystal

    0
    None
    frankie5555

    2 years ago

    I was also wondering what size Potentiometer was used ?

    1 reply
    0
    None
    frankie5555

    2 years ago

    Hi pj200?

    I was just wondering if you can copy and paste the code the way it is or do you have to space it a certain way?

    1 reply
    0
    None
    ButchB5

    2 years ago

    Hi! Is this code still usable even if I do not attach an LCD? That's the only piece I wasn't able to obtain and I'm confused if the code posted here is still usable for that kind of set up.

    2 replies
    0
    None
    Pranav JhunjhunwalaButchB5

    Reply 2 years ago

    hi butchb5,

    You can still use the code even if you don't have a lcd.

    It will not affect the functioning of the fan

    Thanks

    0
    None
    Pranav JhunjhunwalaButchB5

    Reply 2 years ago

    hi butchb5,

    You can still use the code even if you don't have a lcd.

    It will not affect the functioning of the fan

    Thanks

    0
    None
    andresi1

    2 years ago

    hi i sent you a private message regarding this project