Home Arduino Projects Arduino Projects: Gas Sensor

Arduino Projects: Gas Sensor

by Nikodem Bartnik
Arduino Projects: Gas Sensor

One of the most popular sensors almost everyone has at home is the gas detectors. It makes your home a little smarter than usual by adding to it the ability to detect dangerous gases. This can actually save lives.

Making yours can provide a lot of fun and will actually help understand more about these type of sensors.

Let’s build a project that detects gases like CO and afterdamp.

Keep in mind that our sensor wouldn’t be certified and tested professionally as the one you have at home but it does not remove the usefulness of it.

We are going to use the very popular gas sensor: MQ-7. But you can also use the CO2 sensor or the alcohol sensor. They are all very similar and you can use them almost the same way.

Parts needed

Arduino Projects: Gas Sensor


So as always we will start by connecting everything as shown in the schematic below.

Make sure you connect the analog output of the sensor to the Arduino.

Arduino Projects: Gas Sensor

It is a really good idea to use both the LED and the buzzer (visual + sound) as the output signal because it increases the probability of the signal to be noticed.

Before powering it on, I want to mention this one thing: this sensor heats up to measure gas in the air. It is normal that it gets hot or smell like it was burning.

Arduino Projects: Gas Sensor
Arduino Projects: Gas Sensor

Upload the code when you are done with the wiring.

The project simply reads the output values from the sensor and base on that, blink the LED faster or slower. At some value above the threshold, the buzzer should turn ON.

Beyond the visual and sound output using the LED and the buzzer, it also sends the output information to the Serial monitor so you can see what is happening and eventually adjust the code accordingly.

The easiest way to check how this sensor works is to blow on it, you should see how the values on the serial monitor are increasing, the LED starts to blink faster and the buzzer turning ON.

You might also like:

Related Posts

1 comment

David Svarrer August 24, 2018 - 5:38 pm

My God, nobody have taken upon themselves to give you accolades for your great article and tutorial about use of the Gas detector? Thanks a lot! Very useful. Have just built it, and it works perfectly 🙂

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy