How To Make An Iot Smoke Alarm With Nodemcu Esp8266




About Gas Sensor

The MQ2 is used in gas leakage detecting equipment in consumer and industry markets, this sensor is suitable for detecting CH4, Natural gas, LNG, avoid exposure to alcohol, cooking fumes, and cigarette smoke. The sensitivity can be adjusted by the potentiometer. Come with cables

Specification:

Power supply: 5V
Interface type: Analog
Pin Definition: 1-Output 2-GND 3-VCC
High sensitivity to CH4, Natural gas
Small sensitivity to alcohol, smoke
Fast response
Stable and long life
Simple drive circuit
Size: 40x20mm

The MQ-2 sensor has 4 pins.
Pin-------------------------------------Wiring to Arduino Uno
A0-------------------------------------Analog pins
D0-------------------------------------Digital pins
GND-----------------------------------GND
VCC------------------------------------5V
How does it Work?
The voltage that the sensor outputs changes accordingly to the smoke/gas level that exists in the atmosphere. The sensor outputs a voltage that is proportional to the concentration of smoke/gas. You can use with Gas Lighter

In other words, the relationship between voltage and gas concentration is the following:
The greater the gas concentration, the greater the output voltageThe lower the gas concentration, the lower the output voltage

The output can be an analog signal (A0) that can be read with an analog input of the Arduino or a digital output (D0) that can be read with a digital input of the NodeMCU ESP8266


Tools and materials :
NodeMCU ESP8266Sensor MQ-2  Jumper female to male 

Drawing Circuits:






Program:

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
char auth[] = " ***";
char ssid[] = "***";
char pass[] = "***";

int gas;    // Declare gas

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
  pinMode(16,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(A0,INPUT);
}



void loop()
{
  gas=analogRead(A0);
  Serial.println(gas);

  if(gas>190)   // If gas more than 190
  {
     digitalWrite(16,HIGH); // LED1 RED LAMP
    digitalWrite(5,LOW);
     Blynk.notify("Gas Detected");
  }

  if(gas<190)   // If gas less than 190
  {
      digitalWrite(16,LOW);
      digitalWrite(5,HIGH); // LED2 GREEN LAMP
  }
    Blynk.virtualWrite(V1, gas); // Set V1 in Blynk Apps
    Blynk.run();
    timer.run();
}

Artikel ini hanyalah simpanan cache dari url asal penulis yang berkebarangkalian sudah terlalu lama atau sudah dibuang :

http://www.belajarblogs.com/2019/05/final-year-project-program-gas-sensor.html

Kempen Promosi dan Iklan
Kami memerlukan jasa baik anda untuk menyokong kempen pengiklanan dalam website kami. Serba sedikit anda telah membantu kami untuk mengekalkan servis percuma aggregating ini kepada semua.

Anda juga boleh memberikan sumbangan anda kepada kami dengan menghubungi kami di sini
15 Handy Diy Tin Can Craft Ideas You Can Make With No Struggle At All

15 Handy Diy Tin Can Craft Ideas You Can Make With No Struggle At All

papar berkaitan - pada 6/5/2019 - jumlah : 379 hits
Tin cans are a beginner crafter s favorite crafting supplies They are incredibly versatile and easy to work with and their shape enables you to use them in many scenarios without having to change anything except The post appeared first on
Traveloka How About An Adventure With Mom

Traveloka How About An Adventure With Mom

papar berkaitan - pada 10/5/2019 - jumlah : 353 hits
Traveloka How about an adventure with Mom Traveloka Asia s calling Take up to RM100 OFF international flight bookings now Traveloka Great stays come what may Traveloka Asia s calling Take up to RM100 OFF international flight bookings now Tr...
15 Amazing Diy Home Decor Projects You Can Make With Maps

15 Amazing Diy Home Decor Projects You Can Make With Maps

papar berkaitan - pada 29/4/2019 - jumlah : 331 hits
If you are a travel freak this is the article for you We discovered a good deal of awesome DIY home decor ideas that can be crafted using maps It shouldn t come as a surprise The post appeared first on
How To Make Cauliflower Rice

How To Make Cauliflower Rice

papar berkaitan - pada 8/5/2019 - jumlah : 271 hits
How to make cauliflower rice with and without a food processor In a few simple steps you can add this healthy low carb and keto side dish to any meal for a boost of veggies Cooking tips and recipes included Hello from Barcelona I hope you r...
Make It Up To Mum With Chocolates

Make It Up To Mum With Chocolates

papar berkaitan - pada 15/5/2019 - jumlah : 391 hits
For all those guilty of not getting mum something for Mother s Day look over here It s not too late to compensate and mum may be surprised that you even decided to make it up to her We know it s extra pressure since we had additional days t...
Author Yangsze Choo On How Walks Help With Her Books

Author Yangsze Choo On How Walks Help With Her Books

papar berkaitan - pada 11/5/2019 - jumlah : 402 hits
is a fourth generation Malaysian who lives in California To coincide with the release of her second book The Night Tiger Yangsze wrote for us this piece on how walks influence her writing and thought process It was first published in the Ma...
5 Biggest Mistakes People Make With The Car Dealers

5 Biggest Mistakes People Make With The Car Dealers

papar berkaitan - pada 11/5/2019 - jumlah : 306 hits
As the Raya holiday is closing by car dealers are conducting various promotions to boost their sales target At the same time many buyers could no longer contain their excitement to get their hands onto their brand new car Peeps hold your ho...
Rethink How You Deal With Royals Zaid Tells Putrajaya

Rethink How You Deal With Royals Zaid Tells Putrajaya

papar berkaitan - pada 7/5/2019 - jumlah : 335 hits
A former federal minister has urged Putrajaya to rethink the way it is dealing with the Johor royal family In an interview with FMT Zaid Ibrahim said the spat between government figures and Johor Crown Prince Tunku Ismail Sultan Ibrahim was...
Ditahan Isa Kerana Mahu Serang Orang Islam

Lelaki Didakwa Bunuh Ibu Mentua

Sains Pembungkusan Terbiodegradasi Perspektif Dari Rantaian Bekalan Mampan

Relationship 4 Horsemen Overcoming The Four Horsemen

Tebatan Banjir Rm 7 Bilion Batal

The Role Of Jewelry Showcases In Attracting Customers And Boosting Sales

Persediaan Persekolahan

Hari Ke 29 Rezeki Datang


echo '';
Info Dan Sinopsis Filem Perayaan Mati Rasa 2025 Adaptasi Lirik Lagu Berjudul Sama Kini Di Pawagam Malaysia

Info Dan Sinopsis Filem Sumala 2024 Adaptasi Kisah Nyata Dari Kabupaten Semarang Kini Di Platform Online Netflix Malaysia

Ramalan Peserta Gegar Vaganza 2025 2026 Musim 12 GV12

Keputusan Markah Konsert Akhir Final Gegar Vaganza 2024 2025 GV 11 Juara Pemenang Finalis

Senarai Lagu Tugasan Konsert Akhir Gegar Vaganza 2024 2025 Musim 11 Minggu 12


Certot Pelaris

Openai Batalkan Model Ai O3 Demi Peluncuran Generasi Baru Yang Bersatu

Pm Anwar And President Erdogan Enjoy An Ev Joyride

Che Ta Sifatkan Ayu Raudhah Amp Zaquan Bertuah 4 Orang Anak Syurga Dah Menanti

Apple Dilaporkan Teroka Pengeluaran Iphone Di Indonesia

Inilah Alasan Mengapa Sesetengah Tingkap Hotel Tidak Boleh Dia Buka