This Is An AtmosphericGasAnanlyser Using MQ Series Sensors, Dht-11 Sensor & Arduino The Basic Idea Is To Precisely Measure Data Using Sensors Analog Read & Display It In I2CLcd, Here The Sensors Can Give Values Of LPG, CNG, HYDROGEN, AIR-QUALITY This Project Can Be Used To Collect Sensor Readings For FutureResearchProcesses. If You Need You Can Simply Add An SD Card To Store The Data As String And Collect The Readings, Here For Simplicity & SpaceReduction Iam Using Arduino Nano And I2ClCD Display, For My Ease. The Sensors Spit Out Aanalog Readings And I Have Converted It Into Useful PPM Values Of The Sensors analogToPPM(analogRead(The Sensor)). It Is Very Useful So I Have Converted It To PPM,

Connecting the hardware and Reading the analog value is easy, but the most difficult thing is to calibrate the sensors and calculating the ppm(parts per million) value for a specific gas. After searching for a long time on the internet, I find a library for those sensors. And comparing the calculation with the datasheet of the sensors, it seems promising.

Here I found an article that explains the working and the calculation for an MQ sensor- UNDERSTANDING A GAS SENSOR.

I use the library and write a code to use six of those sensors with an Arduino nano and show different gas concentrations on air.

You can find the library here - MQUnifiedsensor library

For coding, first of all, I include the LiquidCrystal_I2C and MQUnifiedsensor library and then define the display parameter and the Input PIN for the sensors. Then in the setup section, I initialize the display and the sensors and set the R0 value for every sensor. You have to calibrate your sensors to find this R0 value. For that, uncomment a section in the setup function and upload the code to your Arduino with the pre-burned sensor connected. Then you will find the R0 value for every sensor in the serial monitor. Note the values and change them in the setup function. It is recommended that calibrate the sensors once in a clean environment and set the R0 value. The part to uncomment is indicated in the code.

And in the loop function, I set the A and B values for the exponential equation for different gases. Here A and B value is for PPM = A*ratio^B. Those values are different for different gas in different sensors.

After that, I display the gas concentration on the LCD by two values on a page. There is a 3-second delay between every page.

MQ2 is one of the commonly used gas sensors in MQ sensor series. It is a Metal Oxide Semiconductor (MOS) type Gas Sensor also known as Chemiresistors as the detection is based upon change of resistance of the sensing material when the Gas comes in contact with the material. Using a simple voltage divider network, concentrations of gas can be detected.

It can detect the gases and smoke anywhere from 200 to 10000ppm.

The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For displaying text on the screen, you can do most everything in 4-bit mode, so example shows how to control a 16x2 LCD in 4-bit mode