The library allows using the sensor over hardware or software UART on any board that supports Arduino.
- ๐ Easy to use
- ๐๏ธ Zero dependencies
- โ๏ธ Hardware or software UART
- ๐งช 100% code coverage
- โ๏ธ Tested on: Arduino Uno, Arduino Nano, NodeMCU, Wemos D1
๐ 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! ๐๐
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.
๐ The carbon dioxide is measured in
parts-per-million (symbol: ppm
).
๐ 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
๐ 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.
๐ You can explore unit tests to see the behavior of all library members.
๐๐ 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
Leave a โญ if you think this project is cool or useful for you.
arduino-mhz19
is licenced under the MIT License. See the LICENSE
for more information.