Head office, Rana Pratap Bagh, Delhi011 2721 1512+91 97116 99511

Science project idea

Gas leak detector that turns a model cylinder valve shut with a servo

An MQ-6 LPG sensor senses a leak and an Arduino rotates a high-torque servo fitted to a model regulator knob to the closed position, sounds a buzzer, and shows the gas level on an LCD. It demonstrates automatic shut-off, not just an alarm.

What it shows

An MQ-6 LPG sensor senses a leak and an Arduino rotates a high-torque servo fitted to a model regulator knob to the closed position, sounds a buzzer, and shows the gas level on an LCD. It demonstrates automatic shut-off, not just an alarm.

The science

The MQ-6 is tuned for LPG and butane; gas lowers the resistance of its heated tin oxide layer and the analog output rises. The Arduino smooths readings with a running average and compares them with a threshold found by testing. A metal gear servo gives enough torque to turn a stiff knob a quarter turn; its 50 Hz pulse width sets the angle. The servo draws peaks of nearly an amp, so it has its own supply with a shared ground. A latch in code keeps the valve closed until a reset button is pressed, because reopening automatically would be dangerous in a real system.

Materials

Cost: under Rs 1,500. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.

  • An Arduino Uno clone and USB cable
  • An MQ-6 LPG sensor module
  • An MG995 or MG90S metal gear servo
  • A 16x2 I2C LCD and a buzzer
  • A cardboard or bottle model cylinder with a knob the servo can grip
  • A separate 5 V 2 A supply for the servo
  • Jumper wires

Safety

For this project: Test with an unlit lighter only, with an adult present, in a ventilated room. This is a model; never fit it to a real gas cylinder.

Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.

All the safety rules

Step by step

9 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.

  1. Wire the MQ-6: VCC to 5 V, GND to GND, AO to A0, and let it warm for two minutes.

  2. Print readings and note clean-air and lighter-gas values; set the threshold between them.

  3. Mount the servo so its horn grips the model knob; wire its signal to pin 9 and its power to the separate 5 V supply with ground joined to the Arduino.

  4. Wire the LCD to A4 and A5, the buzzer to pin 6, and a reset button between pin 3 and GND with INPUT_PULLUP.

  5. Write the sketch: show the live reading on the LCD; if above the threshold, move the servo to the closed angle, start the buzzer and set a latched flag.

  6. Keep the valve closed and the LCD showing LEAK until the reset button is pressed and the reading is back below the threshold.

  7. Find the open and closed angles by trying values with the servo sweep example first.

  8. Test with an unlit lighter: the knob should turn within two seconds and the alarm should stay on after the gas clears.

  9. Press reset and watch the knob return to open and the LCD show SAFE.

What you should see

Gas near the sensor closes the model valve in under two seconds with an alarm that stays latched until manually reset; the LCD shows the live level throughout.

Viva questions

A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.

1Why latch the alarm instead of clearing it automatically?

A real leak may continue after the sensor clears; a person must check before gas is restored.

2Why a metal gear servo?

Turning a knob needs more torque than a plastic SG90 can give without stripping its gears.

3What is a running average for?

It smooths out noise so a single spike does not trigger the valve.

4What is the difference between MQ-2 and MQ-6?

Both are tin oxide sensors, but the MQ-6 is tuned to be most sensitive to LPG and butane.

Free ebook: Viva Questions for Science Projects

Take it further

Add an ESP8266 so the leak event also sends a message to a phone.

Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.

Free ebooks for this project

WhatsApp us