• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

  • 1000+ Circuits
  • Privacy Policy
  • About Us
  • Contact
  • Disclaimer
  • Videos – Circuit Test Results
You are here: Home / Arduino Engineering Projects / How to Make LED Air Pollution Meter Circuit with Arduino

How to Make LED Air Pollution Meter Circuit with Arduino

Last Updated on July 23, 2019 by Swagatam

In this project we are going 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.

 

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---------------//




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

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

You'll also like:

  • 1.  Blinking an LED with Delay – Arduino Basics
  • 2.  Color Detector Circuit with Arduino Code
  • 3.  High Current Motor Control Circuit using Arduino
  • 4.  How to Interface Servo motors with Arduino
  • 5.  Converting Analogue to Digital (Analogue Read Serial) – Arduino Basics
  • 6.  Make this Simple Weather Station Project for Homes and Offices

Please Subscribe (Only if you are Genuinely Interested in our Newsletters)


 

Reader Interactions

Comments

  1. Search Related Posts for Commenting

  2. luqmanul hakim says

    HELLO CAN I'VE THE CIRCUIT DIAGRAM PLS…

  3. salim lakade says

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

  4. kumarasiri bandara says

    thanks



  5. COMMENT BOX IS MOVED AT THE TOP


Primary Sidebar

Electronic Projects Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (51)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (92)
  • 741 IC Circuits (18)
  • Amplifiers (49)
  • Arduino Engineering Projects (82)
  • Audio Projects (83)
  • Battery Chargers (75)
  • Car and Motorcycle (87)
  • Datasheets (44)
  • Decorative Lighting (Diwali, Christmas) (31)
  • DIY LED Projects (81)
  • Electronic Components (96)
  • Electronic Devices and Circuit Theory (34)
  • Electronics Tutorial (99)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Games (2)
  • GSM Projects (9)
  • Health Related (17)
  • Heater Controllers (23)
  • Home Electrical Circuits (98)
  • Incubator Related (6)
  • Industrial Electronics (25)
  • Infrared (IR) (39)
  • Inverter Circuits (94)
  • Laser Projects (10)
  • LM317/LM338 (21)
  • LM3915 IC (24)
  • Meters and Testers (52)
  • Mini Projects (152)
  • Motor Controller (64)
  • MPPT (7)
  • Oscillator Circuits (12)
  • PIR (Passive Infrared) (8)
  • Power Electronics (32)
  • Power Supply Circuits (64)
  • Radio Circuits (9)
  • Remote Control (46)
  • Security and Alarm (55)
  • Sensors and Detectors (115)
  • SG3525 IC (4)
  • Simple Circuits (72)
  • SMPS (30)
  • Solar Controllers (60)
  • Timer and Delay Relay (51)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (36)
  • Ultrasonic Projects (12)
  • Water Level Controller (45)

Follow Homemade Circuits

Facebook
Twitter
YouTube
Instagram
My Facebook-Page
Quora

Feeds

Post RSS
Comment RSS

Circuit Calculators

  • AWG to Millimeter Converter
  • 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
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2021 · Swagatam Innovations

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok