MQ-X Arduino Library 1.0.0
This is a library for the MQ-X Sensors.
Loading...
Searching...
No Matches
MQX Gas Sensor Arduino library

Make docs and publish to GitHub Pages Arduino Library Manager Compatibility

Butane, LPG & Smoke sensor MQ2 breakout
Butane, LPG & Smoke sensor MQ2 breakout

Gas sensor registers the presence of various gases, such as oil and gasoline vapors, butane, propane, methane, ethanol(alcohol), hydrogen, smoke. It registers gases the best while they are in the liquid form, but since we cannot find them in that state that often, it measures a good concentration of substances in a gaseous state. It takes a short time to heat up in order to work correctly.

The breakout board works with both digital (DO) and analog signals (AO). The digital output is obtained by setting a threshold value with a potentiometer. The analog output will differ depending on the intensity of the gas.

  • Voltage: 5V
  • Digital(HIGH/LOW) and analog(0V-5V) output
  • With LM393 comparator
  • Dimensions: 22 x 38 mm
Alcohol, Ethanol sensor MQ3 breakout
Alcohol, Ethanol sensor MQ3 breakout

An alcohol sensor is capable of detecting alcohol (ethanol) particles on itself and gives the information in digital form back to us to manipulate it.

The breakout board works with both digital (DO) and analog signals (AO). The digital output is obtained by setting a threshold value with a potentiometer. The analog output will differ depending on the intensity of the gas.

  • Voltage: 5V DC
  • Power: max 750mW
  • Measurement range: 0.04-4mg/L
  • Dimensions: 38 x 22 mm
Methane, CNG sensor MQ4 breakout
Methane, CNG sensor MQ4 breakout

Have you ever wondered how much natural gas and methane are in your living room? You can easily measure that! The MQ4 breakout board is a simple-to-use sensor that detects the natural gas and methane (CH4) in the air. Once heated to working temperature, it detects changes in air concentrations very quickly between 200 and 10000 ppm.

On the through-holes, the DO stands for digital out and AO for analog out. The digital output is obtained by setting a threshold value using the potentiometer. The analog output will depend on the intensity of the gas around the sensor.

  • Dimensions: 38 mm x 22 mm
  • Logic voltage level: 5V
  • Operating voltage: 5V
  • Operating temperature: -10°C to 50°C (14 to 122 °F)
  • Gas detection: CNG (compressed natural gas), methane
  • Gas detection range: 200-10000 ppm
  • Preheat time: 24 hours
  • Mounting holes: 2
Natural gas, LPG sensor MQ5 breakout
Natural gas, LPG sensor MQ5 breakout

Is your office near a high-traffic area? Are you concerned about the amount of natural and liquefied petroleum gases in your work environment? The MQ5 is a simple-to-use sensor to put your mind at ease. It detects gas particles very quickly between 200 and 10000 ppm.

The breakout board works with both digital (DO) and analog signals (AO). The digital output is obtained by setting a threshold value with a potentiometer. The analog output will differ depending on the intensity of the gas.

  • Dimensions: 38 mm x 22 mm
  • Logic voltage level: 5V
  • Operating voltage: 5V
  • Operating temperature: -10°C to 50°C (14 to 122 °F)
  • Gas detection: natural gas, LPG (liquefied petroleum gas)
  • Gas detection range: 200-10000 ppm
  • Preheat time: 24 hours
  • Mounting holes: 2
LPG, Butane sensor MQ6 breakout
LPG, Butane sensor MQ6 breakout

Humans can detect many scents, but can have difficulties when it comes to differentiating gases. That’s why we use sensors like MQ6. It detects LPG and butane in the air. When heated to the optimum working temperature, it detects changes in air concentrations very quickly between 200 and 10000 ppm.

