I bought an MQ-2 gas sensor module quite a long time ago, and it has been sitting on my shelf ever since. Recently, I decided to do some more tinkering with it. After doing some googling and finding some tutorials online, I found a few projects that use an Arduino to read the Analog Out pin of an MQ-2 breakout board to determine the individual concentration of multiple substances in the air.
Here is the GitHub page for an Arduino Library that does this, (
https://github.com/miguel5612/MQSensorsLib) I did not manage to get the example sketch for the MQ-2 working, but according to the code (
https://github.com/miguel5612/MQSensorsLib/blob/master/examples/MQ-2/MQ-2.ino), it gets the concentration of Hydrogen, LPG, Carbon Monoxide, Alcohol and Propane.
What I don’t understand is, how does it get all this information for multiple substances from a single Analog Output?
I also found that, apparetly, using the MQ sensor lineup is a whole lot more complicated than I actually thought. I found a detailed instructable for the MQ-7 where they build a whole drive circuit for the device and everything. (
https://www.instructables.com/id/Arduino-CO-Monitor-Using-MQ-7-Sensor/). Are all these steps necessary for the MQ-2? If so, can someone link a proper tutorial for how to drive the MQ-2? I was unable to find any that went into as much detail as this instructable did.