• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Arduino Projects / How to Make LED Air Pollution Meter Circuit with Arduino

How to Make LED Air Pollution Meter Circuit with Arduino

Last Updated on December 5, 2024 by Swagatam 3 Comments

In this project I will show how to construct an air pollution meter using MQ-135 sensor and arduino. The pollution level in the air is indicated by series of 12 LED. If higher the number of LEDs glows, the higher the pollution content in the air and vice versa.

Table of Contents
  • Overview
  • The Design:
  • Prototype Image: 
  • How to test:
  • Program Code:

 

Overview

This project can prove very useful in places where air quality plays an important role such as in hospitals. Alternatively, this can be also another hobby project for your own home.

Although this we cannot expect a great degree of accuracy with this project, it can definitely give a reasonably good idea regarding the pollution level at your ambience.

The pollution in the air can be carbon dioxide, carbon monoxide, butane, methane, and some odourless gas. The sensor cannot differentiate between gases but, it takes all the gas samples from the air in a go.

If you are living in metropolitan city and you apartment is placed near a busy road, this project might come in handy to give a rough insight about air ambience.

Most people ignore the air quality measures at their residence, it is estimated that India alone contributes to 1.59 million deaths every year, which includes indoor and outdoor pollutions.

Majority of the population is unaware of air purifiers which are readily available on markets and e-commerce sites, which does not cost more than a smartphone.

Okay, now warnings apart, let’s dive into circuitry.

The Design:

The air pollution meter will be more interesting if the LEDs are rectangular shaped and above layout design is used. However, you can use your imagination to make this project more interesting to you.

How to Make LED Air Pollution Meter Circuit

The above schematic illustrates, how to connect sensor to arduino. An external power supply is implemented for heater coil of the sensor. The sides of the sensor can be interchanged.

The pin A0 of arduino senses the voltage variations in the sensor due to changes in pollution content in air.

The sensor acts as variable resistor (in response to pollution) and 10K is fixed resistor, this act as a voltage divider. The arduino has 10-bit ADC, which helps the LED to glow discretely in response to air pollution level, which is an analogue function.

LED Air Pollution Meter Circuit with Arduino

When the analogue voltage level crosses a certain threshold level which is pre-determined in the program, it will turn on LEDs.

The successive LEDs are pre-determined with higher threshold levels.

It starts with LED test, each LED is turned on sequentially with some delay and the user can determine the error in the LED connections, such as unconnected LEDs and LEDs which are not sorted sequentially. The program comes to halt for 5 minutes and all the LEDs glow simultaneously.

This will give enough time for the sensor to warm-up; we can see some of the action performed by arduino in serial monitor. Once sensor reaches optimum temperature, arduino sends some readings to serial monitor. Based on the readings, LEDs will turn ON and OFF. Higher the values print on serial monitor, more number of LEDs turns on.

The serial monitor is not mandatory in this project, but can be a handy tool for testing purposes.

Prototype Image: 

Tested Prototype LED Air Pollution Meter Circuit with Arduino

How to test:

• Turn on the arduino and external power supply. LED test will begin and it runs only once.
• The program waits for 5 minutes for sensor to get heated up.
• Once the readings shows up on serial monitor bring a cigar lighter and leak the gas without flaming it.
• Soon, the readings go peak and more number of LEDs starts to glow.
• Once you stop flow gas on the sensor, gradually LEDs turns off. Now your LED air pollution meter is ready to serve you room.

Program Code:

