# CO2 sensor MH-Z19C, UART and PWM output, NDIR, 400-5000ppm

> CO2 sensor MH-Z19C using NDIR principle with temperature compensation, measurement range 400-5000ppm. UART TTL 3.3 V and PWM outputs, 5.0 V DC supply, average current under 40 mA, peak current up to 125 mA. Warm-up time ~1 minute, response time T90 under 120 s. Operating temperature -10 to +50 C, humidity 0-95% RH non-condensing. Dimensions 33 x 20mm. Works with Arduino, ESP, STM32.

- Page: https://sigmanortec.ro/en/co2-sensor-mh-z19c-uart-and-pwm-output-ndir-400-5000ppm
- Price: 288.17 RON
- Availability: In stock; 1-2 zile
- Reference: 88051 · EAN: 5943607239709
- Category: Mechatronics and IoT > Sensors and Modules > Gas and Air Quality Sensors
- Package (shipping data): 0.01 kg
- Updated: 2026-09-14
- Shop: [Sigmanortec.ro](https://sigmanortec.ro/en/llms.txt)
- Prices: RON, VAT included; prices and stock as of 2026-10-22 06:34 (Europe/Bucharest)

## Description

NDIR sensor for measuring CO2 in the range of 400-5000 ppm, ideal for monitoring air quality in domestic and light industrial projects. It has temperature compensation, 3.3 V TTL UART output and PWM for quick integration with Arduino, ESP or STM32. It operates at 5 V, warms up in about 1 minute, T90 response under 120 s and average consumption under 40 mA.
MH-Z19C smart sensor for measuring carbon dioxide based on the NDIR principle. It integrates temperature compensation, offers 3.3 V TTL UART output and PWM output, operates on 5 V power supply and has a short warm-up time.
The 400-5000 ppm measurement range covers household and light industrial applications. The T90 response under 120 s, average consumption under 40 mA and dedicated pin for zero calibration make integration on controllers such as Arduino, ESP, STM32 or Pixhawk quick.
The sensor is stable, has clear PWM indication and 3.3 V compatible logic levels with 5 V interfacing tolerance.
The sensor housing is gold-plated and features a microporous filter that covers the diffusion window of the NDIR optical camera. This protects against dust and stabilizes the airflow to the sensor. This filter should not be washed, blown on or damaged.
Specifications:
Supply Voltage: 5.0 V DC ±0.1 V
Model: MH-Z19C
Measuring principle: NDIR with temperature compensation
Detected gas: CO2
Average current: < 40 mA at 5 V
Peak current: up to 125 mA at 5 V
Interface level: 3.3 V compatible 5 V
Measurement range: 400 to 5000 ppm
Outputs: UART TTL 3.3 V and PWM
Warm-up time: ~1 minute
Response time: T90 < 120 s
Operating temperature: −10 to +50 °C
Operating humidity: 0 to 95% RH non-condensing
Dimensions: 33 x 20mm
Pinout:
Pine | Name | Signal type | Description | Observations
1 | HD | Digital input | Manual zero calibration – hold at LOW level ≥7 s for calibration at 400 ppm | Used for calibration only
2 | You | Analog output (DAC) | Analog voltage proportional to CO₂ concentration (0.4–2 V default) | 0–3 V range can be customized
3 | GND | Ground (negative) | Common reference for power and signals | Login required
4 | Wine | +5V DC power supply | Sensor main power supply | Tolerance ±0.1 V, minimum current 150 mA
5 | RXD | UART input (TTL 3.3 V) | Receiving commands from the microcontroller | Connect to the controller's TX
6 | TXD | UART output (TTL 3.3 V) | CO₂ data transmission to microcontroller | Connect to the controller's RX
7 | PWM | PWM digital output | PWM signal proportional to CO₂ concentration | Used for measurement without UART
Useful PWM details:
- Assuming range 400 to 2000 ppm
- Typical period 1004 ms approximately
- Initial pulse high 2 ms and final pulse low 2 ms theoretically
- Calculation formula: Cppm = 2000 × (TH − 2 ms) ÷ (TH + TL − 4 ms)
TH is the duration of the high level in a cycle. TL is the duration of the low level
Dimensions:
Use:
Connect Vin to stable 5 V and GND to common ground. Provide a source that can supply at least 150 mA.
For serial reading connect the Tx of the sensor to the Rx of the microcontroller and Rx to Tx. UART speed according to the library used.
To read via PWM, connect the PWM to a time-measured input pin. Calculate the concentration using the formula in the PWM section.
For zero calibration, bring the HD to LOW level for at least 7 s in fresh air approximately 400 ppm, after the sensor has operated continuously for over 20 minutes.
Mount the sensor in a well-ventilated area, away from heat sources and direct sunlight. Avoid condensation and high levels of dust.
Calibrate periodically, recommended every 6 months. Do not exceed the indicated supply voltage. Avoid mechanical stress on the capsule.
Reading via UART:
Connections:
Vin → 5 V stable
GND → GND common
TXD sensor → RX microcontroller
RXD sensor → TX microcontroller
Baud rate 9600 bps with 8N1
Workflow:
Power the sensor and wait for the minimum recommended heating.
Send concentration reading command:
Send frame in hex: FF 01 86 00 00 00 00 00 79
Read the answer:
Answer format: FF 86 HIGH LOW … CS
CO2 value in ppm = HIGH x 256 + LOW
Check the checksum if necessary.
Displays or transmits the value further in the application.
Numerical example
If HIGH = 01 and LOW = F4
01 hex = 1 decimal
F4 hex = 244 decimal
CO2 = 1 x 256 + 244 = 500 ppm
Zero calibration via HD pin
Place the sensor in clean air approximately 400 ppm
Let it run stably for at least 20 minutes
Pull the HD pin to LOW level for at least 7 seconds
Release HD and wait for stabilization
2. Reading via PWM:
CONNECTIONS
Vin → 5 V
GND → GND
PWM → digital pin with pulse time measurement
Signal parameters
Total period T approximately 1004 ms
At the beginning of the cycle there is a fixed HIGH pulse of about 2 ms.
At the end there is a fixed LOW pulse of about 2 ms
TH is the total duration on HIGH level within the cycle
TL is the duration on LOW level within the same cycle
Formula for the range 400 to 2000 ppm
Cppm = 2000 x TH minus 2 ms divided by TH plus TL minus 4 ms
Numerical example
Measure TH = 752 ms and TL = 250 ms
TH minus 2 ms = 750
TH plus TL minus 4 ms = 752 + 250 − 4 = 998
Ratio 750 divided by 998 ≈ 0.7515
Cppm ≈ 2000 x 0.7515 ≈ 1503 ppm
The result indicated approximately 1500 ppm CO2
