Skip to content

πŸ’₯ Arduino library for Winsen MH-Z19 – infrared carbon dioxide sensor. The library allows using the sensor over hardware or software UART on any board that supports Arduino.

License

Notifications You must be signed in to change notification settings

malokhvii-eduard/arduino-mhz19

Repository files navigation

πŸ’₯ Arduino library for Winsen MH-Z19

The library allows using the sensor over hardware or software UART on any board that supports Arduino.

License Husky Commitizen semantic-release Style Guide clang-format markdownlint commitlint Tested on Arduino Uno Tested on Arduino Nano Tested on NodeMCU Tested on Wemos D1 Code Coverage CI Workflow Release Workflow

πŸŽ‰ Features

✨ Getting Started

πŸ“¦ Installation

πŸ‘‰ PlatformIO

Run pio lib install "malokhvii-eduard/arduino-mhz19" or declare in platformio.ini configuration file using lib_deps option. Enjoy! πŸŽ‰πŸ‘

πŸ‘‰ Arduino IDE (Library Manager)

Go to the Arduino IDE and click Tools > Manage Libraries. In the library manager dialogue that opens, enter search query Mhz19. Afterward, find a library Mhz19 by Eduard Malokhvii and click Install. Enjoy! πŸŽ‰πŸ‘

πŸ‘‰ Arduino IDE (Manual)

Download Mhz19.zip from release assets. Once downloaded, go to the Arduino IDE and click Sketch > Include Library > Add .zip Library. In the file dialogue that opens, locate your downloaded ZIP file. Afterward, you should receive a Library Added message just above the debug window. Enjoy! πŸŽ‰πŸ‘

πŸ‘€ Usage

There is only one example, but comprehensive, to demonstrate usage of the library. See Basic.ino to see how to read carbon dioxide over software UART.

❓ FAQs

πŸ™‹β€β™‚οΈ In which units carbon dioxide is measured?

πŸ‘‰ The carbon dioxide is measured in parts-per-million (symbol: ppm).

πŸ™‹β€β™‚οΈ How to set a measuring range?

πŸ‘‰ You can set a measuring range by call of Mhz19::setMeasuringRange(). The measuring ranges are listed below:

  • Mhz19MeasuringRange::Ppm_1000
  • Mhz19MeasuringRange::Ppm_2000
  • Mhz19MeasuringRange::Ppm_3000
  • Mhz19MeasuringRange::Ppm_5000

πŸ™‹β€β™‚οΈ What is automatic baseline correction?

πŸ‘‰ Sensor itself do zero point judgment and automatic calibration procedure intelligently after a continuous operation period. The automatic calibration cycle is every 24 hours after powered on. The zero point of automatic calibration is 400ppm. The default setting is with built-in automatic calibration function if no special request. This function is usually suitable for indoor air quality monitor such as offices, schools and homes, not suitable for greenhouse, farm and refrigeratory where this function should be off.

πŸ™‹β€β™‚οΈ How does it work?

πŸ‘‰ You can explore unit tests to see the behavior of all library members.

πŸ› οΈ Tech Stack

EditorConfig Markdown C++ PlatformIO Arduino Google Test gcovr npm clang-format Prettier markdownlint commitlint semantic-release MH-Z19 Shields.io Git GitHub GitHub Actions

✍️ Contributing

πŸ‘πŸŽ‰ First off, thanks for taking the time to contribute! πŸŽ‰πŸ‘

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/awesome-feature)
  3. Commit your Changes (git commit -m 'Add awesome feature')
  4. Push to the Branch (git push origin feature/awesome-feature)
  5. Open a Pull Request

πŸ’– Like this project?

Leave a ⭐ if you think this project is cool or useful for you.

⚠️ License

arduino-mhz19 is licenced under the MIT License. See the LICENSE for more information.

About

πŸ’₯ Arduino library for Winsen MH-Z19 – infrared carbon dioxide sensor. The library allows using the sensor over hardware or software UART on any board that supports Arduino.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Languages