A project called an Arduino-based air quality monitoring circuit is made to detect and examine many types of air pollutants, including carbon dioxide CO2, volatile organic compounds VOCs and particle matter PM.
This circuit often uses an Arduino microcontroller as its central processing unit together with a variety of sensors to monitor various aspects of air quality.
After reading and processing the sensor data, the Arduino may send the information to a computer or cloud service for further processing or show the results on an LCD.
Because of its versatility, cost and ease of use, this configuration is well liked for do-it-yourself projects and environmental monitoring applications.
The system utilizes an Arduino microcontroller, an MQ135 gas sensor, a DHT11 temperature and humidity sensor, and an OLED display.
Coding with Explanation:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define DHT11_PIN 2
#define MQ135_PIN A0
#define OLED_ADDRESS 0x3C
Adafruit_SSD1306 display(128, 64);
void setup() {
Serial.begin(9600);
display.begin(SSD1306_128_64);
display.clearDisplay();
display.display();
}
void loop() {
// Read gas sensor data
int gasSensorValue = analogRead(MQ135_PIN);
float gasConcentration = map(gasSensorValue, 0, 1023, 0, 1000);
// Read temperature and humidity data
float temperature, humidity;
dht11.read(temperature, humidity);
// Display the results on the OLED
display.clearDisplay();
display.setCursor(0, 0);
display.print("Gas Concentration:");
display.print(gasConcentration);
display.println(" ppm");
display.print("Temperature:");
display.print(temperature);
display.println(" °C");
display.print("Humidity:");
display.print(humidity);
display.println(" %");
display.display();
delay(1000);
}
Explanation:
- The Adafruit_GFX, Adafruit_SSD1306, and Wire libraries are included in the code.
- These are needed for OLED display control and I2C connection.
- The pin connections and I2C address of the corresponding components are specified by the declared constants DHT11_PIN, MQ135_PIN and OLED_ADDRESS.
- The OLED display is configured, cleared and serial connectivity is initiated in the setup() method.
- The gas sensor value is received from the analog input pin and transferred to a concentration range in the loop() method.
- The DHT11 sensor is used to read the temperature and humidity levels.
The OLED display shows the temperature, humidity and gas concentration measurements. - To accommodate for sensor readings and display updates, a 1000 millisecond (1 second) delay is included.
Circuit Working:
Parts List:
Component | Quantity |
---|---|
Arduino UNO board | 1 |
IC 7809 (Voltage Regulator) | 1 |
MQ135 gas sensor (for detecting various gases) | 1 |
DHT11 (Temperature and Humidity Sensor) | 1 |
OLED display (for visual output) | 1 |
A 5V DC power source powers the Arduino board as well as every other component.
A voltage regulator called the IC 7809 converts a greater input voltage into a steady 9V output voltage.
This is very helpful for circuits that need a controlled power source that is always there, especially when the input voltage is erratic.
Although the Arduino board normally outputs 5V, there may be situations in which the gas sensor or other parts need a greater voltage.
These components may be supplied with a consistent 9V supply via the IC 7809, guaranteeing excellent operation.
An analog input pin on the Arduino is linked to the MQ135 gas sensor.
The quantity of gases in the surrounding air affects the resistance of the sensor.
The DHT11 sensor is attached to the Arduinos digital input port.
It provides the Arduino with data on temperature and humidity in a certain format.
The OLED display is linked to the Arduinos I2C ports.
Temperature, humidity and gas concentration measurements are displayed.
How to Build:
To build a Arduino Based Air Quality Monitoring Circuit you need to follow the below mentioned steps for connections:
- Gather all the components as mentioned in the above circuit diagram.
- Connect a regulated IC1 7809 to provide a regulated 9V DC to the Arduino board
- Connect VCC pin of DTH11 to the 5V pin on Arduino board.
- Connect GND pin of DTH11 to the GND pin on Arduino board.
- Connect DATA pin of DTH11 to pin 2 on Arduino board.
- Connect MQ135 Gas Sensor Vcc pin to the 5V pin on Arduino board.
- Connect MQ135 Gas Sensor GND pin to the GND pin on Arduino board.
- The
Dout
pin of the MQ135 gas sensor is typically not connected in any applications. - Connect MQ135 Gas Sensor Aout pin to the A0 pin on Arduino board.
- Connect the VCC pin of the OLED display to the 5V pin on your Arduino board.
- Connect the GND pin of the OLED display to the GND pin on your Arduino board.
- Connect the SCL pin of the OLED display to the SCL pin A5 on your Arduino board.
- Connect the SDA pin of the OLED display to the SDA pin A4 on your Arduino board.
Conclusion:
To conclude, this project shows how to monitor air quality with easily accessible components in a simple and efficient manner.
Different gasses may be detected by the system, and it can be configured to show more information when necessary.
This systems mobility and inexpensive cost make it ideal for a range of uses, such as industrial process control, environmental monitoring and residential monitoring.
References:
Development of Arduino Based Air Quality Monitoring Systems for Measuring Gas Sensor
Leave a Reply