Components and supplies
Buzzer, Piezo
Jumper wires (generic)
9V battery (generic)
Arduino Mega 2560
5 mm LED: Green
Breadboard (generic)
Flame Sensor
9V Battery Clip
5 mm LED: Red
MQ2 gas and smoke sensor
Tools and machines
Multitool, Screwdriver
Apps and platforms
Arduino IDE
Arduino Web Editor
Project description
Code
FIre and gas detection sensor
arduino
FIre and gas detection sensor
arduino
Downloadable files
Schematic
THE pins are to be connected as such MQ2 sensor A0-A0 gnd -gnd vcc-5 v flame sensor analog -A1 vcc-5 v gnd-gnd green led -digital pin 11 red led-digital pin 12 buzzer- ditital pin 10 buzzer and led gnd to arduino's gnd The mq 4 sensor in the fritzing file has the safe config as the mq 2 sensor. The flame sensor also is the one which i found on fritzing but the one which i have used can be bought from the following link https://www.flipkart.com/rotobotix-fire-flame-sensor-module/p/itmefvrkaevfwpee?gclid=CjwKCAjwo9rtBRAdEiwA_WXcFqBWJgasifZo2X3zWz6o8nJwQT2OZ3zHCLg2yew_anP1qPaYZznAKRoCHgwQAvD_BwE&pid=ETYEFVRKR4F7ZBDH&lid=LSTETYEFVRKR4F7ZBDHQFGCGR&marketplace=FLIPKART&cmpid=content_learning-toy_8965229628_gmc_pla&tgi=sem,1,G,11214002,g,search,,301302884581,1o1,,,c,,,,,,,&ef_id=CjwKCAjwo9rtBRAdEiwA_WXcFqBWJgasifZo2X3zWz6o8nJwQT2OZ3zHCLg2yew_anP1qPaYZznAKRoCHgwQAvD_BwE:G:s&s_kwcid=AL!739!3!301302884581!!!g!297659526198!
Schematic
Comments
Only logged in users can leave comments
0meliodas0
10 months ago
Hello, i'm interested on the project and I see there's no schematics for it so can I have the schematics of this project
Anonymous user
2 years ago
Hello,can i get the schematic diagram for this project.
Anonymous user
2 years ago
where ? i dont see it ??
trijalsrimal
2 years ago
sorry the schematic accidentally got deleted the connections are already there given in the schematic section of the webpage
Anonymous user
2 years ago
can u please share his circuit diagram pic
23_Mebandonbok
2 years ago
youre not using resistor for the leds? will it destroy the led?
trijalsrimal
2 years ago
My leds did not get destoyed.You can use resistors if you want.No change in the code.
Anonymous user
2 years ago
Please send circuit diagram
Anonymous user
2 years ago
Hi, I want to use this with Blynk App to get alarm notifications. I thought to use with USB serial port for Blynk App. Can please suggest a programm and what all charges should I make.
Anonymous user
2 years ago
Can i use arduino uno instead of mega???
trijalsrimal
2 years ago
yes, of course
trijalsrimal
2 years ago
NO CHANGE IN CODE
Anonymous user
2 years ago
Good day! Sir, can you please share the picture of diagram badly needed. Hoping for your kind heart. Thank you !
Anonymous user
2 years ago
Hey, I want to add up a water sprinkler to Arduino if it detects fire. Please, anyone, help me out with pin connections and code.
Anonymous user
2 years ago
greetings sir, i was wondering referring to the wiring board and your coding, is it possible to interface LCD display for additional warning? but how to do so?
trijalsrimal
2 years ago
hey queenrelapse, you can use an i2c lcd and interface it with the arduino board. You should initialize and define the lcd as is in the i2c lcd example and then use the lcd.print commands to display the warning just after the warnings of the serial monitor
Anonymous user
2 years ago
how reliable is this MQ2 sensor? can it be used for commercial purposes like installing at home, cafe or offices etc?
Anonymous user
2 years ago
I dont have analog pin in flame sensor i have only d0 pin
trijalsrimal
2 years ago
#include<SoftwareSerial.h> int redLed = 12; int greenLed = 11; int buzzer = 10; int smokeA0 = A0; int sensorPin = 5; int sensorThres = 500; void setup() { pinMode(redLed, OUTPUT); pinMode(greenLed, OUTPUT); pinMode(buzzer, OUTPUT); pinMode(smokeA0, INPUT); pinMode(sensorPin,INPUT); Serial.begin(9600); } void loop() { int analogSensor = analogRead(smokeA0); Serial.print("Pin A0: "); Serial.println(analogSensor); if (analogSensor > sensorThres) { digitalWrite(redLed, HIGH); digitalWrite(greenLed, LOW); tone(buzzer, 1000, 200); } else { digitalWrite(redLed, LOW); digitalWrite(greenLed, HIGH); noTone(buzzer); } delay(100); Serial.println("Flame Sensor"); int sensorValue = digitalRead(sensorPin); Serial.println(sensorValue); if (sensorValue == LOW) { Serial.println("Fire Detected"); Serial.println("LED on"); digitalWrite(redLed,HIGH); digitalWrite(greenLed,LOW); tone(buzzer,1000,200); delay(1000); } else { digitalWrite(redLed,LOW); digitalWrite(greenLed,HIGH); noTone(buzzer); } delay(100); } //THIS CODE WILL DO YOUR WORK AS THE FLAME SENSOR IS NOW WORKING WITH ITS DIGITAL OUTPUT PINS.
Anonymous user
3 years ago
Hi, I want to use this with Blynk App to get alarm notifications. I thought to use with USB serial port for Blynk App. Can please suggest a programm and what all charges should I make.
Anonymous user
3 years ago
Hey, I want to add up a water sprinkler to Arduino if it detects fire. Please, anyone, help me out with pin connections and code.
Anonymous user
4 years ago
Good day! Sir, can you please share the picture of diagram badly needed. Hoping for your kind heart. Thank you !
Anonymous user
4 years ago
Please send circuit diagram
Anonymous user
4 years ago
how reliable is this MQ2 sensor? can it be used for commercial purposes like installing at home, cafe or offices etc?
Anonymous user
4 years ago
sir can you add a temperature sensor to conforming the fire incident
Anonymous user
4 years ago
can u please share his circuit diagram pic
Anonymous user
4 years ago
greetings sir, i was wondering referring to the wiring board and your coding, is it possible to interface LCD display for additional warning? but how to do so?
trijalsrimal
2 years ago
hey queenrelapse, you can use an i2c lcd and interface it with the arduino board. You should initialize and define the lcd as is in the i2c lcd example and then use the lcd.print commands to display the warning just after the warnings of the serial monitor
Anonymous user
5 years ago
I dont have analog pin in flame sensor i have only d0 pin
trijalsrimal
2 years ago
#include<SoftwareSerial.h> int redLed = 12; int greenLed = 11; int buzzer = 10; int smokeA0 = A0; int sensorPin = 5; int sensorThres = 500; void setup() { pinMode(redLed, OUTPUT); pinMode(greenLed, OUTPUT); pinMode(buzzer, OUTPUT); pinMode(smokeA0, INPUT); pinMode(sensorPin,INPUT); Serial.begin(9600); } void loop() { int analogSensor = analogRead(smokeA0); Serial.print("Pin A0: "); Serial.println(analogSensor); if (analogSensor > sensorThres) { digitalWrite(redLed, HIGH); digitalWrite(greenLed, LOW); tone(buzzer, 1000, 200); } else { digitalWrite(redLed, LOW); digitalWrite(greenLed, HIGH); noTone(buzzer); } delay(100); Serial.println("Flame Sensor"); int sensorValue = digitalRead(sensorPin); Serial.println(sensorValue); if (sensorValue == LOW) { Serial.println("Fire Detected"); Serial.println("LED on"); digitalWrite(redLed,HIGH); digitalWrite(greenLed,LOW); tone(buzzer,1000,200); delay(1000); } else { digitalWrite(redLed,LOW); digitalWrite(greenLed,HIGH); noTone(buzzer); } delay(100); } //THIS CODE WILL DO YOUR WORK AS THE FLAME SENSOR IS NOW WORKING WITH ITS DIGITAL OUTPUT PINS.
FMZannat
5 years ago
Can i use arduino uno instead of mega???
trijalsrimal
2 years ago
NO CHANGE IN CODE
trijalsrimal
2 years ago
yes, of course
Anonymous user
5 years ago
Hello,can i get the schematic diagram for this project.
Anonymous user
2 years ago
where ? i dont see it ??
trijalsrimal
2 years ago
sorry the schematic accidentally got deleted the connections are already there given in the schematic section of the webpage
23_Mebandonbok
5 years ago
youre not using resistor for the leds? will it destroy the led?
trijalsrimal
2 years ago
My leds did not get destoyed.You can use resistors if you want.No change in the code.
juhu63
2 months ago
Some links for the components and supplies doesn't work any more. Could you please actualise them? Thank you very much. Julian