All Projects → koenvervloesem → ESPHome-Air-Quality-Monitor

koenvervloesem / ESPHome-Air-Quality-Monitor

Licence: MIT license
ESPHome configuration for a DIY indoor air quality monitor for CO₂ concentration, PM2.5 and PM10 concentrations, and temperature, humidity and pressure

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ESPHome-Air-Quality-Monitor

M5Stack-Air-Quality-ESPHome
ESPHome configuration for M5Stack's PM2.5 Air Quality Kit with the PMSA003 particulate matter sensor and the SHT20 temperature and humidity sensor
Stars: ✭ 19 (-54.76%)
Mutual labels:  esp32, air-quality, home-assistant, sensors, pm25, pm10, particulate-matter, esp32-arduino, esphome-config, esphome, pm-sensor
PMserial
Arduino library for PM sensors with serial interface
Stars: ✭ 41 (-2.38%)
Mutual labels:  esp32, air-quality, pm25, pm10, particulate-matter
Farm-Data-Relay-System
A system that uses ESP-NOW, LoRa, and other protocols to transport sensor data in remote areas without relying on WiFi.
Stars: ✭ 97 (+130.95%)
Mutual labels:  esp8266, esp32, sensors, esp32-arduino
SDS011
Non blocking SDS011 sensor library for ESP8266
Stars: ✭ 15 (-64.29%)
Mutual labels:  esp8266, pm25, pm10, sds011
DustViewerSharp
UART-USB based dust sensor viewer(and also logging) program by C#
Stars: ✭ 38 (-9.52%)
Mutual labels:  air-quality, pm25, pm10, sds011
esphome-components
ESPHome components
Stars: ✭ 62 (+47.62%)
Mutual labels:  esp8266, esp32, esphome-config, esphome
ESPHome-OpenTherm
Example of how to control an opentherm boiler with esphome
Stars: ✭ 54 (+28.57%)
Mutual labels:  esp8266, esp32, home-assistant, esphome
Open Home Automation
Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
Stars: ✭ 820 (+1852.38%)
Mutual labels:  esp8266, esp32, home-assistant
Pysmartnode
Micropython Smarthome framework
Stars: ✭ 58 (+38.1%)
Mutual labels:  esp8266, esp32, home-assistant
esphome-phsensor
ESP8266 with analog pH sensor
Stars: ✭ 45 (+7.14%)
Mutual labels:  esp8266, home-assistant, esphome
Dsckeybusinterface
An Arduino/esp8266/esp32 library to directly interface with DSC security systems.
Stars: ✭ 202 (+380.95%)
Mutual labels:  esp8266, esp32, home-assistant
Feature Requests
ESPHome Feature Request Tracker
Stars: ✭ 160 (+280.95%)
Mutual labels:  esp8266, esp32, home-assistant
home-assistant-opentherm-thermostat
Home Assistant OpenTherm Thermostat
Stars: ✭ 26 (-38.1%)
Mutual labels:  esp8266, esp32, home-assistant
Esphome Core
🚨 No longer used 🚨 - The C++ framework behind ESPHome
Stars: ✭ 545 (+1197.62%)
Mutual labels:  esp8266, esp32, home-assistant
Esphome
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Stars: ✭ 4,324 (+10195.24%)
Mutual labels:  esp8266, esp32, home-assistant
Home Assistant Config
My Home Assistant configuration & documentation.
Stars: ✭ 99 (+135.71%)
Mutual labels:  esp8266, esp32, home-assistant
Openmqttgateway
MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility, SMS & LORA.
Stars: ✭ 2,413 (+5645.24%)
Mutual labels:  esp8266, esp32, home-assistant
canairio sensorlib
Particle sensor manager for multiple sensors: Honeywell, Plantower, Panasonic, Sensirion, etc. This is sensors layer of CanAirIO project too.
Stars: ✭ 24 (-42.86%)
Mutual labels:  esp32, pm25, co2
SnorkTracker
GPS IoT tracker board for scanning gps and environment information and sending this to a MQTT server via GPRS.
Stars: ✭ 38 (-9.52%)
Mutual labels:  esp8266, esp32, bme280
home
Monorepo for all home automation related development, including integrated firmware, PCBs, configuration, and bridges
Stars: ✭ 104 (+147.62%)
Mutual labels:  esp8266, esp32, home-assistant

ESPHome Air Quality Monitor

Continuous integration License

This ESPHome configuration builds firmware for a DIY indoor air quality monitor. It monitors:

  • CO₂ concentration
  • PM2.5 and PM10 concentration
  • temperature, humidity and pressure

It optionally shows feedback for the current air quality with an RGB LED: green if the air quality is good, yellow if it's acceptable, and red if it's bad. An alternative is showing the sensor measurements on a display.

You can build an example implementation on a perfboard in a project box like this:

A DIY air quality monitor on a perfboard in a project box

Or a portable version with battery (at the back) and display:

A DIY air quality monitor with display and battery

Note the DC/DC boost converter next to the ESP32 board. It always supplies 5 V to the T6615 and SDS011, irrespective of the input voltage (3.7 V if running on the battery and 5 V if running from the USB-C power).

Requirements

Optionally:

  • Common cathode RGB LED (or separate red, green and blue LEDs)
  • 220 Ω resistor and two 47 Ω resistors
  • LiPo or Li-Ion battery
  • DC/DC boost converter with 5 V output

