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
- Control lights by voice commands and keys In this tutorial we will see how to create a device to control lights by voice commands, with a modu...
- Stepper motor control x bluetooth and app In this tutorial we will see a circuit, which controls a stepper motor, with an application made in ...
- DFplayermini x bluetooth mp3 player control More info and updates in https://rogerbit.com/wprb/2022/12/dfplayermini-x-bluetooth/In this tutorial...
- Robot with WiFi control and servos driven by ESP32 More info and updates in https://rogerbit.com/wprb/2023/07/robot-wifi/A robot controlled by Wi-Fi, s...
- 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...
- Turn on Light with Reyax RYLR896 LoRa Modules with Acknowledgement In this tutorial, you will learn how to use the Reyax RYLR896 LoRa modules to wirelessly and reliabl...
- Laser controlled by joystick servos and Arduino More info and updates in https://rogerbit.com/wprb/2023/06/laser-controlado-x-joystick/In this tutor...
- Non-contact high temperature alarm using TS01 sensor The TS01 non-contact sensor high temperature alarm is a system designed to detect and alert about da...
- Capture photos with esp32-cam, SD card with motion detection Capture photos with esp32-cam, SD card with motion detectionIn this exciting tutorial, we'll show yo...
- 5 in 1 sensor: temperature, humidity, pressure, altitude and light intensity More info and updates in https://rogerbit.com/wprb/2023/11/sensor-5-en-1/The 5-in-1 Sensor is a comb...
- Beeper with telegram bot and esp32 More info and updates in https://rogerbit.com/wprb/2024/06/beeper/In this tutorial, you will learn h...
- 8-channel light control with ps/2 keyboard and arduino The 8-Channel Lighting Control System with PS/2 Keyboard and Arduino is a project that combines the ...
- Electronic scale with Arduino with HX711 module and tare function More info and updates in https://rogerbit.com/wprb/2024/03/balanza-electronica/In this tutorial, you...
- Capacimeter with Arduino A Capacimeter is an instrument used to measure the capacitance of a capacitor. In this tutorial, we ...
- Start of section with fingerprint module and arduino micro Project descriptionMore info and update in $ https://rogerbit.com/wprb/2023/08/inicio-seccion-finger...
- Frequency meter with alarm A frequency meter is a device that measures the frequency of a periodic signal. In combination with ...
- 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...
-
Control lights by voice commands and keys
79 0 0 -
3 phase Motor and Phase Sequence Indicator / Rotation Tester
97 0 1 -
Stepper motor control x bluetooth and app
59 0 0 -
-
DFplayermini x bluetooth mp3 player control
107 0 0 -
-
-