Gas leak detector alarm system with arduino nano
In this tutorial we will see how to assemble a gas leak detector alarm system with arduino nano. We will see a list of the electronic components to be used, the assembly of the circuit, the source code, and finally we will test the operation of the system. This project is ideal for use in sources near our home, where there is gas, such as a kitchen, stove or thermotanque
Electronic components
mq2 gas sensor
Pin-Out sensor de gas Mq-2
Datasheet sensor MQ-2
Download–> MQ-2
Gas sensor (MQ2) is useful for gas leak detection (in home and industry). It can detect LPG, i-butane, methane, alcohol, hydrogen, smoke, etc. Based on its fast response time. measures can be taken as soon as possible. In addition, the sensitivity can be adjusted using a potentiometer (digital pin).
TECHNICAL SPECIFICATIONS
Operating Voltage: 5V DC
Fast
response and high sensitivity Detection range: 300 to 10000
ppm
Characteristic gas: 1000ppm, Isobutane Sensing resistance:
1KΩ 50ppm Toluene at 20KΩ in Response Time: ≤ 10s
Recovery time: ≤ 30s
Working temperature: -20°C~+55°C
Humidity: ≤ 95% RH
Ambient oxygen content: 21%
Consumes less than 150mA at 5V.
APPLICATIONS
Gas
Leak Detector Industrial Gas Detector
Arduino nano
The Arduino Nano is a small, complete and compatible board based on the ATmega328 (Arduino Nano 3.x). It has more or less the same functionality as the Arduino Duemilanove, but in a different package. It only lacks a DC power connector and works with a Mini-B USB cable instead of a standard one.
Pin diagram
Six 5 mm LED diodes of different colors
Six resistors of 1 Kohm
A 5-volt buzeer
Female pins (4 pins in total)
Male pins (In total 2)
Socket for the arduino nano
PCB
Circuit
int sensorMQ2=0;
void setup(){
Serial.begin(9600);//Configuración de la velocidad del puerto serial de arduino a 9600
//Se configuraran los pines 2,3,4,5,6 y 7 como salidas
//Del pin 2 al 6 van conectados a diodos led con su respectiva resistencia
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
//Va conectado al Buzzer
pinMode(7, OUTPUT);
sensorMQ2=analogRead(A0);//Se lee el valor de la entrada analógica A0 donde está conectado el sensor MQ2
while(sensorMQ2>80){
Serial.print("Esperando a que se estabilice el sensor MQ2 (valor menor a 80): ");//Se imprime su valor por el terminal serial
sensorMQ2=analogRead(A0);//Se lee el valor de la entrada analógica A0
Serial.println(sensorMQ2);//Se imprime su valor por el terminal serial
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
delay(500);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(500);
}
}
void loop(){
sensorMQ2=analogRead(A0);//Se lee el valor de la entrada analógica A0
Serial.print("Valor del sensor MQ2: ");
Serial.println(sensorMQ2);//Se imprime su valor por el terminal serial
//Se compara el valor de la variable sensorMQ2 si se cumple apagará todos los led
if(sensorMQ2<79){
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
//Se compara el valor de la variable sensorMQ2 si se cumple encenderá el led en el pin 2
if(sensorMQ2>80){
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
//Se compara el valor de la variable sensorMQ2 si se cumple encenderá el led en el pin 2 y 3
if(sensorMQ2>120){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
//Se compara el valor de la variable sensorMQ2 si se cumple encenderá el led en el pin 2, 3 y 4
if(sensorMQ2>160){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
//Se compara el valor de la variable sensorMQ2 si se cumple encenderá el led en el pin 2, 3, 4, y 5
if(sensorMQ2>200){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
//Se compara el valor de la variable sensorMQ2 si se cumple encenderá el led en el pin 2, 3 ,4 ,5, 6 y el buzzer
if(sensorMQ2>240){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);//Se actica el buzzer
}
delay(100);// retardo antes de comenzar de vuelta
}
Gas leak detector alarm system with arduino nano
*PCBWay community is a shared platform and we are not responsible for any design issues.
- Comments(0)
- Likes(1)
- Ron Varun Lowe Oct 04,2021
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by CarlosVolt Tutoriales
- How to make a water level meter with uln2803 In this tutorial we will see how to make a water level meter circuit with the built-in uln2803.The p...
- Emular mouse y teclado con arduino muy fácil En este tutorial, aprenderemos cómo utilizar un Arduino para emular tanto un mouse como un teclado e...
- Control of apc220 modules with smartphone and app Controlling APC220 modules using a smartphone and an app involves connecting via a serial USB adapte...
- Exploring the potential of the SI5351 module in electronic projects In this tutorial, you will dive into the depths of this amazing device and discover its limitless po...
- Gas leak detector alarm system with arduino nano In this tutorial we will see how to assemble a gas leak detector alarm system with arduino nano. We ...
- Build your own long-range weather station with Lora GPS anemometer module In this tutorial we will see how to create a weather station, for places where there is no internet ...
- Dual Synchronized Radio Frequency Control for Motor Lights and more In this tutorial we will see how to do a synchronized radio frequency control, since one control can...
- Object lifter with servo and Arduino Nano Does your waist or back hurt when you bend down? So this invention, it's for you and it can help you...
- 8-channel dual light ignition system, infrared and pushbuttons In this tutorial we will put together a dual light ignition system, since we can control the ignitio...
- How to turn on lights with telegram and esp32 from anywhere in the world In this tutorial we will see how to make a system that allows us to turn on lights with telegram, fr...
- Motion detector with light, esp32 and telegram notifications In this tutorial we will see how to make a motion detector system, with a PIR sensor, a relay module...
- Alcoholimeter with MQ3 sensor and arduino nano (Includes printed circuit) In this tutorial we will see how to make a breathalyzer, simple economical and easy to make. We’ll s...
- GPS tracker without cellular network with LORA module In this tutorial we will see how to make a tracker to GPS tracker, with LORA and Arduino module. We ...
- Build a meter with integrated circuit KA2284 KA2284 integrated circuit featuresHigh gain rectifier amplifier included (Gv = 26dB)Low radiation no...
-
IoT Indoor system with ESP32 to monitor Temperature, Humidity, Pressure, and Air Quality
270 0 1 -
Naruto Multi-color PCB printed with UV technology
112 2 1 -
-
-
-
-