M5Stack Air Quality ESPHome Save

ESPHome configuration for M5Stack's PM2.5 Air Quality Kit with the PMSA003 particulate matter sensor and the SHT20 temperature and humidity sensor

Project README

ESPHome configuration for the M5Stack PM2.5 Air Quality Kit

Build status GitHub license

This ESPHome configuration builds firmware for M5Stack's PM2.5 Air Quality Kit (PMSA003 + SHT20). It shows:

  • The amount of particulate matter (PM1, PM2.5 and PM10).
  • The temperature and humidity, as well as the computed vapour-pressure deficit and dew point.

ESPHome configuration for the M5Stack air quality kit

Note that ESPHome doesn't support the SHT20 sensor natively. This repository adds a custom component that's using the Arduino library uFire_SHT20 which supports the sensor.

Installation

On a web browser supporting Web Serial (which is a recent Chrome, Edge or Opera) you can install the latest version of the firmware on your M5Stack air quality kit from our installation page via USB, as well as setting up Wi-Fi and adding the device to Home Assistant.

You can also manually compile and upload the firmware to your M5Stack air quality kit with:

esphome run m5stack-air-quality-kit.yaml

Usage

The middle button is used to toggle the display's backlight on and off.

Remarks about the temperature and humidity readings

The SHT20 sensor shows a much too high temperature and much too low humidity. This doesn't seem to be a software problem: I tried a couple of other libraries for the SHT20 with the M5Stack air quality kit and they all have the same result.

According to Sensirion's data sheet of the SHT20, you shouldn't do more than two measurements per second at 12-bit accuracy, to prevent self-heating of the sensor. In my custom sensor component, I configured polling every second to stay on the safe side.

But even this doesn't solve the problem. I suspect M5Stack's hardware design is faulty and the sensor really reads the heat produced by the other components in the M5Stack Core case.

TODO

  • Change the interface to something nicer. I'm not a designer, so I welcome any suggestions or pull requests.
  • Use the left and right buttons for other tasks.

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 Roboto font is licensed under the Apache License, Version 2.0.

The uFire_SHT20 library is licensed under the MIT license.

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.

Open Source Agenda is not affiliated with "M5Stack Air Quality ESPHome" Project. README Source: koenvervloesem/M5Stack-Air-Quality-ESPHome

Open Source Agenda Badge

Open Source Agenda Rating