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.