void setup() {
pinMode(redLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
Serial.begin(9600);
lcd.begin(16,2);
} Serial.print(â€

Air quality monitoring and smoke detection using Arduino and MQ 135 sensor | Mini project |

submited by
Style Pass
2020-09-13 13:10:22

void setup() { pinMode(redLed, OUTPUT); pinMode(buzzer, OUTPUT); pinMode(smokeA0, INPUT); Serial.begin(9600); lcd.begin(16,2); }

Serial.print(“Pin A0: “); Serial.println(analogSensor); lcd.print(“Smoke Level:”); lcd.print(analogSensor-50); // Checks if it has reached the threshold value if (analogSensor-50 > sensorThres) { digitalWrite(redLed, HIGH); lcd.setCursor(0, 2); lcd.print(“Alert….!!!”); digitalWrite(greenLed, LOW); tone(buzzer, 1000, 200); } else { digitalWrite(redLed, LOW); digitalWrite(greenLed, HIGH); lcd.setCursor(0, 2); lcd.print(“…..Normal…..”); noTone(buzzer); } delay(500); lcd.clear(); }

I am a BCA graduate now pursuing MCA | Arduino developer | interested in Robotics.Also I am a Karate instructor Black belt 3rd DAN. View more posts

Leave a Comment