Part 1
요약·해설
RX·TX wiring, Nucleo build, 5000 ppm range와 ABC 상태를 설명합니다.
MH-Z19B
9600 baud · IRQ
2 seconds
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
09E3FBE85859831C084A9C8E8479186D9ACB3B63E86ED7571AE97E8D2140C31F
.. _mhz19b-sample:
MH-Z19B: CO2 Sensor Sample
##########################
Description
***********
This sample application demonstrate the configurations of the MH-Z19B CO2
sensor, then periodically reads CO2 data from the sensor. The driver
currently only support uart interrupt APIs.
Requirements
************
The baudrate of the UART must be configured to 9600, and must support
interrupt driven API.
Building and Running
********************
To build the application, a board with UART interface
has to be chosen, or a custom devicetree overlay has to be provided.
Here Nucleo G0B1RE board is used.
Then, connect the RX and TX from your Zephyr target board to the
MH-Z19B CO2 sensor and power the sensor according to the datasheet.
.. zephyr-app-commands::
:zephyr-app: samples/sensor/mhz19b
:board: nucleo_g0b1re
:goals: build
:compact:
Sample Output
=============
The application will perform runtime configuration of the sensor, then
read back the sensor configuration data. After that it will read the CO2
data every 2 seconds.
.. code-block:: console
Winsen MH-Z19B CO2 sensor application
Configuring sensor - OK
Reading configurations from sensor:
Sensor range is set to 5000ppm
Sensor ABC is enabled
sensor: co2 reading: 758
sensor: co2 reading: 759
sensor: co2 reading: 762
<repeats endlessly every 2 seconds>
Part 3
한국어 전문 번역
설명
이 sample application은 MH-Z19B CO2 sensor configuration을 보여 준 뒤 sensor에서 CO2 data를 주기적으로 읽습니다. 현재 driver는 UART interrupt API만 지원합니다.
요구 사항
UART baud rate를 9600으로 설정해야 하며 interrupt-driven API를 지원해야 합니다.
빌드 및 실행
Application을 build하려면 UART interface가 있는 board를 선택하거나 사용자 정의 Devicetree overlay를 제공해야 합니다. 아래 예에서는 Nucleo G0B1RE board를 사용합니다.
Zephyr target board의 RX와 TX를 MH-Z19B CO2 sensor에 연결하고 datasheet에 따라 sensor에 전원을 공급하십시오.
west build -b nucleo_g0b1re samples/sensor/mhz19b
출력 예
Application은 runtime에 sensor를 구성하고 configuration data를 다시 읽습니다. 그 뒤 CO2 data를 2초마다 읽습니다.
Winsen MH-Z19B CO2 sensor application
Configuring sensor - OK
Reading configurations from sensor:
Sensor range is set to 5000ppm
Sensor ABC is enabled
sensor: co2 reading: 758
sensor: co2 reading: 759
sensor: co2 reading: 762
<repeats endlessly every 2 seconds>
예시에서는 measurement range가 5000 ppm이며 Automatic Baseline Correction(ABC)이 활성화되어 있습니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.