Introduction: Precise Air Quality Monitoring System (Portable)
In this Instructable, I will walk you through the steps to build an Precise Air Quality monitoring system.
It consists of an
- Arduino Uno
- 2 Grove ( MQ2 & MQ9 ) sensors
- MQ136 & MQ138
- LED display
- Temperature & Humidity sensor DHT 11/22.
Arduino Uno takes data from the sensors and does the calculations so you can see real time values of the data.
As you can see the monitoring is quite compact, it is portable and can be used in many ways, example:
- Compact Weather Station (Use DHT11 only)
- Manhole gas Detection (MQ2 only)
- General Air Quality Monitoring (Entire Instructable)
The Grove gas Sensors sense :
- Temperature.
- Humidity.
- Methane.
- Butane.
- LPG.
- Smoke.
- Benzene.
- Toluene.
- Alcohol.
- Acetone.
- Propane.
- Formaldehyde gas.
- Hydrogen gas.
Arduino Uno R3 supports 8 analog data inputs, so the at least 8 gas sensors can be interfaced and with them almost every gas that is found in residential areas. With Arduino Mega you have 16 analog input pins,so more interfacing can be done. In this Instructable I will show you how to interface these sensors.
Why we need this : Pollution is ever-increasing.There is a need for a reliable, cost - efficient system to monitor the air around us, so we can take proper steps to minimize or stop these emissions
Note : If you like this instructable, do vote for me under the Sensor and First Time Author challenge.
Purpose : I wanted to monitor the air in my surrounding area with their concentration (ppm) values . But there was no article which could give ppm values of various gases. So, I made a full working model which displays values of various gases in ppm.
Note:The videos are trial run. They run smoothly and update the values with great ease.The videos may be shaky as I am alone shooting them :D
More videos to come.
Step 1: Specifications
Dimensions : 20*10*10
Weight : (~350 grams)
Total cost : 1600 Rs (If you remove dust sensor total cost drops to 600 Rs)
Cost of products available in market : 3500 Rs
Components:
Sharp GP2Y1010AU0F
MQ135
MQ138
DHT11
Fan (recommended 5V)
Jumpers
Breadboard
LCD display
Recommended :
A cardboard box ( Recycle things )
Step 2: Dust Sensor
GP2Y1010AU0F is a dust sensor by optical sensing system. An infrared emitting diode (IRED) and an phototransistor are diagonally arranged into this device. It detects the reflected light of dust in air. Especially, it is effective to detect very fine particle like the cigarette smoke. In addition it can distinguish smoke from house dust by pulse pattern of output voltage.
Connections:
Sharp pin 1 (V-LED) => 5V (connected to 150ohm resister)
Sharp pin 2 (LED-GND) => Arduino GND pin
Sharp pin 3 (LED) => Arduino pin 2
Sharp pin 4 (S-GND) => Arduino GND pin
Sharp pin 5 (Vo) => Arduino A7 pin
Sharp pin 6 (Vcc) => 5V
Step 3: MQ Gas Sensors
Before using MQ sensors you need to apply Vcc for about 24 hours. Also, using extreme values of resistors can decrease your accuracy and efficiency of the system.
I have used 10 kohms resistors throughout.
Burn-in
Some datasheets use the term "preheat", but it is the time to burn-in the sensor. This is meant to make the sensor readings more consistent. A time of 24 hours is usually used for the burn-in time.
The Burn-in is achieved by applying normal power to the sensor (to the heater and with the 'A' and 'B' pins connected, and with a load-resistor).
Load-resistor
The sensor needs a load-resistor at the output to ground. It's value could be from 2 kOhm to 47 kOhm. The lower the value, the less sensitive. The higher the value, the less accurate for higher concentrations of gas.
Choosing a good value for the load-resistor is only valid after the burn-in time.
Step 4: MQ Sensors Wiring
The preferred wiring is to connect both 'A' pins together and both 'B' pins together.
It is safer as well as gives more reliable output results.
In the picture 2, the heater is for +5V and is connected to both 'A' pins. This is only possible if the heater needs a fixed +5V voltage. The variable resistor in the picture is the load-resistor and it can be used to determine a good value. A fixed resistor for the load-resistor is used in most cases.
The Vout is connected to an analog input of the Arduino.
Connect analog input pins at A0,A1,A2,A3 pins of arduino.
Step 5: LCD
I put together an Arduino with :
16x2 LCD display HD44780
10k trimpot for LCD contrast
100 Ohm resistor for the LCD backlight
Connections :
The LCD has 16 pins, 12 are used.
Pin1 to Ground
Pin 2 to +5V
Pin 3 to 10K trimpot center
Pin 4 (RS) to Arduino Digital Pin 3
Pin 5 (RW) to Ground
Pin 6 (E) to Arduino Digital Pin 4
Pin 7,8,9,10 - Not Used
Pin 11 (D4) to Arduino Digital Pin 5
Pin 12 (D5) to Arduino Digital Pin 6
Pin 13 (D6) to Arduino Digital Pin 7
Pin 14 (D7) to Arduino Digital Pin 8
Pin 15 (Back Light +) to 5v
Pin 16 (Back Light -) to ground via100 Ohm resistor) One side of the 10K trimpot goes to +5v the other side to ground
See the schematic diagram and pictures.
Step 6: DHT11 / DHT22
The DHT11 and DHT22 have 4 pins.You can use anyone of those.
Looking at it with the side with square cutouts in it the pins are from left to right:
- +5v
- Signal
- not used
- GND
It also requires a 10k pullup resistor between +5V and
Signal For this project the Signal lead goes to Digital Pin 2 on the Arduino
Step 7: Fan
Whichever fan you buy, Pay attention to specifications of the fan.
Specs would at least have :
Voltage at which it operates.
Current it pulls.
For eg: mine has 12 v, 0.14Amp
So make sure to give it 12V supply and look that only 0.14A current is passed through else, the fan may get damaged.
Step 8: Box It Up
Get any cardboard box.
Make a square hole through it at one end.
At other make small holes so that the gases are thrown out of the other end.
Step 9: Code
I would suggest you should code on your own.This would make your understanding better.
If you do not wish to code, here it is
Code is pretty much documented.
To find ppm:
I'll explain for one gas sensor, rest all are same
In figure above,
The values are plotted on a semilog paper, as you can see the values indicate 100......1000.....10000 ppm.
These values when plotted on a normal graph would represent a curve like an exponential one.
So you need to use those values as in your code.
Rs/Ro_limit = (ppm/a) ^ (1/b)
Hence, ppm = a*(Rs/Ro)^b
If any problem comes up, I am here to help.
Attachments
Step 10: Some Problems You Might Face
My first attempt at interfacing all sensors didn't work properly, LCD screen would often fade out.
But it turned out that it was due to some loose connections.Look out for those if the LCD fades out, there is often some problem with connection of resistors.
In further versions you could send the data directly to PC and make a log out of it. If you wish to display the data on Serial Monitor of Arduino I will attach the second code here.
Step 11: Bundle in Together
There you go, now you have your own pollution monitoring system.
You can sense the your surroundings' air quality.
Have fun with it. Hope you like it.

