In this article, we will learn how to build your own air Arduino purifier and AQI sensor to stay safe and healthy when the Air Quality Index outside is less than acceptable.
For those of you that are not from tropical countries, near the equator there are normally only two seasons (although this varies from region to region).
These seasons are the dry and rainy season. At the peak of the dry season is very hot and never rains, while at the peak of the rainy season it rains almost every day. This two extreme polarities cause either draughts and fires or floods and sad cloudy days.
In the north of Thailand, the dry season is particularly bad. Not because is hotter and it does not
The result of forests burning everywhere plus the normal amount of pollution from vehicles and coal power plants is a thick layer of haze that is very unhealthy and even hazardous for any breathing creature.
The cause of these fires
During this time of the year, farmers burn whatever was leftover from the previous crops (dry stems from corn plantations for example) on a massive scale. Apart from this, leaving rubbish around such as glass bottles and aluminium cans, can easily start a fire by reflecting the sun into a dry leaf.
This year (2019) has been particularly bad as pollution levels have reached an all time record high.
So far, the city of Chiang Mai has experienced AQI levels over 200 which is classified as very unhealthy for nearly a month, with some days even peaking to 500.
Fortunately, makers, engineers and inventors have come with cheap and readily available solutions to tackle the problem from a bottom up approach.
In this article, I have used knowledge and ideas from the Chiang Mai community. I do not claim to have invented the following devices, I am simply putting together what I have seen other makers have done in Chiang Mai to help people fight the air pollution indoors.
A particular thanks to Chiang Mai Makerclub is very well in order! Those guys are geniuses and have pioneered
Very well, let’s get to building!
Arduino Air Purifier (DIY)
The purpose of the air purifier is to suck dirty air, filter it, and then expel it cleaner than before.
For this project, the cylindrical shaped filter from the Xiaomi air purifiers was selected.
There are quite a few options to select from Amazon, eBay or Lazada with varying prices.
Cost = 930THB
We need a fan with similar diameter as the filter and enough power to be able to suck air in and pass it through the filter.
Any AC fan with at least 40W of power and 6x6inch should do the job. If the fan does not says the output power look for voltage and current figures. It might say 220VAC/0.2A which is then 220*0.2 = 44W.
This component can be bought in your local electrical shop or in Amazon
Cost = 420THB
Air direction add-on
This part is not essential but will make the device work better. By directioning the air to the top and controlling the air dispersion, we help the device to filter other air mass instead of the same.
If you wish to manufacture this part, you can download the CAD file from here. (link pending)
You will also have to buy some acrylic and have access to a CNC machine.
Cost = 160THB
Total cost of air purifer (approx) = 1600THB
Fan AC mains connection
Components: Plug header, AC wire, screw terminal (can be all bought at your local electrical shop).
Required tools: cable cutter, screw driver.
- Peel wire ends
- Screw wires to header
- Screw the other end of wires to the screw terminal
- Screw fan wires to
Once you have made the AC wiring connection, plug your fan to check if it works and write down the airflow direction.
Using a hot glue gun, glue the fan to the top of the filter and the air direction add-on to the top of the fan. Make sure the fan is the right way around so the air is coming out at the top.
There you go! An Arduino air purifier (DIY) Ready to clean air!
The main function of the AQI sensor is to sense PM2.5 and display it on a screen.
PMS7003 AQI sensor module
The PMS7003 is a kind of digital and universal particle concentration sensor, which can be used to obtain the number of suspended particles in the air, i.e. the concentration of particles, and output them in the form of digital interface.
You can buy the PMS7003 on Amazon , eBay or in Lazada.
Cost = 670 THB
Arduino UNO rev3
The Arduino is a microcontroller development board that acts as the “brain of the device”. It takes the information from the sensor, processes it and then sends it to the display.
The Arduino UNO rev3 can be purchased from many shops. Here is the Amazon and eBay link.
Cost = 220THB
1602A LCD display
This small screen has just enough space to display the required information.
Here is the link for Amazon and eBay. You can get it from many more shops, make sure it comes with the I2C interface board attached to it.
Cost = 120THB
Total cost of AQI sensor (no delivery fees added) = 1010THB
Hooking up the electronics
Connect the PMS7003 to the Arduino
Insert the expansion board that came with the PMS7003 in the module’s connector
Using a female to male mod wire make the following connections (this can be bought in the shops mentioned before or you can find some laying around at Makerclub) :
Connect the display to the Arduino
Using a female to male mod wire make the following connections from the display adapter board to the Arduino (this can be bought in the shops mentioned before or you can find some laying around at Makerclub) :
Power the Arduino
Using the USB cable that came with the Arduino, connect it to either your computer, phone charger or
After connecting the Arduino to the power source you should see some LEDs light up in the Arduino, the screen on and the mini fan on the PMS7003 spinning.
Programming the Arduino
- Download and install
- Download the source code.
- Open the file (source code) with Arduino IDE.
- Install the PMS Library
- Go into Tools>Manage Libraries> type “PMS” on the search and install PMS Library.
- Install the display library
- Go into Tools>Manage Libraries> type “LiquidCrystal_I2C” on the search and install the LiquidCrystal I2C by Frank de Brabander.
- Connect the Arduino to your computer using the USB cable.
- Disconnect the TX/RX cables from the Arduino.
- Click the Upload button (arrow below Edit). You should see the black window below saying that the Arduino was successfully programmed after a few seconds.
- Reconnect the TX/RX cables and press the reset button on the Arduino (only button next to the USB connector).
- The device should start displaying the PM2.5 concentration straight away.
- If the screen is blue and not displaying anything, try turning the potentiometer
(small blue box) either clockwise or counterclockwise on the display expansion board.
Testing and Validation of the AQI combo
The quickest way to test the accuracy of the measurements of the AQI sensor is by comparing its results to a commercial model.
Ideally, this comparison would be done for at least the 5 different AQI level categories.
This first comparison has been made is against another DIY sensor from the Makerclub:
As you can see from the photo, both sensors display the same value.
The second comparison was against the average PM2.5 concentration level in Chiang Mai displayed by AirVisual. These network of sensors is assumed to be made of commercial models. My sensor was placed outside in the balcony.
Note: this post will be updated once I have access to a commercial AQI sensor and have tried it in different pollution levels.
Arduino Air purifier (DIY)
The initial test consisted in running the Arduino air purifier for an hour a measuring how much the PM2.5 concentration changed.
The PM2.5 concentration dropped from 40 to 5 from running the purifier for one hour. This was done indoors in a 30m2 room and with an outdoors AQI of 89.