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.
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.
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 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().
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!
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 quantitative measurements of CO, be prepared to shell out $$ for a calibrated, commercial sensor.
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?
I've looked into this a bit, and here are my comments:
The MQ-7 module is so poorly documented that it is not a great choice to work with
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.
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.
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.
Thanks for your posts and the pictures with the Mosfets. Together with the tutorial at instructables.com 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.
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.