• 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:

Air2Bpollution2Bmeter 1

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
P 20161009 013013 1

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.  Color Detector Circuit with Arduino Code
  • 2.  Types of Arduino Boards with Specifications
  • 3.  Make this 7 Segment Digital Clock with Beep Alert Circuit
  • 4.  Make this Home Security Project Using Arduino – Tested and Working
  • 5.  Digital Clock Circuit Using 16×2 LCD Display
  • 6.  How to Make TDCS Brain stimulator Circuit

About Swagatam

I am an electronics engineer with over 15 years of hands-on experience. I am passionate about inventing, designing electronic circuits and PCBs, and helping hobbyists bring their projects to life. That is why I founded homemade-circuits.com, a website where I share innovative circuit ideas and tutorials. Have a circuit related question? Leave a comment.... I guarantee a reply!

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

Subscribe to New Circuit Ideas

Categories

  • Arduino Projects (87)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (83)
  • Datasheets and Components (104)
  • 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 (87)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (27)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (101)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (37)
  • Water Controller (36)

Calculators

  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator
  • Filter Capacitor Calculator
  • Buck Converter Calculator
  • Boost Converter Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Wire Current Calculator
  • SMPS Transformer Calculator
  • IC SG3525, SG3524 Calculator
  • Inverter LC Filter Calculator

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 |

Recent Comments

  • Swagatam on Battery Deep Discharge Protection Circuit
  • Swagatam on 10 LED Tachometer Circuit Diagram
  • Drew Adare on How to Collect Free Energy from Atmosphere
  • Göran on 10 LED Tachometer Circuit Diagram
  • Abdulmajid Haruna on Laptop Power Bank Circuit

Company

  • Privacy Policy
  • Cookie Policy
  • About Me
  • Contact
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • © 2025 · Swagatam Innovations