Arduino Flame Detector Alarm

 Source Code:-

int firesensor = 0;
int buzzer = 1;
int led = 2;
int Fire = HIGH;

void setup() {
  pinMode (firesensor, INPUT);
  pinMode (buzzer, OUTPUT);
  pinMode (led, OUTPUT);
}
 

void loop() {
  Fire = digitalRead(firesensor);
  if (Fire== LOW)
  {
    digitalWrite(buzzer, HIGH);
    digitalWrite(led,HIGH);
  }
  else
  {
    digitalWrite(buzzer, LOW);
    digitalWrite(led,LOW);
  }
  
}

 

Leave a Comment