arduino-mhz19
arduino-mhz19 copied to clipboard
๐ฅ 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.
๐ฅ Arduino library for Winsen MH-Z19
The library allows using the sensor over hardware or software UART on any board that supports Arduino.
๐ Features
- ๐ Easy to use
- ๐๏ธ Zero dependencies
- โ๏ธ Hardware or software UART
- ๐งช 100% code coverage
- โ๏ธ Tested on: Arduino Uno, Arduino Nano, NodeMCU, Wemos D1
โจ 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_1000Mhz19MeasuringRange::Ppm_2000Mhz19MeasuringRange::Ppm_3000Mhz19MeasuringRange::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
โ๏ธ 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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/awesome-feature) - Commit your Changes (
git commit -m 'Add awesome feature') - Push to the Branch (
git push origin feature/awesome-feature) - 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.