More and More concern are being paid to the environmental air quality nowadays because the tiny granule in the around air can badly endanger people’s health. We always get the information of environment from our government department. But it’s the average value of the whole city / section. It can’t reflect the situation near by you accurately.
Is DIYing a device that can monitor the environmental air quality condition at any time a problem for you? Actually, it’s not a tough job. Here, on the desk, I just DIYed a device which can help us to get the informant about the air pollution in the room.
This device can detect the concentration of the following ingredients of air in the room:
In order to make this process faster and simpler, I choose to use Seeedstudio’s Grove modules and the skeleton box as a shell.
You see, it’s all made by yourself.
You can make your copy via the following steps.
Here are the modules we need:
Now, Connect the sensor, display and other modules to Arduino.
First of all, we need to insert the base shield to Arduino board. Then, insert the grove modules/sensors to the Base shield in the following order:
Grove – OLED Display ---- I2C port
Grove - Dust Sensor ---- Digital 8
Grove - Gas Sensor(MQ9) ---- A0/A1 port
Grove – HCHO Sensor ---- A3/A4 port
And then assemble the LiPo Rider Pro and battery to the acrylic panel of skeleton box. This acrylic panel is not the standard panel shipped with skeleton box. I just found an advertisement design studio and cut one out there. It’s easy and not expensive.
Now, we need to upload the program to drive hardware. In fact, these sensors are not so convenient to use. Fortunately, Seeed have provided demo code or library of each sensor for us. It costs me 1 more hour to complete this programming. You can download the code right here(Github). More details about this program will be discussed later in this article.
So now you get the code from github. Unzip the “Air_Quality_Test_Box-master.zip”, you get a folder named Air_Quality_Test_Box-master including files:
Rename the folder “Air_Quality_Test_Box-master” to “Air_monitor” and copy into the sketchbook directory of Arduino IDE assuming you already installed.
How do I know where the sketchbook directory is? Please open the preferences of Arduino IDE, the answer shows up.
Close and re-open the Arduino IDE if it’s opened. Navigate to the Air_monitor sketchbook.
Select the board type. Seeeduino shares the same board type with Arduino Duemilanove w/ Atmega328. If you use other Arduino board, please select the correct board type.
Then connect the board to your pc with a mini USB cable. Select the right serial port with this path: “Tools – Serial Port”.
Now click the “upload” button. After some text scrolling up, “Done uploading” will show up at the status bar of Arduino IDE if everything’s right.
The OLED display will light up and display the readings of sensor.
Connect the board to the output port of the LiPo Rider Pro with a short mini USB cable.
Then put them into a box that you like. Of course, you can also make one by yourself. But, if you think it’s a troublesome to make by yourself or you haven’t found the suitable material, you can use any box that you like. It’s all up to you. Definitely, a paper box is ok.
Now, all components are packed into the skeleton box. Turn on the LiPo Rider. The OLED display should show message about the air quality.
I put it on my desk. It’s cool!
Let’s look through the software design. It’s all pointed out with one picture.
You need an image with the size of 128x64, then use the converter software to produce the C array. One of the converter software is like LCD Assistant mentioned at http://en.radzio.dxp.pl/bitmap_converter/. Then replace the “SeeedLogo” array in the source code.
The following functions can be used to display things at the OLED display.
This function moves the pointer at the display. You need call this function before any other display call except that you want to append the text after the last position.
Just like the function name, display the string onto the OLED screen.
These 3 functions display number value onto the screen. The parameter “decimal” of the 3rd function indicates how many digits will be displayed in the fraction part.
This function draws a bitmap picture. The parameter “bytes” equals rows * columns /8.
Yeah, this’s what I want to improve too. I’m going to make some upgrading of this box some time later. We can use a wifi shield or an ethernet shield to connect to the internet. We can upload the sensor data to one of the cloud platforms so that we can know the air quality of some place when we’re far away. We can also view the run chart of the air quality for a long time for which we can’t stare the screen.
Welcome talk here and join me.