Description:
In this project, the MQ6 Gas sensor is used to detect LPG leakage. Once the gas is detected, the LED lights up and buzzer makes sound. Arduino UNO is used.
Circuit Diagram:
Components:
SR. NO. | COMPONENT | PINOUT DIAGRAM | BUY |
---|---|---|---|
1 | Arduino UNO (Other Arduinos can be used too) | Arduino UNO Pinout Diagram⇗ | |
2 | Red LED | ||
3 | Buzzer | ||
4 | MQ6 Gas Sensor | MQ6 Gas Sensor Pinout Diagram⇗ | |
5 | 220 Ohm Resistor |
Arduino UNO
The Arduino UNO is a powerful and versatile microcontroller board that can be used to create a variety of projects, including gas leak detection. The board is based on the ATmega328P and is easily programmable using the Arduino IDE. With the Arduino UNO, you can create a circuit that connects the MQ6 gas sensor, LED and buzzer to detect LPG gas leaks. The MQ6 gas sensor can detect LPG gas leaks in the concentration range of 300 to 10000ppm and sends the signal to the Arduino UNO. The Arduino UNO then processes the signal and triggers the LED and buzzer to indicate a gas leak. The Arduino UNO can also be programmed to send an alert to a smartphone or other device using wireless communication such as Bluetooth or Wi-Fi. This allows for remote monitoring of gas leaks and ensures timely response to potential hazards.
Red LED
An LED, or Light Emitting Diode, is a small electronic device that emits light when an electric current is passed through it. In the context of the LPG gas leakage detector, it is used as an indicator light to show the status of the detector. The LED used in this project is connected to the Arduino UNO to receive a signal from the MQ6 gas sensor. When the gas sensor detects a LPG gas leak, it sends a signal to the Arduino UNO which then triggers the LED to light up as an indication of a gas leak. The LED provides a visual indication of a gas leak, making it easy for the user to identify the presence of gas even in low light conditions. Additionally, LED’s are available in different colors, the most common being red and green, this allows the user to easily distinguish the status of the detector. LED’s are also low power consumption and have a long lifespan, which makes them a suitable option for gas leakage detection systems.
Buzzer
A buzzer, also known as an audio alarm, is an electronic device that produces sound. In the context of the LPG gas leakage detector, it is used as an alarm, to alert the user of the presence of LPG gas leaks. The buzzer used in this project is a small round 2 pin buzzer, which is an electronic device that produces sound. It is connected to the Arduino UNO to receive a signal from the MQ6 gas sensor. When the gas sensor detects a LPG gas leak, it sends a signal to the Arduino UNO which then triggers the buzzer to produce a loud sound as an alarm. The loud sound produced by the buzzer ensures that the user is alerted even in noisy environments. Additionally, small round 2 pin buzzers are also resistant to vibration, shock and humidity, making them a durable and reliable sound producing option for gas leakage detection systems.
MQ6 Gas Sensor
The MQ6 gas sensor is a type of sensor used to detect the presence of certain gases, such as propane and methane, specifically LPG gas. It is a small, low-cost device that can be easily integrated into a wide range of applications, including gas leak detection systems. The sensor works by measuring changes in resistance caused by the presence of a gas. It has a high sensitivity to LPG gas and can detect it in the concentration range of 300 to 10000ppm. The MQ6 gas sensor can be easily interfaced with microcontrollers like Arduino UNO to build a circuit for LPG gas leak detection. The sensor sends the signal to the Arduino UNO, which processes it and triggers an alarm in the form of a LED and buzzer. This helps in timely detection of LPG gas leaks and prevents potential hazards. Additionally, MQ6 gas sensor is also resistant to vibration, shock and humidity, making it a durable and reliable gas sensing option.
220 Ohm Resistor
A 220 ohm resistor is an electronic component used to control the flow of electric current in a circuit. In the context of the LPG gas leakage detector, it is used in conjunction with the LED as an indicator light to show the status of the detector. The 220 ohm resistor is connected in series with the LED, it limits the current flowing through the LED, preventing it from being damaged by high current. It also helps to control the brightness of the LED, making it easier to see the status of the detector. The resistor value is chosen based on the voltage and current requirements of the LED, in this case, a 220 ohm resistor is used as it is a commonly used value for LEDs in many applications. The use of a resistor ensures the proper functioning of the LED, as well as prolonging its lifespan. This makes it a crucial component in the circuit of the LPG gas leakage detector using Arduino UNO, MQ6 Gas Sensor LED and Buzzer.
Steps and Info:
1. Get correct components as given. You can buy online or offline. I buy electronics components mostly from Amazon.
2. Start connecting the components. If you are new to connecting components in an electronic circuit, then use a Breadboard or you can straight up make connections using Jumper wires but it will create problem when there will be two or more connections needed at one pin(for example two or more different sensors 5V connection to Arduino’s 5V pin). But before soldering components on a PCB or printing a PCB for your circuit, better try using breadboard so that any errors and mistakes can be observed on breadboard and not after soldering. Or do connections in your way.
3. Now after building the circuit, download the Arduino IDE from https://www.arduino.cc/ website.
4. If you are new to Arduino IDE software, then watch this video we made specially for beginners about Arduino IDE.
5. If you know Arduino IDE then straight up copy the code we given and paste it into the Arduino IDE sketch.
6. Connect the Arduino to your Computer/device. Select a proper port, proper Arduino type and whatever other settings are. Here it is Arduino UNO. (If you don’t know what this all is then watch our video: ).
7. Compile the code and Upload it.
8. If any error occurs then try to troubleshoot it by finding/copy-pasting it into our Solve Errors page https://electronicsprojects.in/solve-errors/, or you can straight up paste the error on Internet and you know the rest. Also check if there are no spelling/syntax errors in the code. Compile the code again once to check if errors are fixed. I have given proper connections and code but still nothing is perfect.
9. Once code compiles and uploads smoothly, you can start testing the working of your circuit/project.
10. Now for this project, take your device to a place where there is an LPG Gas stove, try to pass very few amount of gas from the nozzle or the gas burner and check if the sensor detects the gas. If it detects then the LED will light up and buzzer will make sound. If it doesn’t then find what’s wrong. Check connections, code and whatever it is. As LPG is hazardous, you can use a simple smoke from something to detect.
11. NOTE: LPG gas is super hazardous! NEVER NEVER keep any fire/fire source near the LPG gas. If the gas comes in contact with fire, it ignites instantly or even blows up! Work safely and cautiously.
Program Code:
/* www.electronicsprojects.in LPG Gas Leakage Detector using Arduino, MQ6 Gas Sensor LED and Buzzer */
int RedLED = 12;
int BUZZER = 9;
int MQ6 = 0;
int LPG;
void setup()
{
Serial.begin(9600);
pinMode(RedLED, OUTPUT);
pinMode(BUZZER, OUTPUT);
pinMode(MQ6, INPUT);
}
void loop()
{
LPG = digitalRead(MQ6);
Serial.println(LPG);
if (LPG == 1)
{
Serial.println("LPG Gas in da house ! Bad Air");
digitalWrite(RedLED, HIGH);
digitalWrite(BUZZER, HIGH);
}
else
{
Serial.println("No LPG. Clean Air");
digitalWrite(RedLED, LOW);
digitalWrite(BUZZER, LOW);
}
}