nanoFramework.Iot.Device.Mhz19b
1.2.222
Prefix Reserved
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Mhz19b --version 1.2.222
NuGet\Install-Package nanoFramework.Iot.Device.Mhz19b -Version 1.2.222
<PackageReference Include="nanoFramework.Iot.Device.Mhz19b" Version="1.2.222" />
paket add nanoFramework.Iot.Device.Mhz19b --version 1.2.222
#r "nuget: nanoFramework.Iot.Device.Mhz19b, 1.2.222"
// Install nanoFramework.Iot.Device.Mhz19b as a Cake Addin #addin nuget:?package=nanoFramework.Iot.Device.Mhz19b&version=1.2.222 // Install nanoFramework.Iot.Device.Mhz19b as a Cake Tool #tool nuget:?package=nanoFramework.Iot.Device.Mhz19b&version=1.2.222
MH-Z19B CO2-Sensor
Binding for the MH-Z19B NDIR infrared gas module. The gas module measures the CO2 gas concentration in the ambient air.
Documentation
Usage
Important: Make sure you install the nanoFramework.Hardware.ESP32 nuget
and properly setup the UART pins especially for ESP32 before creating the Serialport
.
The binding can be instantiated using an existing serial UART stream or with the name (e.g. COM2
) of the serial interface to be used.
If using an existing stream shouldDispose
indicates whether the stream shall be disposed when the binding gets disposed.
If providing the name of the serial interface the connection gets closed and disposed when the binding is disposed.
public Mhz19b(Stream stream, bool shouldDispose)
public Mhz19b(string uartDevice)
The CO2 concentration reading can be retrieved with
public VolumeConcentration GetCo2Reading()
The sample application demonstrates the use of the binding API for sensor calibration.
Note: Refer to the datasheet for more details on sensor calibration before using the calibration API of the binding. You may decalibrate the sensor otherwise!
Binding Notes
The MH-Z19B gas module provides a serial communication interface (UART) which can be directly wired to a ESP32 board. The module is supplied with 5V. The UART level is at 3.3V and no level shifter is required.
|Function| ESP32Pin| MH-Z19 pin| |--------|-----------|------------| |Vcc +5V |(+5V) |6 (Vin) | |GND |(GND) |7 (GND) | |UART |32 (TXD2) |2 (RXD) | |UART |33 (RXD2) |3 (TXD) | Table: MH-Z19B to ESP32 connection
The binding supports the connection through an UART interface (e.g. ``COM2```) or (serial port) stream. When using the UART interface the binding instantiates the port with the required UART settings and opens it. The use of an existing stream adds flexibility to the actual interface that used with the binding. In either case the binding supports all commands of the module.
Make sure that you read the datasheet carefully before altering the default calibration behaviour. Automatic baseline correction is enabled by default.
An example of the expected output from the sample :
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
-
- nanoFramework.CoreLibrary (>= 1.14.2)
- nanoFramework.Runtime.Events (>= 1.11.6)
- nanoFramework.System.Device.Model (>= 1.2.216)
- nanoFramework.System.IO.Ports (>= 1.1.60)
- nanoFramework.System.IO.Streams (>= 1.1.38)
- UnitsNet.nanoFramework.VolumeConcentration (>= 4.150.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.2.673 | 80 | 10/23/2024 |
1.2.656 | 79 | 10/3/2024 |
1.2.639 | 117 | 9/6/2024 |
1.2.631 | 91 | 8/28/2024 |
1.2.613 | 102 | 8/9/2024 |
1.2.601 | 85 | 7/26/2024 |
1.2.590 | 81 | 7/17/2024 |
1.2.573 | 104 | 6/19/2024 |
1.2.570 | 95 | 6/14/2024 |
1.2.548 | 106 | 5/15/2024 |
1.2.536 | 117 | 4/15/2024 |
1.2.514 | 121 | 3/22/2024 |
1.2.494 | 132 | 2/28/2024 |
1.2.462 | 202 | 1/5/2024 |
1.2.458 | 130 | 12/20/2023 |
1.2.436 | 155 | 11/10/2023 |
1.2.416 | 106 | 11/8/2023 |
1.2.403 | 132 | 10/6/2023 |
1.2.396 | 128 | 9/27/2023 |
1.2.384 | 122 | 9/6/2023 |
1.2.378 | 148 | 8/16/2023 |
1.2.369 | 143 | 8/2/2023 |
1.2.363 | 139 | 7/28/2023 |
1.2.357 | 158 | 7/19/2023 |
1.2.354 | 136 | 7/14/2023 |
1.2.345 | 146 | 6/21/2023 |
1.2.341 | 138 | 6/14/2023 |
1.2.337 | 153 | 6/7/2023 |
1.2.335 | 138 | 6/2/2023 |
1.2.329 | 142 | 5/26/2023 |
1.2.313 | 147 | 5/12/2023 |
1.2.302 | 137 | 5/10/2023 |
1.2.297 | 131 | 5/3/2023 |
1.2.273 | 216 | 3/17/2023 |
1.2.267 | 223 | 3/10/2023 |
1.2.263 | 235 | 3/8/2023 |
1.2.259 | 245 | 2/27/2023 |
1.2.256 | 244 | 2/24/2023 |
1.2.253 | 237 | 2/22/2023 |
1.2.222 | 291 | 1/9/2023 |
1.2.217 | 309 | 1/6/2023 |
1.2.208 | 293 | 1/3/2023 |
1.2.203 | 286 | 12/28/2022 |
1.2.159 | 372 | 11/14/2022 |
1.2.153 | 367 | 11/5/2022 |
1.2.141 | 361 | 10/25/2022 |
1.2.128 | 378 | 10/22/2022 |
1.2.117 | 414 | 10/10/2022 |
1.2.114 | 395 | 10/8/2022 |
1.2.89 | 426 | 9/16/2022 |
1.2.87 | 465 | 9/15/2022 |
1.2.63 | 393 | 9/3/2022 |
1.2.47 | 420 | 8/15/2022 |
1.2.40 | 410 | 8/6/2022 |
1.2.38 | 404 | 8/5/2022 |
1.2.35 | 398 | 8/4/2022 |
1.2.28 | 392 | 8/1/2022 |
1.2.13 | 407 | 7/24/2022 |
1.2.10 | 381 | 7/23/2022 |
1.1.142.3202 | 437 | 7/7/2022 |
1.1.133.52556 | 418 | 6/30/2022 |
1.1.121.35854 | 440 | 6/26/2022 |
1.1.116.8772 | 433 | 6/24/2022 |
1.1.113.2032 | 397 | 6/23/2022 |
1.1.109.32999 | 404 | 6/16/2022 |
1.1.102.51394 | 427 | 6/15/2022 |
1.1.99.36719 | 422 | 6/14/2022 |
1.1.97.17326 | 410 | 6/13/2022 |
1.1.72.29765 | 395 | 5/31/2022 |
1.1.67.25390 | 421 | 5/27/2022 |
1.1.64.21380 | 422 | 5/26/2022 |
1.1.54.28879 | 426 | 5/23/2022 |
1.1.40 | 425 | 5/5/2022 |
1.1.3 | 469 | 4/15/2022 |
1.1.1 | 440 | 4/14/2022 |
1.0.300 | 439 | 3/31/2022 |
1.0.6-preview.114 | 127 | 3/25/2022 |
1.0.6-preview.113 | 120 | 3/25/2022 |
1.0.6-preview.103 | 109 | 3/21/2022 |
1.0.6-preview.100 | 126 | 3/19/2022 |
1.0.6-preview.98 | 124 | 3/18/2022 |
1.0.6-preview.93 | 114 | 3/15/2022 |
1.0.6-preview.86 | 127 | 3/8/2022 |
1.0.6-preview.77 | 136 | 2/27/2022 |
1.0.6-preview.75 | 121 | 2/26/2022 |
1.0.6-preview.73 | 126 | 2/25/2022 |
1.0.6-preview.65 | 120 | 2/18/2022 |
1.0.6-preview.63 | 122 | 2/16/2022 |
1.0.6-preview.61 | 126 | 2/12/2022 |
1.0.6-preview.58 | 124 | 2/10/2022 |
1.0.6-preview.53 | 117 | 2/9/2022 |
1.0.6-preview.50 | 132 | 2/5/2022 |
1.0.6-preview.41 | 137 | 1/31/2022 |
1.0.6-preview.29 | 127 | 1/28/2022 |
1.0.6-preview.22 | 130 | 1/27/2022 |
1.0.6-preview.20 | 139 | 1/27/2022 |
1.0.6-preview.18 | 134 | 1/27/2022 |
1.0.6-preview.5 | 138 | 1/24/2022 |
1.0.6-preview.1 | 130 | 1/21/2022 |
1.0.1 | 463 | 1/17/2022 |