Ömer Beden
Published

Simple Auto Fan

Basic instructions on building a simple auto fan.

BeginnerShowcase (no instructions)30 minutes36,547
Simple Auto Fan

Things used in this project

Hardware components

relay
×1
fan
computer fan
×1
9V battery (generic)
9V battery (generic)
×1
Arduino UNO
Arduino UNO
×1
lm35
×1

Story

Read more

Schematics

circuit

Code

Code

C/C++
// LM35 and relay pins defined
int role=7;       
int lm35=A0;

void setup() {

  Serial.begin(9600);    //Serial comminication started
  analogReference(INTERNAL);    //arduino 1,1V reference set
  pinMode(role,OUTPUT);       //Relay is defined as output

}

void loop() {
  int okunanDeger = analogRead(A0);          //Read analog value 
  float derece = okunanDeger / 9.31;         //centigrade calculated
  Serial.println(derece);                    //centigrade print on screen
  delay(1000);                               // wait 1 sec

  if(derece >25)
    digitalWrite(role,HIGH);                 //relay power on
    else
    digitalWrite(role,LOW);                  //relay power off
  
 
}

Credits

Ömer Beden

Ömer Beden

1 project • 14 followers
Computer Engineering at Dumlupınar University -Turkey

Comments