Skip to content

Commit 6a27877

Browse files
authored
Merge pull request #8 from /issues/7
Update documentation MH-Z19C
2 parents be7b4f8 + 9f11a31 commit 6a27877

File tree

10 files changed

+43
-23
lines changed

10 files changed

+43
-23
lines changed

.auto-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# MIT License
44
#
5-
# Copyright (c) 2020-2022 Erriez
5+
# Copyright (c) 2020-2023 Erriez
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy
88
# of this software and associated documentation files (the "Software"), to deal

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2022 Erriez
3+
Copyright (c) 2020-2023 Erriez
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+34-14
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,33 @@ compensation to measure CO2 concentration in air.
3131

3232
### Pins
3333

34+
WARNING: The pins between MH-Z19B and MH-Z19C are different. See tables below:
35+
3436
```c++
35-
// MH-Z19B front connector
3637
// __ _______
3738
// +------------------+
3839
// | |
3940
// | . . . . . . . |
4041
// | 1 2 3 4 5 6 7 |
4142
// +------------------+
4243
//
43-
// Pin 1: Yellow None
44-
// Pin 2: Green UART (TXD) TTL Level Data Output -> TO RXD
45-
// Pin 3: Blue UART(RXD) TTL Level Data Input -> TO TXD
46-
// Pin 4: Red Positive Power Supply (Vin +5V)
47-
// Pin 5: Black Negative Power Supply (GND)
48-
// Pin 6: White None
49-
// Pin 7: Brown Analog Output Vo (Not used)
44+
// MH-Z19B front connector:
45+
// Pin 1: Yellow None
46+
// Pin 2: Green UART (TXD) TTL Level Data Output -> TO RXD
47+
// Pin 3: Blue UART (RXD) TTL Level Data Input -> TO TXD
48+
// Pin 4: Red Positive Power Supply (Vin +5V)
49+
// Pin 5: Black Negative Power Supply (GND)
50+
// Pin 6: White None
51+
// Pin 7: Brown Analog Output Vo (Not used)
52+
//
53+
// MH-Z19C front connector:
54+
// Pin 1: PWM
55+
// Pin 2: UART (TXD) TTL Level data output -> TO RXD
56+
// Pin 3: UART (RXD) TTL Level data input -> TO TXD
57+
// Pin 4: Positive Power Supply (Vin +5V)
58+
// Pin 5: Negative Power Supply (GND)
59+
// Pin 6: Analog Output Vo
60+
// Pin 7: HD (Hand-operated calibration)
5061
//
5162
// The following ESP8266 pins are reserved:
5263
// TX/RX: Serial (in use)
@@ -80,7 +91,8 @@ The following targets are supported and tested:
8091

8192
- [Online HTML](https://erriez.github.io/ErriezMHZ19B)
8293
- [Doxygen PDF](https://github.com/Erriez/ErriezMHZ19B/blob/gh-pages/ErriezMHZ19B.pdf)
83-
- [Datasheet PDF](https://github.com/Erriez/ErriezMHZ19B/blob/master/extras/mh-z19b-co2-ver1_0.pdf)
94+
- [MH-Z19B datasheet PDF](https://github.com/Erriez/ErriezMHZ19B/blob/master/extras/mh-z19b-co2-ver1_0.pdf)
95+
- [MH-Z19C datasheet PDF](https://github.com/Erriez/ErriezMHZ19B/blob/master/extras/mh-z19c-co2-ver1_21.pdf)
8496

8597

8698
## CO2 Concentrations
@@ -131,7 +143,7 @@ The status can be read with function `getAutoCalibration()`.
131143
For simplicity, this library uses the terminology `Automatic Calibration` which is identical to the
132144
`ABC (Automatic Baseline Correction) logic on/off` mentioned in the datasheet.
133145

134-
### 2. Manual Calibration (400ppm)
146+
### 2. Manual ZERO Calibration (400ppm)
135147

136148
Procedure for manual calibration at 400ppm:
137149

@@ -144,13 +156,21 @@ Procedure for manual calibration at 400ppm:
144156

145157
Now the sensor is calibrated. Repeat the sequence more often for higher accuracy.
146158

147-
### 3. Manual Calibration (SPAN)
159+
### 3. MH-Z19B only: Manual SPAN Calibration
160+
161+
The SPAN point calibration procedure is not implemented in this library as it requires special
162+
calibration equipment. This functionality is not available in MH-Z19C.
148163

149-
The datasheet also mentions a command `0x88 Span Point Calibration`. The calibration procedure is
150-
not clear and therefore not implemented in this library.
164+
### 4. MH-Z19C only: Hand-operated calibration
151165

166+
Procedure according to the MH-Z19C datasheet:
167+
- Connect module’s HD pin to low level(0V), lasting for 7 seconds at least.
168+
- Before calibrating the zero point, please ensure that the sensor is stable for more than 20
169+
minutes at 400ppm ambient environment.
170+
- The application is responsible to control the external MH-Z19C HD pin and is not available on
171+
the MH-Z19B.
152172

153-
## MH-Z19B API
173+
## MH-Z19B/C API
154174

155175
**Initialization Software Serial**
156176

examples/ErriezMHZ19B7SegmentDisplay/ErriezMHZ19B7SegmentDisplay.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2020-2022 Erriez
4+
* Copyright (c) 2020-2023 Erriez
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

examples/ErriezMHZ19BESP8266MQTT/ErriezMHZ19BESP8266MQTT.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2020-2022 Erriez
4+
* Copyright (c) 2020-2023 Erriez
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

examples/ErriezMHZ19BGettingStarted/ErriezMHZ19BGettingStarted.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2020-2022 Erriez
4+
* Copyright (c) 2020-2023 Erriez
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

examples/ErriezMHZ19BSerialPlottter/ErriezMHZ19BSerialPlottter.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2020-2022 Erriez
4+
* Copyright (c) 2020-2023 Erriez
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

extras/mh-z19c-co2-ver1_21.pdf

1.12 MB
Binary file not shown.

src/ErriezMHZ19B.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2020-2022 Erriez
4+
* Copyright (c) 2020-2023 Erriez
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

src/ErriezMHZ19B.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2020-2022 Erriez
4+
* Copyright (c) 2020-2023 Erriez
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -57,7 +57,7 @@
5757
#define MHZ19B_CMD_SET_AUTO_CAL 0x79 //!< Command set auto calibration on/off
5858
#define MHZ19B_CMD_READ_CO2 0x86 //!< Command read CO2 concentration
5959
#define MHZ19B_CMD_CAL_ZERO_POINT 0x87 //!< Command calibrate zero point at 400ppm
60-
#define MHZ19B_CMD_CAL_SPAN_PIONT 0x88 //!< Command calibrate span point (NOT IMPLEMENTED)
60+
#define MHZ19B_CMD_CAL_SPAN_POINT 0x88 //!< Command calibrate span point (NOT IMPLEMENTED)
6161
#define MHZ19B_CMD_SET_RANGE 0x99 //!< Command set detection range
6262

6363
// Not documented commands

0 commit comments

Comments
 (0)