Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
mhz19_internals.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2018 Koen Zandberg <koen@bergzand.net>
3
* SPDX-License-Identifier: LGPL-2.1-only
4
*/
5
6
#pragma once
7
17
18
#ifdef __cplusplus
19
extern
"C"
{
20
#endif
21
27
#define MHZ19_UART_BAUDRATE 9600
28
42
#define MHZ19_BUF_SIZE 8
43
53
#define MHZ19_TIMEOUT_READ 20
54
55
/***
56
* @name MH-Z19 Command timeout in milliseconds
57
*
58
* While undocumented, it seems that some commands take some time. Without
59
* an additional delay, the first sensor read will fail with a timeout value,
60
* or return an arbitrary value.
61
*/
62
#define MHZ19_TIMEOUT_CMD (MHZ19_TIMEOUT_READ * 5)
63
68
#define MHZ19_READ_START 0xff
69
#define MHZ19_READ_SENSOR_NUM 0x01
71
76
#define MHZ19_CMD_AUTO_CALIBRATION 0x79
77
#define MHZ19_CMD_GAS_CONCENTRATION 0x86
78
#define MHZ19_CMD_CALIBRATE_ZERO 0x87
79
#define MHZ19_CMD_CALIBRATE_SPAN 0x88
81
86
#define MHZ19_RX_POS_PPM_HIGH 1
87
#define MHZ19_RX_POS_PPM_LOW 2
88
#define MHZ19_RX_POS_CHECKSUM 7
90
91
#ifdef __cplusplus
92
}
93
#endif
94
Generated on Fri May 1 2026 15:22:59 by
1.13.2