The DO pin stands for digital out. AO stands for analog out. The digital output is obtained by setting a threshold value using the potentiometer. The analog output will depend on the intensity of the gas around the sensor.

  • Dimensions: 38 mm x 22 mm
  • Logic voltage level: 5V
  • Operating voltage: 5V
  • Operating temperature:  -10°C to 50°C (14 to 122 °F)
  • Gas detection: LPG (liquefied petroleum gas), butane
  • Gas detection range: 200-10000 ppm
  • Preheat time: 24 hours
  • Mounting holes: 2
CO sensor MQ7 breakout
CO sensor MQ7 breakout

Gas sensor MQ7 detects the presence of Carbon Monoxide (CO) in the air. The best results are given when alcohol is in liquid form, however, it still does an amazing job when measuring in gas form. It needs a bit of time to warm up in order to work correctly.

The breakout board works with both digital (DO) and analog signals (AO). The digital output is obtained by setting a threshold value with a potentiometer. The analog output will differ depending on the intensity of the gas.

  • Detects: Carbon Monoxide (CO)
  • Dimensions: 38 x 22 mm
  • Voltage: 5V
  • Digital (HIGH/LOW) and analog (0V-5V) output
  • With LM393 comparator
Hydrogen sensor MQ8 breakout
Hydrogen sensor MQ8 breakout

Hydrogen is all around us, and it’s very flammable. Its leakage can be very dangerous to both life and property. That’s why it's important to detect any leakage to prevent in the industry. To help with that, hydrogen sensors like the MQ8 breakout board are used. The sensor detects hydrogen at the range of 100-1000 ppm.

The digital and analog outs are on the breakout through-hole pins. They are marked as DO and AO respectively. By setting a threshold value with a potentiometer, you can get the digital output. The analog output will depend on how much gas is detected around the sensor.

  • Dimensions: 38 mm x 22 mm
  • Logic voltage level: 5V
  • Operating voltage: 5V
  • Operating temperature:  -10°C to 50°C (14 to 122 °F)
  • Gas detection: hydrogen
  • Gas detection range: 100-1000 ppm
  • Preheat time: 48 hours
  • Mounting holes: 2
CO, flammable gasses sensor MQ9 breakout
CO, flammable gasses sensor MQ9 breakout

We are surrounded by invisible gases everywhere. While we generally don’t have to worry about them, under the right circumstances, they can be very combustible and dangerous. The MQ9 breakout board detects carbon monoxide, methane, propane, and other flammable gases so the right measures can be taken in time. The sensor detects carbon monoxide at 10-1000 ppm and other combustible gasses at 100-10000 ppm.

The digital and analog outs can be found on the through-holes. They are marked as DO and AO respectively. The digital output can be obtained by setting a threshold value with a potentiometer. The analog output will depend on the intensity of the gases.

  • Dimensions: 38 mm x 22 mm
  • Logic voltage level: 5V
  • Operating voltage: 5V
  • Operating temperature:  -10°C to 50°C (14 to 122 °F)
  • Gas detection: carbon monoxide, methane, propane, flammable gases
  • Gas detection range: 10-1000 ppm CO, 100-10000 ppm combustible gases
  • Preheat time: 48 hours
  • Mounting holes: 2
Ozone sensor MQ131 breakout
Ozone sensor MQ131 breakout

This breakout for the MQ131 sensor responds to the presence of ozone in the air. As the ozone concentration increases, the resistance changes and the ozone concentration can be measured by measuring the analogue output voltage. The sensor is of good precision and is normally used in ozone concentration detectors. There is a 3362 potentiometer on the board with which the digital signal threshold can be set. There is a digital and analogue output via the male pins.

  • Sensor: MQ131
  • Detects: ozone
  • Detection range: 10 ... 1000ppb ozone
  • Power supply: 5 V
  • Output: 1V at 200ppb O3
  • Dimensions: 38 x 22 mm
Air quality sensor MQ135 breakout
Air quality sensor MQ135 breakout

OPIS

Hydrogen Sulfide sensor MQ136 breakout
Hydrogen Sulfide sensor MQ136 breakout

OPIS

