Introduction: Prevention of Domestic Gas Leakage Using Arduino.

In this instructable I made a prototype that automatically closes the gas knob of the LPG cylinder when there is a gas leak. LPG is odourless and an agent called Ethyl Mercaptan is added for its odour, so that it can be noticed when there is a leak. But if there is a leak when the people are not at home it leads to a fatal accident. To prevent these accidents I made this prototype.


1. Arduino Uno.

2. Servo motor.

3. Gas sensor(MQ-5).

4. Motor driver-L293d.

5. CD drive from old PC.

Step 1: Components

Gas sensor: I used MQ-5 gas sensor to detect the LPG leakage. It gives both analog and digital output.

Servo motor: I used Sg90 motor which is used in most of the Arduino projects. It can rotate 180 degrees approximately and we use only 90 degrees rotation of the motor. The motor can be attached to cylinders gas knob.

Cd drive: I used this drive to represent the windows present in the room. A DC motor is responsible for opening and closing of the drive. It represents the opening and closing of the windows in the room.

Motor driver: I used the l293d motor driver to control the dc motor in the cd drive. This motor driver can drive 2 DC motors at a time in both clockwise and anticlockwise direction. The input pins are connected to Arduino and the output pins are connected to the DC motor.

Step 2: Connections

Gas sensor: There are four pins in this sensor. The Vcc and gnd are connected to the 5v and gnd pins of the Arduino . I want the analog output so the analog pin is connected to the pin A0 of Arduino.
Motor driver: Input pins A and B are connected to the digital pins 5&6 of the Arduino. Output pins of motor 1 are connected to the DC motor. Finally a 9v battery is connected to the driver through a dc connector.
Servo motor: The red and brown wires are connected to 5v and gnd pins of the Arduino respectively. The orange wire is connected to pin 9(pwm pin) of Arduino.

Step 3: Working

The MQ-5 sensor output is compared with a reference value. Once the output is greater than the reference value the Arduino sends a signal to the servo motor and it will rotate 90 degrees to close the cylinder knob and it also sends the signal to the motor driver to open the cd drive(which represents opening of windows).

Click here to see the code.