
It is wonderful to live on the shore of a mountain lake, among virgin, nature. Breathe only clean air filled with the aroma of herbs. But few who do it. And in the metropolis, at home and in the office, you can achieve the highest possible air quality.
To do this, first of all you need to see and understand what surrounds us? What kind of air do we breathe? We have already become accustomed to thermometers, barometers, instruments showing humidity. But these devices do not tell us anything about the quality of the surrounding air. So we will listen to advice that is not always true, be guided by rumors, not knowing for sure whether we are doing the right thing.
')
One of these myths is that in cities there is disgusting air, dirty and poisonous. And instead of oxygen, solid exhaust from cars. We take it for granted and do not try to rectify the situation, even where we can do it, in our own home or office. Even those who have small children, or problems with allergies, put their efforts into the blind, not controlling the results.
There are many useful devices that allow us to increase the quality of the air in our house - humidifiers, ionizers, air washers, intake ventilation and filters.
But this is not enough. You need a device that you can directly measure the air quality in your home. What would you understand and understand what you breathe. As the temperature on the thermometer.
What can give such a device?
Many people think that in the city, the air is dirty on the street, where there are cars and factories. And the air in the room is cleaner. But this is not at all the case. It is enough to measure. A person exhales 100 times more CO2 than he inhales. And in a hermetically sealed room, especially if there are several people present, the air becomes suffocating very quickly. The house has a lot of furniture and finishing materials that emit toxic substances. The apartment quickly accumulates dust, which can cause serious harm to your health. Indoor air is 4-8 times dirtier than outside, and 8-10 times more toxic. And you can measure it and see if you have the appropriate devices. And to understand how often you should air the room, in any weather.
One of the serious air pollutants is dust. A carrier of infections, a favorite environment for saprophyte ticks and a serious allergen - dust pollutes the air most.
In the house where there are allergies, it is recommended to take radical measures: change curtains and drapes to the blinds, remove carpets, books, decorative textiles and plush toys. And even upholstered furniture to change to analogues in leather upholstery. Books, souvenirs, every little thing - to store under glass. And of course it is important to know that your efforts are not in vain and the amount of dust in the house is minimal. And this can also be measured and seen.
The danger is fraught with home furnishings, furniture, varnishes, paints, chipboard, MDF, some plastics can release phenols, formaldehydes, etc. It does not matter what the price of furniture made of chipboard - all the same, the compounds harmful to the body will "fly" into the air.
But even with this disaster, you can effectively deal with it, including airing the room. Just need to see the enemy in the face. Measure and control.
Actually, what I propose is a device for quality control, the main parameters of the ambient air. which I did for myself. And I share with you his design. The device is available for self-assembly, anyone who knows how to hold a soldering iron in his hand.
In the continuation and development of the past theme of the
CO2 sensor, I improved the device and bring to your attention a new version, now integrated air quality monitoring.
2 more sensors were added to the device. PMS5003 dust sensor and formaldehyde sensor ZE08-CH20. Also, the device got a DS3231 watch and learned how to make MP3-TF-16P sounds. Were thrown out the temperature and humidity sensor. They were of little use. Due to the fact that the filling heats up the readings of these sensors were very different from reality.
The basis of the device, as before, is the controller ESP8266 dev kit 1 and the CO2 sensor MH-Z19. Just as in the first version of the device, the sensor is connected via PWM. An analog switch 74HC4052 was used to connect the rest of the sensors, the screen (it all hangs on one contact) and the module that makes the sounds. The controller is connected in series to the formaldehyde and dust sensor. After that, it switches to the screen and displays information. If it is necessary to sound, the controller switches the switch to the sound module.
Sensors of dust, formaldehyde and sound module communicate with the controller via UART. At the time of polling sensors, or playing sounds, the UART controller switches to alternative contacts and at that moment USB communication with the computer is impossible.
In this model, I used a large 2.8 ”screen with a resolution of 240x320 pixels. With SPI interface based on ILI9341 controller.
There is no control other than the power button on the device. Just plug into the outlet (the device has a 5v power supply built-in) and you can monitor the readings.

The following information is displayed on the screen: In the upper left corner is a clock with a date and a month. On the right of the clock, the formaldehyde sensor reads in µg / mᶟ. The next row is the dust sensor reading. There are 3 values. The first dust is less than 1 micron in diameter, the particles are farther than 2.5 microns and the particles to the right are up to 10 microns. Values ​​are displayed in µg / mᶟ. Under the dust sensor readings a line of small numbers is displayed. This is for the most inquisitive, it lists the values ​​of the dust particles of different fractions. The data are given - the number of particles per 1 liter of air.
Below is a graph of measurements of CO2 content in air, approximately in the last half hour.
At the very bottom, the current value of CO2 concentration in ppm. On the right there is a traffic light indicating a hazard or the safety of a given concentration of CO2. The green signal indicates that the concentration is less than 900 ppm and good air quality, yellow is about a stuffy atmosphere and concentrations from 900 to 1500 ppm. The red signal indicates that the concentration of carbon dioxide is above 1500ppm and it is dangerous for health and badly affects the state of health.
When the level of CO2 concentration reaches 900ppm, sneezing is heard from the device. If the level rises above 1500ppm, the device “coughs”.
On the front side of the device there is a sticker on which are described what parameters of the device what they mean and what are normal, high and dangerous concentrations of gases and dust.
Sensors:

CO2 Sensor MH-Z19 - A non-dispersive infrared sensor (or NDIR sensor) is a simple spectroscopic sensor used as a carbon dioxide detector. The measurement limit is up to 5000ppm and the lower limit is about 400ppm (natural CO2 level in the atmosphere). Passport accuracy 50ppm. The response time is about 30 seconds. When power is applied, the first minute and a half gives the maximum or minimum readings, then it turns on and outputs real data. Information from the sensor is obtained by PWM. At the time of reading, the controller measures the duty cycle of the signal at the sensor output and converts it into the CO2 level by the formula.

Sensor dust PMS5003. NDIR dust sensor measuring dust concentration divided into 3 fractions of 1, 2.5 and 10 microns separately. It also has a dust particle counter divided into 6 fractions. Accuracy declared 10%. The sensor is used in active mode. This means that he automatically automatically sends information to the UART at set intervals. When it is necessary to obtain information from the sensor, the controller connects to it by means of a switch and waits for the next data transmission.

Formaldehyde sensor ZE08-CH2O Thermally stabilized electrochemical sensor. This sensor is also used in active mode. He independently, every second sends data to the UART and when the controller switches the switch to it, the data is read.

To extract various sounds and sound alarms about the condition of the air, a miniature UART-controlled MP3 player - MP3-TF-16P is used. This board has on board a micro SD card reader, on which sound files are recorded in mp3 format. There is also a power amplifier and a speaker on the 8th can be connected. Selection and playback of files recorded on the sd card is controlled by UART from the device controller. The program has built-in protection against alerts at night. After 10:00 pm and before 8:00 am no beep sounds.
To display the time and date, the DS3231 clock module is used, which operates according to the I2C protocol. The stated accuracy is 2 minutes per year.
An analog switch 74HC4052 is used to switch the ESP8266 main controller between sensors, a screen and a sound module. This is a dual switch with 4 lines. ESP8266 uses D9, D10 pins for UART, but we cannot use these pins, since they are connected to the USB adapter built on the controller board. Fortunately, it is possible to switch the UART outputs to alternative contacts D7, D8. But these same contacts are used by the ISP bus through which the controller is connected to the display. In order to deal with this zoo and use the switch. It has 2 inputs and 4 outputs. At one point, each input can be connected to one of 4 outputs. A sensor, or display, or sound module is connected to each output. According to the control pins, the controller selects which device to connect to at the moment. When displayed, the controller connects to the display, when reading data to the sensor, and when playing sounds to the mp3 player.
The device also uses a fan that blows the closed case with air so that the sensors respond adequately to changes in the atmosphere around the device. The speed of the fan is controlled by the controller, as if the fan does not reduce it is too much buzzing.
The total cycle of polling sensors and displaying information is 5 seconds.
Device layout:

Circuit board:


→
Firmware file→
Script file:→
Here is a step by step guide how to assemble the device→
Here is the firmware manual