Methane CNG Gas Sensor - MQ-4

This is a simple-to-use compressed natural gas (CNG) sensor, suitable for sensing natural gas (composed of mostly Methane [CH4]) concentrations in the air. The MQ-4 can detect natural gas concentrations anywhere from 200 to 10000ppm.

This sensor has a high sensitivity and fast response time. The sensor's output is an analog resistance. The drive circuit is very simple; all you need to do is power the heater coil with 5V, add a load resistance, and connect the output to an ADC.

This sensor comes in a package similar to our MQ-3 alcohol sensor, and can be used with the breakout board below.

Methane CNG Gas Sensor - MQ-4 Product Help and Resources

Hazardous Gas Monitor

June 17, 2016

Build a portable gas monitor to check for dangerous levels of hazardous gases.


Checking with a multimeter and it does not matter if it's A or B on any of the gas sensors that is connected with the breakout board. If you look at the datasheet, it shows that the pins for A1 and A2 or B1 and B2 are internally connected together, respectively. Also the application circuit shows that the polarity does not matter, just as long as the pins on each side align with the breakout board.

Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

1 Soldering

Skill Level: Noob - Some basic soldering is required, but it is limited to a just a few pins, basic through-hole soldering, and couple (if any) polarized components. A basic soldering iron is all you should need.
See all skill levels

Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

1 Electrical Prototyping

