Making An Indoor Air Quality Monitor With A DFRobot CO2 Sensor

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today we're going to be making an indoor air quality monitor using an infrared co2 sensor from df robot carbon dioxide or co2 is a colorless and odorless gas that is a by-product of combustion produced by gas heaters and stoves and also by metabolic processes in humans and animals it typically exists in concentrations of around 300 to 400 ppm outdoors but when the average adult exhales they can produce a concentration almost 100 times greater than this so with poor ventilation the co2 concentration in an indoor space can build up quite quickly early signs of increased concentrations of co2 include the inability to concentrate and tiredness while high concentrations of co2 can lead to headaches and dizziness and even difficulty breathing and eventually loss of consciousness ideally we'd like to keep the concentration of co2 in an indoor environment below 1000 ppm anything above this starts to lead to drowsiness and impaired concentration and the upper limit for what is considered to be safe is 5000 ppm so that's actually the upper limit for our infrared co2 sensor our co2 sensor uses infrared light to measure the concentration of co2 within the air and then produces a 0 to 2 volt analog signal which we're going to read using a df robot fire beetle board which is an esp32 based microcontroller i'm going to be sending the measured data to prometheus which is an online time series database and i'll then be creating a dashboard to view the data in grafana i also want to include some local indication which i'm going to do on an itc oled display finally since i've already got a microcontroller and display it'll be good to measure some other environmental metrics as well so i'm going to also include a bme280 temperature pressure and humidity sensor my goal is to build these all into a single desktop or wall mountable device but i can power using a usb outlet and move around the house if i want to i quite like the futuristic look of the co2 sensor so i'm going to make the front cover of the housing clear so that we can see into it and see the microcontroller display and sensors i designed the case in fusion 360 using a simple layout with standoffs to mount each of the four components along with a clear acrylic cover i also added some ventilation holes in the top and a cutout for the usb cable on the side i then 3d printed the case in black pla it's just a single piece and i didn't need to add any supports as the cutouts are relatively small and are rounded at the corners i then laser cut the front cover from two millimeter clear acrylic before i install the components into the case i'm going to make up a wiring harness to connect them all together the display and the bme 280 sensor both use the rtc interface to send and receive data and the co2 sensor just needs a power supply and then a connection to one of the analog inputs i'm going to use analog input a4 as this is closest to the rtc pins so it just makes the wiring neater with the wiring done we can start installing the components into the case i'm going to use my soldering iron to melt some brass inserts into the back cover so the screws that hold the clear front cover are more durable i'm going to use a range of screws to hold the boards in place with the wiring running below them as far as possible with all that done we can now close up the case and move on to programming our fire beetle board i've written up arduino sketch that takes readings from each of the sensors every minute and updates the display as well as uploads the data to prometheus there's a bit of setup involved in the code as you'll need to set up your wifi details as well as your prometheus configuration information this will be covered in my blog post which will be linked in the video description with all that done let's upload the sketch and see how it works the co2 sensor needs around three to five minutes to preheat during which time it'll give a reading of about 0.2 volts it'll then start producing a voltage between 0.4 and 2 volts which corresponds to a co2 concentration of 0 and 5000 ppm i've set up the code to recognize these voltages and to indicate that the co2 sensor is preheating before reading is displayed in the meantime we can see that we got readings from our pme to 80 sensor for the environment temperature pressure and humidity at this stage i realized that i'd again made the mistake of using an analog input on the adc2 channel which doesn't work on the esp32 when using wifi so my sensor just said it was preheating indefinitely because the fire beetle board wasn't reading the voltage from the analog input so i switched the analog input to a0 on adc1 and it then started working correctly with that change made we can now see that it's displaying the co2 value alongside the other matrix i'm going to leave it running for a day or two and we can then go check out our grafana dashboard to see the time-based trends two days later this is what our grafana dashboard looks like i've created an instantaneous gauge for each of the four metrics along the top and then a time base trend below them the co2 sensor hasn't really picked up many sparks in the co2 concentration but at the moment it is in a fairly big living space and we tend to keep some windows and doors open during the day for fresh air so we've now got a portable indoor air quality monitor that we can leave in any room let me know what you think of it in the comment section and let me know if there's anything you'd change or add thanks for watching please remember to like this video if you enjoyed it and subscribe for more tech and electronics projects tutorials and reviews you
Info
Channel: Michael Klements
Views: 29,253
Rating: undefined out of 5
Keywords: DFRobot, ESP32, ESP32-E, Firebeetle, Arduino, Grafana, Prometheus, Time Series, Database, CO2, Air Quality, BME280, BMP280, Temperature, Humidity, Pressure, I2C, OLED, IoT
Id: oXGf0EcIW9Y
Channel Id: undefined
Length: 7min 49sec (469 seconds)
Published: Thu Mar 10 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.