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 :

https://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
Iot Watering Plant With Adruino Uno And Wifi Shield

Iot Watering Plant With Adruino Uno And Wifi Shield

papar berkaitan - pada 22/11/2019 - jumlah : 309 hits
everyone knows what is IOT Interning Of thing With now technology we can do many thing that possible I just want to share some programming that I make for my friend with simple programing using Adruino Uno and wifi shield define BLYNK PRINT...
How To Make Your House Aesthetically Pleasing For All Ages

How To Make Your House Aesthetically Pleasing For All Ages

papar berkaitan - pada 10/11/2019 - jumlah : 402 hits
Parents want to come back home kick off their shoes and relax Kids want to come back home and play to their heart s delight Grandparents want to come back home and plop down on their The post appeared first on
How To Make A Folder In Ubuntu Using Command Line

How To Make A Folder In Ubuntu Using Command Line

papar berkaitan - pada 18/11/2019 - jumlah : 299 hits
Follow this step to create new folder in Ubuntu using command line Step Type this command and hit Enter if you want to create new folder in your Desktop where user is your username and NewFolder is your folder name
Azmin Believed In Talks With Barisan Mps Tonight To Back Dr M

Azmin Believed In Talks With Barisan Mps Tonight To Back Dr M

papar berkaitan - pada 19/11/2019 - jumlah : 275 hits
A stream of VIP cars and security personnel were seen going to Azmin Ali s home tonight watched by members of the media PETALING JAYA A group of Barisan Nasional MPs are believed to be at a meeting tonight at the home of PKR deputy presiden...
Jason Lo Charged With Trespassing Injecting Drug Into Body

Jason Lo Charged With Trespassing Injecting Drug Into Body

papar berkaitan - pada 19/11/2019 - jumlah : 377 hits
A former chief executive officer of a local telecommunications company was charged in separate Magistrates Courts in Kuala Lumpur today with trespassing into a house and injecting a drug into his body Jason Jonathan Lo 44 who is also a sing...
Shahidan Those Who Met With Azmin Not Jumping Ship To Pakatan

Shahidan Those Who Met With Azmin Not Jumping Ship To Pakatan

papar berkaitan - pada 20/11/2019 - jumlah : 395 hits
KUALA LUMPUR Umno lawmakers who purportedly met PKR deputy president Datuk Seri Azmin Ali have no plans to jump ship to Pakatan Harapan says Arau MP Datuk Seri Shahidan Kassim He said that it was unfair to accuse the group as they were mere...
Land Your Dream With Modello My Platform Unik Yang Merealisasikan Impian Seorang Talent

Land Your Dream With Modello My Platform Unik Yang Merealisasikan Impian Seorang Talent

papar berkaitan - pada 18/11/2019 - jumlah : 354 hits
Hai korang kali ni i nak share sesuatu yang mana ia akan menjadi satu platform bagi kaki socmed yang aktif dalam memviralkan sesuatu yang menarik Semestinya kalau yang viral haruslah yang best dan berfaedah tau Tahu tak sekarang semua orang...
Hr Ministry To Come Up With List Of Critical Jobs

Hr Ministry To Come Up With List Of Critical Jobs

papar berkaitan - pada 16/11/2019 - jumlah : 235 hits
The Human Resources Ministry is preparing a list of jobs categorised as critical as a guideline for students in choosing courses to further their studies at the tertiary level Minister M Kulasegaran said this was because the Fourth Industri...
The Right Types Of Bets For Beginners On Slot Deposit Qris Sites

Lirik Lagu Aku Penat Alita Nidya

Bufet Ramadan 2025 Tradisi Warisan Di Four Points By Sheraton Puchong

Wan Fayhsal Soundly Defeated In Race For Machang Bersatu Chief S Post

Tiada Syarat Sokong Pm Untuk Dapat Peruntukan Anwar Beritahu Pn

Lirik Lagu Suara Rindu Khalis Real Spin

Trump Revives Probe Over Digital Taxes

Term Limit Culture Emerging With Veteran Dap Trio S Exit Says Analyst


echo '';
Senarai Keputusan Pemenang Calon Top 5 Kategori Persembahan Penyampai Trofi Undian Tarikh Tiket Gempak Most Wanted Awards 2024 2025 Live Di Astro Ria Sooka

10 Drama Melayu Terbaru Astro Yang Best 2025 Mesti Tonton Juga Tersedia Online

10 Filem Melayu Malaysia Terbaru Best 2024 2025 Mesti Tonton

Info Dan Sinopsis Drama Berepisod Teratak Kasih Salina Rindu Kasih Musim 3 Slot Samarinda TV3

Info Dan Sinopsis Drama Berepisod Dia Imamku Slot Megadrama Astro Ria


Misi 2025 Tingkatkan Kemahiran Untuk Pencapaian Peribadi

A Guide To Caring For The Borneo Redline Halfbeak Practical Fishkeeping

Punca Nahas Maut Isteri Tentera Menurut Polis

Sprm Reman 4 Pegawai Ismail Sabri Kes Keluarga Malaysia

Kuih Cucur Topi Kelantan Bukan Cucur Jawa Ya

Tindakan Cpr Ketika Terjadi Kecemasan Jantung Terhenti