top of page
Search
Writer's pictureAKSHIT'S INNOVATION LAB

Code & Circuit Diagram For Clap Control Home Automation


CODE

--------------------

//AKSHIT INNOVATION LAB

#include<SoftwareSerial.h>

int flameSensor = 2;

int buzzer = 12;


void setup()

{

pinMode (2,INPUT);

pinMode (12,OUTPUT);

Serial.begin(9600);


}


void loop()

{

int sensorValue = digitalRead(2);

Serial.print("fire status:");

if(sensorValue == 1)

{

digitalWrite(12,HIGH);// buzzing if fire detected

Serial.print("fire detected\n");

}


else

{

digitalWrite(12,LOW);//stop buzzing if no fire detected

Serial.print("no fire detected\n");

}

}

--------------------------------------------------------------------------

Circuit Diagram



31 views0 comments

Recent Posts

See All

Comments


bottom of page