Ammonia sensor MQ137 breakout
Ammonia sensor MQ137 breakout

Gas sensor registers the presence of ammonia gas (NH3). It registers gases the best while they are in the liquid form, but since we cannot find them in that state that often, it measures a good concentration of substances in a gaseous state. It takes a short time to heat up in order to work correctly.

The breakout board works with both digital (DO) and analog signals (AO). The digital output is obtained by setting a threshold value with a potentiometer. The analog output will differ depending on the intensity of the gas.

  • Voltage: 5V
  • Digital(HIGH/LOW) and analog(0V-5V) output
  • With LM393 comparator
  • Dimensions: 22 x 38 mm
VOC sensor MQ138 breakout
VOC sensor MQ138 breakout

Gas sensor registers the presence of VOC gasses: toulen, alcohol, acetone and hydrogen. It registers gases the best while they are in the liquid form, but since we cannot find them in that state that often, it measures a good concentration of substances in a gaseous state. It takes a short time to heat up in order to work correctly.

The breakout board works with both digital (DO) and analog signals (AO). The digital output is obtained by setting a threshold value with a potentiometer. The analog output will differ depending on the intensity of the gas.

• Voltage: 5V • Digital(HIGH/LOW) and analog(0V-5V) output • With LM393 comparator • Dimensions: 22 x 38 mm

Methane, Natural gas sensor MQ214 breakout
Methane, Natural gas sensor MQ214 breakout

OPIS

Butane, LPG & Smoke sensor MQ2 breakout with easyC
Butane, LPG & Smoke sensor MQ2 breakout with easyC

OPIS

Alcohol, Ethanol sensor MQ3 breakout with easyC
Alcohol, Ethanol sensor MQ3 breakout with easyC

OPIS

Methane, CNG sensor MQ4 breakout with easyC
Methane, CNG sensor MQ4 breakout with easyC

OPIS

Natural gas, LPG sensor MQ5 breakout with easyC
Natural gas, LPG sensor MQ5 breakout with easyC

OPIS

LPG, Butane sensor MQ6 breakout with easyC
LPG, Butane sensor MQ6 breakout with easyC

OPIS

CO sensor MQ7 breakout with easyC
CO sensor MQ7 breakout with easyC

OPIS

Hydrogen sensor MQ8 breakout with easyC
Hydrogen sensor MQ8 breakout with easyC

OPIS

CO, flammable gasses sensor MQ9 breakout with easyC
CO, flammable gasses sensor MQ9 breakout with easyC

OPIS

Ozone sensor MQ131 breakout with easyC
Ozone sensor MQ131 breakout with easyC

OPIS

Air quality sensor MQ135 breakout with easyC
Air quality sensor MQ135 breakout with easyC

OPIS

Hydrogen Sulfide sensor MQ136 breakout with easyC
Hydrogen Sulfide sensor MQ136 breakout with easyC

OPIS

Ammonia sensor MQ137 breakout with easyC
Ammonia sensor MQ137 breakout with easyC

OPIS

Benzene, Toluene, Acetone, Formaldehyde sensor MQ138 breakout with easyC
Benzene, Toluene, Acetone, Formaldehyde sensor MQ138 breakout with easyC

OPIS

Methane, Natural gas sensor MQ214 breakout with easyC
Methane, Natural gas sensor MQ214 breakout with easyC

OPIS

Repository Contents

  • **/src** - source files for the library (.h & .cpp)
  • **/examples** - examples for using the library
  • **_other_** - keywords file highlights function words in your IDE, library.properties enables implementation with Arduino Library Manager.

Hardware design

You can find hardware design for this board in Butane, LPG & Smoke sensor MQ2 breakout hardware repository.

You can find hardware design for this board in Alcohol, Ethanol sensor MQ3 breakout hardware repository.

You can find hardware design for this board in Methane, CNG sensor MQ4 breakout hardware repository.

You can find hardware design for this board in Natural gas, LPG sensor MQ5 breakout hardware repository.