Connections

I have tested this code with:

  • the NodeMCU v2 ESP8266
  • the ESP32-DevKitC V4
  • the LilyGO TTGO T-Display ESP32 (using the built-in display instead of an RGB LED for feedback)

Here are the connections to the pins of these boards:

Component NodeMCU ESP8266 ESP32-DevKitC V4 TTGO T-Display ESP32
BME280 SCL D1 GPIO21 GPIO21
BME280 SDA D2 GPIO22 GPIO22
MH-Z19B / T6615 TX D4 GPIO35 GPIO39
MH-Z19B / T6615 RX D5 GPIO32 GPIO32
SDS011 TX D3 GPIO34 GPIO25
SDS011 RX D6 GPIO33 GPIO33
LED red D7 GPIO5 /
LED green D8 GPIO17 /
LED blue TX GPIO16 /

Make sure to connect the power and ground connections too. The BME280 needs 3.3 V, the MH-Z19B, T6615 and SDS011 need 5 V.

The red component of the RGB LED needs a current-limiting resistor of 220 Ω, while the other two color components need a 47 Ω resistor.

Modularity

This is a modular ESPHome configuration split up in various YAML files that you can import as packages. You can find these in the directory common:

aqi.yaml
Computes the air quality index (AQI) value (good, acceptable, bad) based on the current CO₂ concentration and the 24-hour averages of the PM2.5 and PM10 concentrations. This value is published as a text sensor and shown as a color (green, yellow, red) on the RGB LED.
base.yaml
Sets up the basic ESPHome functionality for the board, including Wi-Fi, a captive portal, logger, Home Assistant API and OTA support. It also sets the threshold values for the CO₂, PM2.5 and PM10 concentrations, as well as the messages when the air quality is good, acceptable or bad.
bme280.yaml
Sets up the BME280 sensor for temperature, humidity and pressure and the I²C bus it uses.
display.yaml
Configures colors and fonts as well as graphs for the CO₂ and particulate matter concentrations.
mh-z19b.yaml
Sets up the MH-Z19B CO₂ sensor, a binary sensor that shows whether the sensor has been calibrated yet (and sets the LED to blue when it isn't) and a switch to calibrate the sensor.
no_feedback/aqi.yaml
Use this if you don't want to show AQI status.
no_feedback/calibration.yaml
Use this if you don't want to show calibration status.
rgb_led/aqi.yaml
Shows AQI status on the RGB LED.
rgb_led/calibration.yaml
Shows calibration status on the RGB LED.
rgb_led/esp32.yaml
Sets up the RGB LED on the ESP32 with its LEDC peripheral (a hardware PWM).
rgb_led/esp8266.yaml
Sets up the RGB LED on the ESP8266 with software PWM.
sds011.yaml
Sets up the SDS011 PM sensor.
secrets.yaml.example
Contains the secrets used in this ESPHome project. Copy this file to a file secrets.yaml in the common directory and enter your Wi-Fi, API and OTA credentials.
t6615.yaml
Sets up the T6615 CO₂ sensor, which doesn't need calibration.

Usage

To use this configuration, create a YAML file with:

  • substitutions for all pin numbers used by the components, your device's name, platform and board and parameters like update intervals.
  • packages that include the relevant YAML files in the common directory.

There are three example configurations in this repository:

After this, flash the firmware to your device, e.g. with:

esphome run esp32_example.yaml

After you have added your device to Home Assistant's ESPHome integration, the air quality measurements are available in Home Assistant and you can start the calibration of the CO₂ sensor from within Home Assistant too (or with the top button on the TTGO T-Display ESP32).

If you successfully created a configuration for another ESP8266 or ESP32 board, please contribute this configuration with a pull request.

Customizations

Thanks to the modularity of the code, it shouldn't be that difficult to create a variant of this project with other sensors. Here are some suggestions:

Change the temperature, humidity and pressure sensor
This sensor is currently not referenced in the other YAML files, so you can just add a configuration file for another sensor, disable the package for the BME280 and add a package for the other sensor.
Change the CO₂ sensor
Make sure you give the CO₂ value of your sensor the ID co2_value and create a binary sensor for its calibration state with ID co2_calibrated.
Change the RGB LED
You can swap the classical RGB LED for another light, as long as it has the ID led_rgb and it's a light with platform rgb (with red, green and blue components).
Change the PM sensor
Make sure you give the PM2.5 and PM10 values of your sensor the IDs pm2_5_value and pm10_value.

With these changes, the rest of the code should still work.

If you successfully created a customization, please contribute this with a pull request, ideally with an example configuration.

More complex customizations could be supported in future versions of this project.

Learn more about ESPHome

If you want to learn more about ESPHome, read my book Getting Started with ESPHome: Develop your own custom home automation devices and the accompanying GitHub repository koenvervloesem/Getting-Started-with-ESPHome.

License

This project is provided by Koen Vervloesem as open source software with the MIT license. See the LICENSE file for more information.

The included Roboto font is licensed under the Apache License, Version 2.0.

The C++/runtime codebase of the ESPHome project (file extensions .c, .cpp, .h, .hpp, .tcc, .ino) are published under the GPLv3 license. The Python codebase and all other parts of the ESPHome codebase are published under the MIT license. See the ESPHome License for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].