Introduction: Air Pollution Detector: a CO2 Level Using MG-811
Air quality, Air pollution, Global Warming.. Many environmental problems that came as a cost of the new era! People around the world are raising causes to stop these stuff from destroying our beautiful planet!
Pollution comes in many forms. My cause here is directed to air pollution, more specifically, the air pollution that affect human beings, animals an planets.. which is the decreased level of the Oxygen gas!
Unfortunately, while trying to put my hands on a good Oxygen sensor, I struggled of the high bills of such with good and stable performance sensors, thus I though for a while,,, so the air has the many types of gases other that O2, Nitrogen, and one of those with a slightly good (measurable) percentage is CO2. Having this not departing me away from my cause above, then I would use consider it :)
From 400.350.org web site I quote:
"If you care about the future of life on Earth, there's some Big News you should know.
GLOBAL CO2 CONCENTRATIONS JUST PASSED 400 PARTS PER MILLION."
Now I would like to join this awareness wave form my stand as a geek!
Please note that if you're seeking code, detailed steps and/or some instructions on how to do the stuff below without bothering yourself scratching your mind little bit, then this is not the right instruct-able for you!
I believe that if you build it yourself, its easier for you to debug new problems when you're willing to upgrade this project sometime. Moreover, the internet is already overwhelmed with basic tutorials on how to connect shield with uControllers and such..
Step 1: The IDEA..
The idea of my cause is to make a small device to detect CO2 levels in areas where needed. This device should be inform people around with the increased level of the CO2 level as well as informing the in-charge contacts about the percentage cutting the predefined limit.
This could be used in places where we have people who cannot understand/deal with the increased level of CO2 level. This can be used in kindergartens, elderly shelters, closed rooms (in general) where we have bad air circulation such as in big buildings or if we have fireplace in an ordinary home. This also can be used in animal shelters, and indoor planets farming as well.
Step 2: What Do You Need..
While looking for the right sensors, you need to remember that (for honest buyers) how much you pay, as much you get..
I found that an MG-811 CO2 sensor is quite enough to make a good demonstration of my idea. Although I read about how much people are struggling to make it work (check the Arduino forum) I decided to take the challenge and with my fingers crossed =)
An advise when buying that sensor: you'll find many flavors of this sensor's packaging from different vendors, and by packaging I mean the breakout board. Most of those who have troubles got the sensor from aliexpress or from ebay. I have to tell you that this sensor is very brittle and could be easily be damaged through transportation without you noticing any noticeable surface issues. Anyways, I got mine from aliexpress too and I was lucky to have the process almost very smooth!
In my opinion, if I would like to have another project with this sensor I would buy it from http://sandboxelectronics.com/?product=mg-811-co2-... . Most of those who dealt with their module had no problem with it. No I'm not advertising for them, and the're not sponsoring, but these guys have the most amazing documentation for their product, and that is a very good point to consider when buying your electronics!
Other than the MG-811, you need a controller, an UNO was pretty enough in my case.
I also used an GSM "SIM 900" in my case to notify the in-charge person in case of the increased level. There are a lot of awesome tutorials on how to work with this model around the web. an SMS message will be sent in case of the CO2 reading is beyond 1200PPM. This is all configurable based on the need.
In order to show the messages, such as the CO2 level, I used a 2*16 LCD.
I used a buzzer to notify the users around the module of the increased level (above 1000PPM in my case).
For powering the modules you can use a 12 volts battery to spread the juice to all modules since:
- the GSM module is advised to get 5 Volts 2 Amps.
- MG-811 need 6 volts to power the heater inside, so I used a buck converter to lower down the voltage. (you might need to use 7-12 volts based on the module you get)
- powering the arduino and the LCD also must be took in consideration.
In my case, as I'm still making a POC, I'm using a regular Arduino transformer to power the Arduino and the LCD, as well as an old laptop charger with 2 outputs 5v2Amp, 12v2Amp to power the GSM and the MG-811 respectively.
In my project I have considered that the sensor needs an initialization period on a cold start of about 24-48 hours (when you get form the supplier) and about 5-20 min preheating period on each start (when cold), so on each start, I'm running a 30 min countdown time so both MG811 and the GSM (need 3 sec to connect to Network) can initialize successfully. Anyways, I have added an ON/OFF switch to bypass the timer in case the user decided that the sensor is warm enough to work (such in case power shortage/ replacing the battery).
I added another ON/OFF switch to enable/disable the functionality of notifying throw SMS. From practical point of view, you can think about in case you have an increasing level of CO2, and you're working on fixing the issue, you don't want the module to keep sending SMS overtime. Moreover, I have configured the system to have a settle time between each SMS reminder, thus a configurable time period of around 5 min is splitting each of the notification attempts.
Step 3: Its Demo Time!
Check the demo and let me know what do you think in the comment section below. Kindly provide me feedback on my inscrutable since I'm very new to this platform.
Please Vote for this cause (in contests) if you see this is a good candidate :)
Step 4: Update!
As I mentioned earlier, I am trying to help join the cause of saving our planet from air pollution, using this device, we would detect the increasing level of the CO2 and work o fixing the cause.
In order to spread the world, I offered the idea of this project for a school fair project as it will be reviewed by the local ministry.
We have added new module to the project. So in case we have the CO2 level increased above a certain limit, say 1550 PPM, we're running a fan to renew the air in the closed room, the fan will automatically turn off once the CO2 level back to an acceptable percentage. This means that the system is smart enough to take an action until the in-charge person can deal with the real cause of the problem.
Please check out the update in the video!
Participated in the
Sensors Contest 2017
Participated in the
Green Electronics Contest 2016
Participated in the
Arduino Contest 2016
Question 2 years ago
Can i use MG811 and ESP8266 alone to detect the CO2 level and notify me with sms when the CO2 level is higher than 1200ppm??
2 years ago
hi, nice to meet you....
i want to ask, how can you to create program arduino? i tried program from web, but it seem failed with the result, then how come you create code program? Can you please tell me? :)
i hope that you can tell me how to code program.
3 years ago
Can this be used outdoors ?
Question 3 years ago
what is the output of MG 811 CO2 sensor?
Is it in milivolts (mv) and if yes what is its range? I want to perform signal conditioning for the MG811 sensor
3 years ago
please provide the circuit diagram for connecting mg811 with arduino via stepup module
3 years ago
for the MG-811, is the voltage must be 6V?
Question 4 years ago on Step 4
You need a note for a carbon dioxide detection project, please
Answer 4 years ago
I need programme arduino detection gaz
6 years ago
nice project. Thanks 4 sharing, but it would be easier for me to understand, when I could study the sketch for the arduino.
You also told us about good documentation about the GSM-module. Can you please send a link and tell me also, what kind of GSM module you used?
I would like to vote, but there are too many questions open ;)
Reply 6 years ago
Sorry for the late reply its been a very tough week at work! Thank you for your feedback. I will figure out what I can do regarding the sketch..
Regarding the GSM module, I'm using the GSM 900 shield. Please have a look at this tutorial which have lots to learn from:
I also was using the AT commands refference guid to have more understanding of how to communicate with the module.