Introduction: Automatic Temperature Controlled Fan

Picture of 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

Picture of 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

Picture of 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); } }

Comments

lat2143 (author)2016-05-18

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);

RemeA (author)lat21432016-10-21

Click the Sketch tab

click include Library

select Liquid Crystal

frankie5555 (author)2016-01-15

I was also wondering what size Potentiometer was used ?

pj200 (author)frankie55552016-01-15

vI used a 10k small potentiom

frankie5555 (author)2016-01-14

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?

pj200 (author)frankie55552016-01-14

It really doesn't matter, you could do it any way

ButchB5 (author)2015-11-16

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.

pj200 (author)ButchB52015-11-17

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

pj200 (author)ButchB52015-11-17

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

andresi1 (author)2015-10-19

hi i sent you a private message regarding this project

hemam1 (author)2015-07-09

use ful

pj200 (author)hemam12015-10-18

thanks

tomatoskins (author)2015-05-28

This is awesome! Nothing better than an atonomous fan.

pj200 (author)tomatoskins2015-05-29

thanks