//--------------Program developed by R.Girish---------------//
int input=A0;
int a=2;
int b=3;
int c=4;
int d=5;
int e=6;
int f=7;
int g=8;
int h=9;
int i=10;
int j=11;
int k=12;
int l=13;
int T=750;
unsigned long X = 1000L;
unsigned long Y = X * 60;
unsigned long Z = Y * 5;
void setup()
{
Serial.begin(9600);
Serial.println("Sensor is getting ready, please wait for 5 min.");
pinMode(a,OUTPUT);
pinMode(b,OUTPUT);
pinMode(c,OUTPUT);
pinMode(d,OUTPUT);
pinMode(e,OUTPUT);
pinMode(f,OUTPUT);
pinMode(g,OUTPUT);
pinMode(h,OUTPUT);
pinMode(i,OUTPUT);
pinMode(j,OUTPUT);
pinMode(k,OUTPUT);
pinMode(l,OUTPUT);
pinMode(a,HIGH);
delay(T);
digitalWrite(a,HIGH);
delay(T);
digitalWrite(b,HIGH);
delay(T);
digitalWrite(c,HIGH);
delay(T);
digitalWrite(d,HIGH);
delay(T);
digitalWrite(e,HIGH);
delay(T);
digitalWrite(f,HIGH);
delay(T);
digitalWrite(g,HIGH);
delay(T);
digitalWrite(h,HIGH);
delay(T);
digitalWrite(i,HIGH);
delay(T);
digitalWrite(j,HIGH);
delay(T);
digitalWrite(k,HIGH);
delay(T);
digitalWrite(l,HIGH);
delay(T);
delay(Z);
}
void loop()
{
Serial.println(analogRead(input));
if(analogRead(input)>=85) digitalWrite(a,1);
if(analogRead(input)>=170) digitalWrite(b,1);
if(analogRead(input)>=255) digitalWrite(c,1);
if(analogRead(input)>=340) digitalWrite(d,1);
if(analogRead(input)>=425) digitalWrite(e,1);
if(analogRead(input)>=510) digitalWrite(f,1);
if(analogRead(input)>=595) digitalWrite(g,1);
if(analogRead(input)>=680) digitalWrite(h,1);
if(analogRead(input)>=765) digitalWrite(i,1);
if(analogRead(input)>=850) digitalWrite(j,1);
if(analogRead(input)>=935) digitalWrite(k,1);
if(analogRead(input)>=1000) digitalWrite(l,1);
delay(1000);
if(analogRead(input)<=85) digitalWrite(a,0);
if(analogRead(input)<=170) digitalWrite(b,0);
if(analogRead(input)<=255) digitalWrite(c,0);
if(analogRead(input)<=340) digitalWrite(d,0);
if(analogRead(input)<=425) digitalWrite(e,0);
if(analogRead(input)<=510) digitalWrite(f,0);
if(analogRead(input)<=595) digitalWrite(g,0);
if(analogRead(input)<=680) digitalWrite(h,0);
if(analogRead(input)<=765) digitalWrite(i,0);
if(analogRead(input)<=850) digitalWrite(j,0);
if(analogRead(input)<=935) digitalWrite(k,0);
if(analogRead(input)<=1000) digitalWrite(l,0);
}
//--------------Program developed by R.Girish---------------//

You'll also like:

  • 1.  Wireless Servo Motor Control Using 2.4 GHz communication link
  • 2.  Types of Arduino Boards with Specifications
  • 3.  Ultrasonic Distance Meter Circuit Using 16×2 LCD
  • 4.  L298N DC Motor Driver Module Explained
  • 5.  How to Make a Simple Math Calculator using Arduino
  • 6.  Simple Digital Water Flow Meter Circuit using Arduino

Filed Under: Arduino Projects Tagged With: Arduino, LED, Meter, Pollution

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « LPG Leakage SMS Alert using MQ-135 – Get Warning Message in your Cellphone
Next Post: LM317 Variable Switch Mode Power Supply (SMPS) »

Reader Interactions

Comments

  1. luqmanul hakim says

    December 8, 2016 at 2:55 pm

    HELLO CAN I'VE THE CIRCUIT DIAGRAM PLS…

    Reply
  2. salim lakade says

    November 1, 2016 at 2:23 pm

    Enter your comment…it is fantastic mini project ,thank u sir……

    Reply
  3. kumarasiri bandara says

    October 12, 2016 at 3:20 am

    thanks

    Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

circuit simulator image

Subscribe to get New Circuits in your Email

Categories

  • Arduino Projects (89)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (83)
  • Datasheets and Components (106)
  • Electronics Theory (143)
  • Free Energy (37)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (14)
  • Inverter Circuits (88)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (28)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (102)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (40)
  • Water Controller (36)

Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • Recent Comments

    • Swagatam on Crystal Radio Sets with Amplifier Circuit
    • Swagatam on 9 Simple Sine Wave Generator Circuits Explored
    • Gazza on 9 Simple Sine Wave Generator Circuits Explored
    • Gazza on 9 Simple Sine Wave Generator Circuits Explored
    • Lion on Crystal Radio Sets with Amplifier Circuit

    © 2025 · Swagatam Innovations