0% found this document useful (0 votes)
7 views

Gas Detection Sensor

Iot project
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Gas Detection Sensor

Iot project
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Gas detection sensor

int gas=A1;

int buzzer=12;

int led=11;

void setup()

pinMode(A1, INPUT);

pinMode(buzzer, OUTPUT);

pinMode(led, OUTPUT);

Serial.begin(9600);
}

void loop()

int gasValue=analogRead(gas);

Serial.print("gasValue:");

Serial.println(gasValue);

delay(1000);

if (gasValue>300)

digitalWrite(buzzer,HIGH);

digitalWrite(led,HIGH);

Serial.println("Leakage Detected");

else

digitalWrite(buzzer,LOW);

digitalWrite(led,LOW);

Serial.println("Safe");

You might also like