You can find hardware design for this board in _LPG, Butane sensor MQ6 breakout _ hardware repository.

You can find hardware design for this board in CO sensor MQ7 breakout hardware repository.

You can find hardware design for this board in Hydrogen sensor MQ8 breakout hardware repository.

You can find hardware design for this board in CO, flammable gasses sensor MQ9 breakout hardware repository.

You can find hardware design for this board in Ozone sensor MQ131 breakout hardware repository.

You can find hardware design for this board in Air quality sensor MQ135 breakout hardware repository.

You can find hardware design for this board in Hydrogen Sulfide sensor MQ136 breakout hardware repository.

You can find hardware design for this board in Ammonia sensor MQ137 breakout hardware repository.

You can find hardware design for this board in VOC sensor MQ138 breakout hardware repository.

You can find hardware design for this board in Methane, Natural gas sensor MQ214 breakout hardware repository.

You can find hardware design for this board in Butane, LPG & Smoke sensor MQ2 breakout with easyC hardware repository.

You can find hardware design for this board in Alcohol, Ethanol sensor MQ3 breakout with easyC hardware repository.

You can find hardware design for this board in Methane, CNG sensor MQ4 breakout with easyC hardware repository.

You can find hardware design for this board in Natural gas, LPG sensor MQ5 breakout with easyC hardware repository.

You can find hardware design for this board in LPG, Butane sensor MQ6 breakout with easyC hardware repository.

You can find hardware design for this board in CO sensor MQ7 breakout with easyC hardware repository.

You can find hardware design for this board in Hydrogen sensor MQ8 breakout with easyC hardware repository.

You can find hardware design for this board in CO, flammable gasses sensor MQ9 breakout with easyC hardware repository.

You can find hardware design for this board in Ozone sensor MQ131 breakout with easyC hardware repository.

You can find hardware design for this board in Air quality sensor MQ135 breakout with easyC hardware repository.

You can find hardware design for this board in Hydrogen Sulfide sensor MQ136 breakout with easyC hardware repository.

You can find hardware design for this board in Ammonia sensor MQ137 breakout with easyC hardware repository.

You can find hardware design for this board in Benzene, Toluene, Acetone, Formaldehyde sensor MQ138 breakout with easyC hardware repository.

You can find hardware design for this board in Methane, Natural gas sensor MQ214 breakout with easyC hardware repository.

Documentation

Access Arduino library documentation here.

  • Tutorial for using the MX-X board
  • Installing an Arduino library

Board compatibility

The library is compatible with board & microcontroller families shown in green below:

Compile Sketches

About Soldered

soldered-logo

At Soldered, we design and manufacture a wide selection of electronic products to help you turn your ideas into acts and bring you one step closer to your final project. Our products are intented for makers and crafted in-house by our experienced team in Osijek, Croatia. We believe that sharing is a crucial element for improvement and innovation, and we work hard to stay connected with all our makers regardless of their skill or experience level. Therefore, all our products are open-source. Finally, we always have your back. If you face any problem concerning either your shopping experience or your electronics project, our team will help you deal with it, offering efficient customer service and cost-free technical support anytime. Some of those might be useful for you:

Original source

​ This library is possible thanks to original MQSensorsLib library. Thank you, miguel5612.

Open-source license

Soldered invests vast amounts of time into hardware & software for these products, which are all open-source. Please support future development by buying one of our products.

Check license details in the LICENSE file. Long story short, use these open-source files for any purpose you want to, as long as you apply the same open-source licence to it and disclose the original source. No warranty - all designs in this repository are distributed in the hope that they will be useful, but without any warranty. They are provided "AS IS", therefore without warranty of any kind, either expressed or implied. The entire quality and performance of what you do with the contents of this repository are your responsibility. In no event, Soldered (TAVU) will be liable for your damages, losses, including any general, special, incidental or consequential damage arising out of the use or inability to use the contents of this repository.

Have fun!

And thank you from your fellow makers at Soldered Electronics.