Air quality control (CO2 and temperature) in the office and at home, with their own hands
It all started with the fact that I work in an office where, as usual, there is no normal ventilation. But there are a lot of people, someone is hot all the time, others are constantly blowing.
To control the quality of indoor air, knowing the temperature is not enough. Even with air conditioning it is often cool, but stuffy. Stale air. It turned out that this is most affected by the concentration of co2. When I found out the cost of ready-made appliances I wanted to give up this idea. But by chance I saw a description of an optical co2 concentration sensor MH-Z19.
The price of course is also not small, but still close to reasonable limits. And my hands itched for a long time on a soldering iron. As a controller, I decided to use ESP8266. Firstly it is cheap, and secondly, that would transfer information to a computer, one's own and anyone in the room. After I assembled and tested the first version, with a monitor program on my computer, I decided to add a screen. Firstly it is beautiful. Secondly, in many cases it is convenient. ')
The device is built on the module ESP8266 NodeMcu Lua wi-fi. For him, a program was written in the script language LUA. The firmware for the Lua interpreter for my device was generated on the on-line server nodemcu-build.com. I chose only those modules that I needed to create the project.
Then I took up the assembly of the device. Connected temperature sensors. ds18b20. They work on the 1-wire interface:
Then the actual carbon dioxide sensor MH-Z19. It can use two PWM and UART interfaces. I decided to try the PWM first, and as a result, I was satisfied with the reliability and accuracy of the readings.
And I connected the display via the ISP bus:
This program was written under Windows. On Delphi XE8:
The controller I use has a built-in WIFI module that sends the information received from the sensors as UDP broadcast packets throughout the office network. And users who have a monitor program receive information about the state of the air in the room and warnings if the situation becomes critical.
And now the actual impressions.
The device was much more useful and more interesting than I expected. First of all, there are no more problems with airing, no one is indignant, since everyone has a warning that pops up and they agree quite well with personal feelings. Well, just observations showed that on a sunny day the level of co2 is much lower than on cloudy and rainy, in the morning air pollution is higher than during the day. At first glance, you can understand what to do, to ventilate, if it goes off scale 2, or turn on the air conditioner, if the temperature is high. The temperature sensor on the street well shows whether it will turn out to be cooled by airing, or just an air conditioner. It became obvious and understandable what was happening in the room and how to live in it. There was a case when they decided to air, opened the window, and immediately closed it, the sensor literally went off scale, And the device turned out to be very useful at home, especially in the children's room, especially since you can monitor the readings remotely via WiFi.
As a result, it all looks something like this:
There are links to sources and all that is needed to repeat this construction.