DIY All in 1 Air Quality Monitor

3 min readJun 2, 2023


Air quality is crucial to human health and happiness. We breathe a significant amount of air every day, but we rarely pay attention to its quality. Due to pollution and other factors, indoor air quality may be much worse than we imagine. DIY air quality monitors can help us understand indoor air quality and take action to improve our indoor environment.

Common indoor air quality parameters that need attention include CO2 concentration, PM2.5 particle concentration, temperature, humidity, etc. For example, when the concentration of CO2 exceeds 2000ppm, it can make people feel drowsy, reduce attention and reaction speed. Meanwhile, high levels of PM2.5 particle concentration may induce respiratory system diseases and affect physical health.

Therefore, we can use various sensors to monitor indoor air quality and link with other systems to quickly improve air quality issues. However, currently, there are some devices on the market that cannot be easily linked to common open-source home automation systems (such as Home Assistant), and data collection and display are not very intuitive.

So we can choose to DIY a device ourselves and use the open-source ESPHome system to drive the sensors, collect and report sensor data, and integrate them into Home Assistant.


  • The overview page allows you to visualize the current values of various environmental data, such as current temperature, humidity, PM 2.5 and CO2 concentration.
  • Switch between pages with left and right touch button.
  • Historical trend data for each data item, by recording the last 12 hours of data and showing the trend of environmental data in a graph.
  • Detailed data of specific sensors, for example, Pantone PMS5003 can detect PM 1.0, PM 2.5 and PM 10 at the same time, which cannot be fully displayed in the overview page, so it can be displayed in the details page.
  • The device information interface can display basic information such as the name of current device, Wi-Fi connection, operation time, etc.
  • Data reporting capability, you can report data to Domoticz or Home Assistant via MQTT.
  • Batch deployment capability, deploy device firmware in batch by script.


  • Temperature & Humidity: BME280
  • PM 2.5: Plantower PMS5003
  • CO2: MH-Z19B
  • Luminance: BH1750


All PCBs adopt 2.54mm female headers, which make it easy to directly connect various sensor and component modules and avoid the more difficult soldering work.

AirCube PCB


We use EPSHome as the firmware for this device, which allows us to easily configure each sensor through YAML and integrates the drivers for each sensor. This allows us to compile the firmware without writing a single line of code.

For example, here is a configuration for a light intensity sensor:

Home Assistant

Combined with Home Assistant, we can easily record and display historical data from each sensor, making it easier to observe changes in indoor air quality more intuitively.

CO2 History

Luminance History

Open Source

For all files related to this project, please visit, includes:

  • ESPHome firmware source
  • Schematic of PCB
  • Gerber files used for manufacturing PCB
  • 3D models for assembling this device

For open source EDA project:

For Chinese version of build process article :