Participated in the
Sensors Contest 2016

Participated in the
First Time Author Contest 2016
32 Comments
4 years ago
Hi, Have you the code to mq138?
Thanks¡¡
5 years ago
Nice project. But I´m confused. It says, that I should connect the DHT11 to pin to to the Arduino AND the Sharp pin to pin 2. Is this correct? Thanks
5 years ago
Really great work.
I have one question. If I want to add more sensors with different bits per second for serial data transmission, such as 9600 and 115200. How can I write the code? It will be like this serial1.begin() and serial2.begin()? Thank you.
6 years ago
what about the calibration? how do you know whether the values measured are correct?
Reply 6 years ago
Try burning something, like in the video. If value change, you have calibrated properly.
6 years ago
Hello , what about current of this sensors? whether there should be powered by external power supply? ( same MQ-2 requires 800mW )
Reply 6 years ago
Arduino will take care of that. Take a look at the connections above. Hope this helps.
6 years ago
How would you make this push data to the internet?
Reply 6 years ago
ESP 8266. I was busy with other work, sorry for late reply.
6 years ago
Thanks for your reply. I will look into it
7 years ago
U r project is cool..I am doing it.
Reply 7 years ago
That's great. Do let me know how it turns out :)
7 years ago
I am new to the gas sensors and did a simple text with MQ - 9 gas sensor.
the output is 151
151
152
they are ppm values ryt ???
I was bit confused. give me clarity.
Reply 7 years ago
I can help you better after taking a look at the code.
However, by looking at the values I guess they are just the analog output values given by the arduino. To get ppm values, you should take a look at the datasheet of the corresponding gas sensor (in this case MQ 9) or can also take help from the code I attached above.
Hope this helps :)
7 years ago
With a little bit of work this could be used to graph long term air quality in an area
Reply 7 years ago
Yes!! That's what I've been trying to do!! Trying to send the data, for now to my computer and storing it. Maybe, in sometime it'll be complete.
Thanks for your valuable suggestions :)
7 years ago
That music in MQ sensor video, that's amusing.
Great instructable though !! Voted, Best of luck for the competition :)
Reply 7 years ago
Hey, I noticed that now. That's sound of TV running in background. Thank you for bringing that into notice and also for your kind words !
7 years ago
Hey, can you explain how actually gas sensors work??
Btw, great project !!
Reply 7 years ago
Sensitive material of gas sensors is SnO2, with lower conductivity in clean air. When target pollution gas exists, the sensor’s conductivity gets higher along with the gas concentration rising.
The graph I included in step 9 gives Rs/Ro vs ppm ratio explains this part.
Hope this helps.