• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos 

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:

caution electricity can be dangerous

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.  How to Control Servo Motor Using Joystick
  • 2.  Digital Clock Circuit Using 16×2 LCD Display
  • 3.  How to Interface 4×4 Keypad with Arduino
  • 4.  Mp3 Player Using DF Player – Full Design Details
  • 5.  Make this Home Security Project Using Arduino – Tested and Working
  • 6.  Electronic Voting Machine with SD Card Module

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!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

3 Comments
Newest
Oldest
Inline Feedbacks
View all comments


Primary Sidebar

Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (26)
  • 555 IC Circuits (99)
  • 741 IC Circuits (20)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (118)
  • Battery Chargers (83)
  • Car and Motorcycle (96)
  • Datasheets (77)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (101)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (120)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (14)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (30)
  • Home Electrical Circuits (106)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (95)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (67)
  • Mini Projects (152)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (25)
  • PIR (Passive Infrared) (8)
  • Power Electronics (35)
  • Power Supply Circuits (81)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (64)
  • Sensors and Detectors (127)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (62)
  • Timer and Delay Relay (54)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (41)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

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

© 2023 · Swagatam Innovations

wpDiscuz