MQ-7 "flying fish" heating cycle


I recently purchased an MQ-7 CO sensor and, as per my usual approach, did so without reading the datasheet.

After receiving the unit, I was all set to connect it to my Uno and start getting readings. However, after actually reading the datasheet (attached), I now see that it is not quite as trivial to use as I had imagined.

Specifically, the unit must be ‘heated’ at 5 V for 60 s to desorb the gases, then powered at 1.4 V for 90 s during the actual reading. Initially this also sounded trivial (easily solved using a PWM pin). Unfortunately, the datasheet also indicates that the MQ-7 heating resistance is 33 Ohms, which should be a current draw of 150 mA (5 V) or 42 (1.4 V) mA, both of which are beyond the Uno PWM pin capability of 40 mA.

I found this tutorial which discusses this issue, and suggests using an NPN transistor as a variable resistor, and connecting the power of the MQ-7 to the 5 V pin of the Uno (can handle > 200 mA).

In this tutorial, the author recommends to desolder some of the components. My question is: Has anyone here used this module before, and if so, did you have to desolder any components to have the board function properly? Also, any tips/ideas on how to use this unit would be greatly appreciated.

Thank you,


MQ-7.pdf (52.2 KB)

I wonder why the writer from that article didn't use a 82ohm resistor across the transistor to get that 1.4volt across the sensor. That should have been a lot easier than using PWM, smoothing caps, and oversampling. The 82ohm resistor only dissipates ~150mW at that current (~42mA), so a common 1/4watt metalfilm would have been ok. 1k base resistor (4.3mA) won't fully saturate a medium power (2N2222) TO-92 transistor @150mA. Lower to 330ohm or 470ohm if you want (almost) the full 5volt on the sensor. Or use a logic level mosfet. Leo..

Hi Leo,

Thanks for your reply. If I understand what you’re saying, then I agree it would be much easier for me to use a logic level MOSFET.

I believe you are suggesting that I put a MOSFET in parallel with a 82-85 Ohm resistor, with both connected in series to the 33 Ohm heater. When the MOSFET is off, all of the current will pass through the 82-85 Ohm resistor, resulting in ~ 1.4 V at the heater. When the MOSFET is turned on, all of the current should pass through the MOSFET, resulting in ~ 5 V at the heater. Is the attached circuit drawing roughly what you are suggesting? Based on my (limited) knowledge, I also think this should work, and appears much simpler to me. I have several Si2302DS MOSFETs I can use for this if you think it is appropriate.



Can't switch high-side with an N-channel fet.

Source to ground, heater between 5volt and drain, resistor between source and drain.


Got it!

Thanks for your suggestion. I'll give it a try.

BTW, do you (or anyone else) know why it was recommended to desolder some of the component on the breakout board for the MQ-7?

Can't tell for sure without a circuit diagram, but most of the components on that board seem to be used for the threshold detector of the digital output. Not used for the analogue output of the module. Modification instructions seem to be missing on that destructables website.

Seems logical to measure the difference between module ground and module analogue out, with two Arduino analogue inputs, when the module is in 1.4volt mode (floating ground must also be measured). If the resolution is too low, then use a P-channel mosfet (your diagram, but with source to 5volt), and measure output of the module with 1.1volt Aref enabled in setup(). Leo..


I have come back to playing around with this circuit, but have run into a few more issues.

Based on the ‘instructables’ link I shared in my first post, and Leo’s comments, I set up the circuit to provide a 5 V and 1.4 V phase to the heater. That all seems to be working fine. However, the actual CO measurement is supposed to take place following the 1.4 V phase. During this phase, the ‘power LED’ (see attached image of breakout board) is not on, as the unit needs 5 V to operate.

This has me confused (again). Has anyone used one of these units before? In most tutorials I have read, the author(s) simply ignore the fact this unit is supposed to cycle between 5 V (heating) and 1.4 V (reading) phase. However, if I use the unit as per the datasheet, I am trying to take the reading when the unit is not actually turned on.

If anyone has any recommendations, I’d appreciate the help!


MQ-7.pdf (52.2 KB)

I spent some time looking for decent tutorials using that MQ-7 module, and there do not seem to be any. I include your "Instructables" in that list (most Instructables are written by people who have little to no idea what they are doing and are best avoided).

Most tutorials do not even obey the manufacturer's requirement of dual voltage heater excitation, or note the requirement of a 48 hour burn-in, so you are on your own.

Keep in mind that the MQ sensor series is, in general, not useful for quantitative measurements. All of the sensors respond to several different gases, so about all any of them can do is report that something in the immediate air supply has changed. That is why they are dirt cheap.

If you are interested in making [u]quantitative[/u] measurements of CO, be prepared to shell out $$ for a calibrated, commercial sensor.

PS: the circuit diagram of the sensor module is found in this otherwise useless tutorial: |500x222

Hmmm, that's unfortunate.

Yes, I'm aware the module does not give quantitative readings. I mostly just wanted to check for large leaks. Based on what you (or anyone else) has seen, do you actually take readings when powering the module at 1.4V? Or do take the reading immediately after sitting at 1.4 V when the module is powered back on at 5V?



do you actually take readings when powering the module at 1.4V?

Yes, according to the manufacturer's directions.

The data sheet is not very clear, so it will take some experimentation to decide how best to use the sensor.

To be at all informative, this experimentation requires you to use a gas mixture of known CO concentration for testing and calibration. It would be good to have some other gas mixtures for comparison.

If you do this work carefully, which necessarily includes implementing a decent and correct way of cycling the heater, you could make a real contribution to the Arduino sensor community.


I’ve looked into this a bit, and here are my comments:

  1. The MQ-7 module is so poorly documented that it is not a great choice to work with
  2. There are other (qualitative) sensors (such as the mics5524) that seem simpler to work with, and don’t appear to have any clear disadvantage vs. the MQ-7.
  3. If I were to take the time to calibrate the MQ-7 fully, it would only really be of use to me. Unless I mapped out the entire RH, temperature, CO concentration, and interfering gases profile, it is unlikely my results would be directly applicable to anyone else. Additionally, even if I did so, anyone looking to make quantitative measurements would (hopefully) repeat some of my results under their exact conditions with their own sensor to ensure they got the same data. By the time this was complete, their own data would be more useful for them than what I could provide.
  4. In case it is of help to anyone, I am posting the circuit that was suggested by Leo. I have built this circuit, and it worked exactly as expected (thanks Leo). While I did physically build the circuit, for this group, I am also posting the results of the circuit simulation in case anyone finds it useful.

Finally, for anyone reading this in the future, my final suggestion is simply to not use this sensor, as it is needlessly painful to work with, and poorly documented.



If I were to take the time to calibrate the MQ-7 fully, it would only really be of use to me.

[u]Every[/u] sensor used for quantitative measurements must be individually calibrated. NO EXCEPTIONS.

Either you do it yourself, or pay someone to do it.

Thanks for your posts and the pictures with the Mosfets. Together with the tutorial at I got my MQ7 working, at least it seems so, and with a quite simple code. Values in clean air are about 12, in a closed glass after burning some alkohol they are about 1000. Now I'll try to get it calibrated. Bernd

Two more things: First, when you have the MQ7 on the breakout-board, VCC for the heater and the mesure-Pins are always the same. But the measure-pins need 5V while the heater is on 1,4V for measuring. That's why I soldered out the Sensor. Second, only as a comment, I use the mosfet IRFBC40, because I had it at home. But it has a R DS(on) of 1.2 Ohm and my HIGH-Voltage for the heater is only 4.7 V. I'll have to change it. Bernd

Hello begruber, I'm glad this topic was useful for you. It sounds like you had some success, which is great to hear!

When you say

That's why I soldered out the Sensor.

, are you saying that you completely removed the sensor module from the breakout board? If so, can you provide a circuit drawing for how you wired the module?



Hello Bernd, even though it have been a while a answer would be great.
Did you have succes calibrating the sensor, and if so how did you do it?