Skill Level: Noob - You don't need to reference a datasheet, but you will need to know basic power requirements.
See all skill levels


Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Member #440108 / about 8 years ago / 1

    The pins are not labelled on the MQ-4 how do you work out the pin layout?

  • TheMoogle / about 15 years ago / 4

    so the big question is... can you detect farts with it?

  • Member #33329 / about 10 years ago / 1

    I'm looking at both the MQ-3 and MQ-4 sensor. I don't see anything on the case or bottom to indicate which pins are which. Does anybody have any info that can help determine the orientation?

    • emc2 / about 9 years ago / 1

      Somebody suggested metering the leads but both sides test the same for continuity... wth.

      Next to the stamped part number there is a smaller "3" - do you think that means pin 3?

  • sanpan / about 10 years ago / 1

    Anyone use the readings to measure CH4 in ppm? I am trying to understand how to do the conversion from the datasheet, but do not see how to get the equation. I assume it is linear over the entire range, what is confusing me is why does the sensitivity graph show the characteristics for 7 different gases? Does the conversion need to account for the contribution of each of those 7 gases to determine the actual concentration of CH4? Also, shouldn't the datasheet say what is the expected resistance at 1000ppm at room temp or something so you can extrapolate from there? It lists a range of 10k to 60k, which seems really wide. The datasheet says it can detect from 200-10000ppm, so seems like you should be able to measure in ppm, right?

  • Member #478228 / about 11 years ago / 1

    any tips on how to calibrate this sensor??

  • Member #478228 / about 11 years ago / 1

    any tips on how to calibrate this sensor??

  • Member #454026 / about 11 years ago / 1

    Hi, I am using MQ6 gas sensor in my circuit. when i power on it gives alert continuously.

    My configuration is like this.

    1. the two A pins shorted and connected to +5V through a pot (present POT value 4.7K)
    2. H on A side connected to +5V through 100ohm.
    3. The two B's shorted and connected to 20K resistor to ground. also, a series resistor to NPN transistor.

    the problem is when i power on the circuit, the output is high continuously. I get 1V continuously on B pins. i tried to separate two B pins and i see on 1 B pin output is 5V and second pin 0.

    I am using a pretty new Gas sensor.

    Can you tell me why i am getting high on output continuously?

  • Member #442918 / about 11 years ago / 1

    Why is the GND and VCC shorted? it's killing my voltage regulator! getting hot as hell

    • MikeGrusin / about 11 years ago / 1

      It shouldn't be shorted, but there is a 33 ohm heater in there; it will draw 150mA at 5V.

      • Member #442918 / about 11 years ago / 1

        hmm, perhaps the MQ4 i bought was defective? could you please double confirm with me using a short circuit test with your multimeter? thanks~

        • MikeGrusin / about 11 years ago / 1

          Also note that in my multimeter at least, if you're doing a continuity test, anything under 100 ohms will cause a beep. This is different from a hard short (0 ohms). Perform this test using resistance mode.

          • Member #442918 / about 11 years ago / 1

            There's resistance across the heater. But what is the safest voltage supply connection to the sensor? I used a 5V 1A voltage regulator and my voltage regulator gets pretty darn hot.

        • MikeGrusin / about 11 years ago / 1

          Double-check your circuit against the datasheet, several pins on the device are supposed to be shorted. If you're sure you're reading a hard short across the heater (the pins labeled 'H'), contact our tech support department and they'll be happy to help you out.

          • Member #442918 / about 11 years ago / 1

            there's no hard short, but my voltage regulator still emits high temperature.

            • MikeGrusin / about 11 years ago / 1

              Because it's based on a heater, this sensor requires quite a bit of current, and will tax a small linear regulator. All linear voltage regulators will heat up based on how much current they're supplying. You can switch to a larger regulator, and/or reduce the input voltage to the regulator so it's closer to the dropout voltage (e.g. change from 12V to 9V). What Arduino are you using?

              • Member #442918 / about 11 years ago / 1

                Im using the 5V voltage regulator. The input to the regulator is 7.4V. So do I need to add in a resistor to reduce the current flowing through the heater? If yes, how much?

  • Novice Dave / about 12 years ago / 1

    where do I find a wiring diagram that is actually for the MQ4 sensor. the example is for a different sensor. Also does anyone have the scoop on EXACTLY how to hook these up as a working model?

    Many thanks in advance

  • DukeNukem / about 12 years ago / 1

    Anyone know where you can get those mounting sockets for the MQ series of gas sensors?

  • Riskable / about 12 years ago / 1

    I've been playing around with this sensor over the past few days and I thought I'd share my findings...

    The sensor is sensitive to CO2--not just CO. So if you blow on it your breath will increase the reported values (val +330 if I try real hard by holding my breath before I blow on it =). This means that if you want to use it as a fart detector you need to keep out of the direct exhale path of heavy breathers. I also suspect that the humidity and cooling properties of your breath amplifies the effect.

    Tip: You can perform a quick CO2 test with your breath or you could just pop open a can/bottle of soda right next to the sensor.

    The sensor is also sensitive to sudden temperature changes. For example, if you grab it with your fingers it will drop the temperature (which hovers around 50 degrees celcius) a few degrees very quickly. When this happens the values coming off the sensor will be increased by about 30 to 100 depending on how long you hold it and how cold your fingers are.

  • Member #161141 / about 13 years ago / 1

    How fast is "fast response time"? (The datasheet is silent on this.) 150ma at 5V is a lot to draw 24/7 from a battery, so I would like to cycle this sensor. From power on to moderate accuracy, are we talking milliseconds or seconds or what?

    • Member #40615 / about 12 years ago / 1

      It's an electric heating element. You're not going to make it a power saver...

    • Riskable / about 12 years ago / 1

      I know it has been a long time since you asked this question but I've done some testing and I have the answer: The gas sensor takes about one minute to "warm up" to the point where it is producing stable values.

  • xD The fart sensor is sold out.

  • does this sensor require a drive circuit to send the square wave heating signal like the CO sensor or does it just require a steady 5v?

  • Jonaskj / about 14 years ago / 1

    After playing with the alc sensor which was awsome this one was rather a dissapointment.
    To get any readings you must have some sort of an airflow(fart flow) directly on the unit. In other you must fart directly on it. If you fart 0.5m away it will not detect anything.
    Also when i touch the sensor, or blow on it the AD value goes up 2-300.
    Anything I'm doing wrong, or is it simply not designed to detect farts?
    My normalised value is ~200 using a 10k resistor...

    • Member #581248 / about 10 years ago / 1

      Hello, my name is John. What did you mean by alc sensor? Thanks for your help.

  • Jessy / about 15 years ago / 1

    my arduino has a nose for farts now.

  • zGhost / about 15 years ago / 1

    But still no Co2 sensor!!

Customer Reviews

4 out of 5

Based on 1 ratings:

Currently viewing all customer reviews.

Works great! Not the best datasheet.

I needed a fan to turn on when the concentration of methane got to a certain point in an enclosure. This sensor allowed me to do that. It has been in operation for about a week now and has worked perfect. The datasheet is not the greatest, but the supporting tips on the product page helped me to understand the product better.