Circuit and working
Circuit diagram of the air quality meter is shown in Fig. 2. Heart of the circuit is ATmega328P (IC3). Other components used are voltage regulators 7805 (IC1 and IC2), 16×2 LCD display (LCD1), temperature and humidity module DHT11 (connected to CON4), gas sensor MQ135 (connected to CON3), PM2.5/PM10 sensor (connected to CON2) and a few others.
It can be programmed with embedded software using a standard programmer or Arduino IDE. ATmega328P offers 23 input/output functional ports, and a 16MHz crystal oscillator is used to provide timing/clock reference.
Temperature and humidity module (DHT11)
This composite sensor contains a calibrated digital signal output of temperature and humidity. The sensor (connected to CON4) includes a resistive-type humidity measurement component and an NTC temperature-measurement device. Its output pin is connected to pin 12 of IC3.
Serial real-time clock (RTC) IC (DS1307)
It is a low-power, full binary-coded decimal (BCD) clock/calendar with 56 bytes of NV SRAM. Addresses and data are transferred serially through an I2C, bi-directional bus. The clock/calendar provides information about seconds, minutes, hours, days, dates, months and years. SCL and SDA pins of IC4 are connected toSCL (pin 28) and SDA (pin 27) pins of IC3, respectively.
Air quality sensor (MQ135)
The sensitive material of the sensor is tin-dioxide (SnO2), whose conductivity increases with concentration of gas. Change in conductivity is converted into output voltage signal, which varies corresponding to the concentration of the combustible gas. MQ135 is highly sensitive to ammonia, sulphide and benzene steam, smoke and other harmful gases. It is a low-cost sensor, suitable for different applications. Output of the gas sensor (CON3) is connected to analogue input pin 25 of IC3.
PM2.5/PM10 sensor (SDS011)
SDS011 is an air-quality sensor developed by Inovafit, a spin-off from University of Jinan (Shandong). Because of its size, it is probably one of the best sensors in terms of accuracy. While other sensors tend to focus on shrinking the sensor size, SDS011 has opted for a size tradeoff, allowing it to be used as a larger fan—larger the fan, better the quality.
SDS011 uses the principle of laser scattering in the air, which can be obtained from 0.3 microns to 10 microns suspended particulate matter concentration. Data is stable and reliable, and there is a built-in fan, digital output and a high degree of integration. UART port of SDS011 (CON2) is connected with IC3 UART port.
12V power/battery supply (CON1) is regulated to 5V using IC1 and IC2 and applied to the circuit. When the system is powered on, the device takes one minute to preheat the gas sensor before it is ready for operation. LCD1 displays proximate values of the four sensors connected to IC3. All these parameters are displayed on LCD1 at an interval of one second.
The software is written in Arduino programming language. ATmega328P is programmed using Arduino IDE software. ATmega328P comes with a bootloader that allows to upload a new code to it without the use of an external hardware programmer. Select the correct board from ToolsBoard menu in Arduino IDE and burn the program (sketch) through the standard USB port in the computer.
Various operations are implemented in the code as follows:
RTC library is easy to use and can get the date, time and day of the week accurately.
DHT.temperature and DHT.humidity read temperature and humidity, respectively.
PM_CAL() function calibrates PM2.5/PM10 value.
The arrangement given below gives a rough approximation of the parts per million (ppm) levels of gas or pollutants. These values are calculated as:
Download source code: click here
Air Quality meter construction
A single side PCB for the air quality meter is shown in Fig. 3 and its component layout in Fig. 4. Suitable connectors are provided on the PCB for input and output.
Download PCB and Component layouts: click here
Assemble the circuit on the PCB to minimise errors. Carefully assemble the components and double-check for overlooked errors. Connect the power supply through 12V DC jack/battery and provide power supply to the circuit by connecting its Vcc and GND to CON1 on the PCB.
To test the circuit for proper functioning, check the power supply at TP1 and TP2 with respect to GND and ensure it is 5V.
All the mentioned parameters (PM2.5/PM10, temperature/humidity, ppm and time/date) are displayed on LCD1 at an interval of one second. In case the text is not visible on LCD1, adjust the potentiometer (VR1) connected with LCD1.
You may use cigarette smoke as polluted air for testing. PM value can reach up to 999 within five seconds when smoke is generated. The ppm value increases with smoke density, and temperature and humidity change as per the environment.
Biswajit Das was manager – R&D, EFY Labs till recently