A Simple Air Quality Monitor

This semester, I worked on an embedded project with an Arduino. I wanted a system that would keep track of the air quality in my dorm room, so I built a simple air quality monitor.

In my implementation, I have wired up a MQ135 gas sensor, a DHT11 temperature and humidity sensor, an Adafruit 128×64 monochrome OLED, and a button.

Implementation

I programmed the OLED to display four pages, each showing a variety of information:

  • The general air quality
  • The temperature and humidity
  • An estimated CO2 ppm
  • The highest recorded CO2 ppm of the last 24 hours

When the button is pressed, the OLED cycles between pages, presenting different information to the user.

The MQ135 gas sensor uses tin dioxide to detect the presence of various toxic gases. It outputs a greater voltage when the air quality is worse, as tin dioxide has a higher conductivity in a more polluted environment. Although this sensor does not directly measure CO2, I have devised a formula for calculating an estimated CO2 measurement based on some data I gathered in a controlled environment. It is important to note that this formula is of questionable accuracy, and in a real scenario, I recommend using something directly sensitive to CO2.

The DHT11 temperature and humidity sensor includes a dedicated NTC and microcontroller for measuring and outputting the temperature and humidity as serial data.

Arduino code for this project is available on my GitHub: https://github.com/justinroche/AirQualityMonitor


“DHT11–Temperature and Humidity Sensor.” Components101, 16 July 2021, components101.com/sensors/dht11-temperature-sensor. Accessed 6 Dec. 2023.

“MQ-135 Gas Sensor.” MQ-135 Gas Sensor – Waveshare Wiki, http://www.waveshare.com/wiki/MQ-135_Gas_Sensor. Accessed 6 Dec. 2023.

Leave a comment

Latest Articles