loading
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
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); } }
<p>Hi, I've got a code verification problem like this:</p><p> sketch_may18a:5: error: 'LiquidCrystal' does not name a type</p><p>sketch_may18a.ino: In function 'void setup()':</p><p>sketch_may18a:8: error: 'lcd' was not declared in this scope</p><p>sketch_may18a.ino: In function 'void loop()':</p><p>sketch_may18a:16: error: 'lcd' was not declared in this scope</p><p>sketch_may18a:45: error: expected `}' at end of input</p><p>This error was verified on this line; LiquidCrystal lcd(12, 11, 5, 4, 3, 2);</p>
<p>Click the Sketch tab</p><p>click include Library</p><p>select Liquid Crystal</p>
I was also wondering what size Potentiometer was used ?
<p>vI used a 10k small potentiom</p>
<p>Hi pj200? </p><p>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?</p>
It really doesn't matter, you could do it any way
<p>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.</p>
<p>hi butchb5, </p><p>You can still use the code even if you don't have a lcd.</p><p>It will not affect the functioning of the fan</p><p>Thanks</p>
<p>hi butchb5, </p><p>You can still use the code even if you don't have a lcd.</p><p>It will not affect the functioning of the fan</p><p>Thanks</p>
<p>hi i sent you a private message regarding this project</p>
<p>use ful</p>
<p>thanks</p>
<p>This is awesome! Nothing better than an atonomous fan. </p>
<p>thanks</p>

About This Instructable

8,167views

18favorites

License:

More by pj200:Mario Question Block Tissue Box Light intensity meter without programming. The poles in holes puzzle 
Add instructable to: