Software apps and online services
M5Xmas Air Monitor#25projectsofchristmas challenge
Xmas 2021 came early, It's time to be happy all togheter with friends or parents, at home or in a cottage, but, remember anti-Covid rules, change frequently air in room to avoid risk!!!
For this project we can use an M5Stack Tvoc/eCO2 unit based on the SGP30 sensor by sensirion
The idea start thanks a fork of Lemariva's uPyCO2 work, has the code that helps you to build DIY TVOC and eCO2 measuring devices for M5Stack Cores and, later, via MQTT towards Openhab, Node-red, Home Assistnt and similar framework.
The measurements can be an aid for Covid-19 prevention. The idea is that if there is a lot of exhaled CO2 in the air, there are also a lot of aerosols in the air. These smallest particles, to which Sars-CoV-2 viruses from the respiratory tract attach themselves, can float in the room air and can spread over several meters. A high concentration of aerosols increases the risk for everyone else in the room to become infected.VOC and TVOC
“VOCs” stands for “volatile organic compounds”, which originate from new products and building materials, such as new carpet and furniture, paints and solvents, and cleaning agents.
According to Sensirion, total VOC (or TVOC used by SGP30) “refers to the total concentration of VOCs present simultaneously in the air”; it’s a quick and cost-effective way to assess indoor air quality. The image below provides some TVOC levels and some recomendation
CO2 effect and risk of Covid-19
Tracking carbon dioxide levels indoors is an inexpensive and powerful way to monitor the risk of people getting COVID-19, according to new research. In any given indoor environment, when excess carbon dioxide levels double, the risk of transmission also roughly doubles, scientists report.
Below a graphic also to indicate effect on wellness and behaviour of people related to carbon dioxide concentration
To use this project you have simply to copy sgp30.py on /flash of M5stack and M5XmasAir.py on /flash/apps optionally you could load the image scholar4.jpg (or whatever image you prefer <50Kbytes on /flash/res)
Thonny IDE is recommended for this purposeThe code in brief
All code has been written in micropython, using the Lemariva's SGP30 lib, included at /flash level, so is more simple to import modules not present into the M5Stack firmware.
Once perform the i2c initialization of sgp30 start a loop (while True) to read Co2 and Tvoc, after that values are printed for debugging and displayed on the screen of M5 core.
To achieve maximum precision, Sgp30 need a stabilization time, (about 12 hours) the code write every time two files co2eq_baseline.txt and tvoc_baseline.txt to speed up reliability after the first run
So enjoy it and wish you a merry XMas2021!