Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Muhammad_Munir
Published © GPL3+

Fire Alarm with Buzzer and Water Sprinkler System

Fire Alarm with Buzzer and Water Sprinkler System

BeginnerFull instructions provided5,543
Fire Alarm with Buzzer and Water Sprinkler System

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Flame sensor
×1
Motor Driver L298
×1
Bread board
×1
Jumper wires (generic)
×1
3.7 volt battery
×1
Battery Holder
×1
12 volt pump
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Code

Arduino
int Pump=8;
int Buzzer=4;
int Sensor=12;
void setup() {
  Serial.begin(9600);
  pinMode(Pump, OUTPUT);
   pinMode(Buzzer, OUTPUT);
   pinMode(Sensor, INPUT_PULLUP);
   
}

void loop() {

  if(digitalRead(Sensor)==LOW)
  {
    Serial.println("Flame Detection!!");  
    digitalWrite(Pump,HIGH);
    digitalWrite(Buzzer,HIGH);
    delay(1000);
//    digitalWrite(Pump,LOW);
//     digitalWrite(Buzzer,LOW);
//    delay(1000);
   }
   else
   {
      Serial.println("No dangerous!"); 
      digitalWrite(Pump,LOW);
      digitalWrite(Buzzer,LOW);
      delay(500);
   }
   }

Credits

Muhammad_Munir
77 projects • 50 followers
I am Arduino programmer, also expertise in ESP32 and 8266 wifi modules.

Comments