Home
About Us
Achievement
Feedback Form
Home
Raspberry-Pi Projects
_Raspberry Pi 4 Complete Guide
Arduino Project
_All Projects
Esp8266 Project
_All Projects
Esp32 Project
_Automation-with-feedback
Smoke Detector Using Mq2 Sensor
Just Do Electronics
August 03, 2020
Video :-
Circuit Diagram :-
Code :-
//Prateek //www.prateeks.in #include
LiquidCrystal_I2C lcd(0x27, 16, 2); const int buzzerPin = 5; int redled = 4; int greenled = 6; #define gasPin A0 void setup() { lcd.init(); lcd.backlight(); lcd.clear(); Serial.begin(9600); lcd.begin(16, 2); pinMode(buzzerPin, OUTPUT); pinMode(redled, OUTPUT); pinMode(greenled, OUTPUT); lcd.setCursor(0, 0); lcd.print("Calibrating"); for(int i = 0; i <10; i++){ if (i==4) { lcd.setCursor(0, 1); lcd.print("."); } else lcd.print("."); delay(500); } lcd.setCursor(5, 1); lcd.print("done"); delay(1000); lcd.clear(); lcd.setCursor(1, 0); lcd.print("SENSOR ACTIVE"); delay(1500); lcd.clear(); } void loop() { int gasSensor = analogRead(gasPin); if (gasSensor > 250) { digitalWrite(buzzerPin, HIGH); digitalWrite(redled, HIGH); digitalWrite(greenled, LOW); lcd.setCursor(0, 0); lcd.print("Value : "); lcd.print(gasSensor); Serial.print(gasSensor); Serial.print("\t"); lcd.setCursor(0, 1); Serial.println("Gas is Detected"); lcd.print("Gas is Detected"); delay(300); lcd.clear(); } else if (gasSensor < 350) { digitalWrite(buzzerPin, LOW); digitalWrite(greenled, HIGH); digitalWrite(redled, LOW); lcd.setCursor(0, 0); lcd.print("Value : "); lcd.print(gasSensor); Serial.print(gasSensor); Serial.print("\t"); lcd.setCursor(0, 1); Serial.println("No Gas"); lcd.print("No Gas"); delay(300); } }
0 Comments
Newer
Older
Arduino Gps And Gsm Based location Tracking System
Smart Trolley Using RFID And Arduino Nano
Ultrasonic Sensor as a Counter with Arduino
Smart Shopping Cart using RFID and NodeMCU
Build Your Own Gps Tracking System using Arduino
IoT Based Fingerprint Biometric Attendance System Using NodeMCU (Esp8266)
OTP Based Door Lock Using Arduino And SIM800L
GSM + GPS Based Vehicle Location Tracking System
Car Parking System Using Arduino
Make Fingerprint Door Lock | Arduino Project
YouTube
Like on Facebook
Follow on Twitter
Follow on Google+
Follow on Instagram
Subscribe on Youtube
Hi WelCome To My Website If you have a creative mind and want to learn Electronics even without studying it then FRIENDS this Website And Youtube Channel is for you, I am crazy creators who love making Electronics things. I have a bunch of more than 130 Tutorial Videos on My YouTube Channel and I upload a new Tutorial every Sunday.
Tags
Arduino Project
Esp32 Project
Esp8266 Project
0 Comments