Home
About Us
Achievement
Home
Raspberry-Pi Projects
_Raspberry Pi 4 Complete Guide
Arduino Project
_All Projects
Esp8266 Project
_All Projects
Esp32 Project
_Automation-with-feedback
Mq2 Sensor And GSM Interfacing with Arduino
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); Serial.println("AT+CMGF=1"); delay(400); Serial.println("AT+CMGS=\"+918830584864\"\r"); Serial.println("Flre Alert"); Serial.println((char)26); 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
ESP32 Interfacing With LDR Sensor
How To Make RFID & Keypad Based Door Lock
IoT Based Fingerprint Biometric Attendance System Using NodeMCU (Esp8266)
Esp32 Cam Based Face Unlock
NRF Based Servo Motor Control
Ultrasonic Sensor as a Counter with Arduino
ESP32 Led Blink With Push Button
How to Make a Conveyor Belt System | Counter Machine
IoT Based Patient Health Monitoring System Using Blynk App
Arduino ebook
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