MH-Z19B CO2 Sensor Module – NDIR Carbon Dioxide Sensor UART
MH-Z19B NDIR CO2 Sensor Module – UART, 0-5000ppm
The MH-Z19B is an NDIR (non-dispersive infrared) CO2 sensor module that measures carbon dioxide concentration from 0 to 5000 ppm and outputs data over a UART serial interface for air quality monitoring applications.
Key Specifications
| Detection Gas | Carbon Dioxide (CO₂) |
| Measurement Range | 0–5000 ppm [Typical] |
| Accuracy | ±(50 ppm + 5% of reading) [Typical] |
| Output Interface | UART TTL (3.3V/5V compatible) [Typical] |
| Power Supply | 4.5–5.5V DC [Typical] |
| Average Current | <18 mA [Typical] |
| Warm-up Time | 3 minutes [Typical] |
| Operating Temperature | 0°C to 50°C [Typical] |
What You Can Build With This
- CO₂ Monitor with LCD: Read CO₂ ppm on 16x2 I2C LCD with Arduino.
- Cloud CO₂ Dashboard: Stream sensor data to Blynk or ThingSpeak using ESP32.
- Data Logger: Log CO₂ levels to CSV with Python on Raspberry Pi.
- Classroom CO₂ Study: Measure CO₂ change in a closed classroom for CBSE practicals or ATL lab.
- Smart Exhaust Fan Controller: Auto‑activate fan when CO₂ exceeds threshold – ideal for B.Tech or Smart India Hackathon.
Compatibility
| Platform | Compatible | Connection | Library / Method |
|---|---|---|---|
| Arduino Uno R3 | Yes | VCC 5V, TX→Pin 0, RX→Pin 1 | MHZ19, SoftwareSerial |
| Arduino Nano | Yes | VCC 5V, TX→D2, RX→D3 | MHZ19, SoftwareSerial |
| Arduino Mega 2560 | Yes | VCC 5V, TX→RX1(19), RX→TX1(18) | MHZ19 (Serial1) |
| ESP8266 NodeMCU | Yes with level shifting | VCC 5V, TX→D7 via divider, RX→D8 | MHZ19, SoftwareSerial |
| ESP32 Dev Board | Yes with level shifting | VCC 5V, TX→any RX via divider, RX→any TX | MHZ19, HardwareSerial |
| Raspberry Pi Pico | Yes with level shifting | VCC 5V, TX→UART RX via divider, RX→UART TX | mhz19 (MicroPython) |
| Raspberry Pi 4 / 5 | Yes with level shifting | VCC 5V, TX→UART RX via divider, RX→UART TX | mh‑z19, pyserial |
Wiring and Interface Notes
Connect VCC to 5V and GND to ground; wire sensor TX to microcontroller RX and RX to TX. The sensor outputs 5V logic – on 3.3V boards use a voltage divider (e.g., 10kΩ/20kΩ) on the TX line. Allow a 3‑minute warm‑up before readings stabilize; the module includes automatic baseline calibration (ABC) for long‑term accuracy.
Frequently Asked Questions
How does the MH-Z19B auto‑calibrate and can I disable it?
The sensor runs a 24‑hour automatic baseline calibration assuming 400 ppm ambient CO₂. You can disable ABC via a UART command when deploying in sealed or elevated‑CO₂ environments.
Is the MH-Z19B accurate enough for greenhouse CO₂ enrichment?
Yes, the typical accuracy of ±(50 ppm + 5% of reading) is sufficient for general greenhouse control. For precision horticultural or scientific research, consider a lab‑grade NDIR sensor.
Ask Soldr above what you can build with this — it knows every Compoden kit this part appears in.
Shipping Information
- Prepaid Orders: ₹75 for orders up to ₹999, FREE shipping above ₹999
- COD Orders: ₹125 shipping + ₹50 COD fee = ₹175 total
- Delivery Timeline: Dispatch in 1-2 days, delivery in 2-7 days depending on location
Returns & Warranty
- 7-Day Return: Manufacturing defects only (approval required)
- Warranty: 7 days from delivery
- Non-Returnable: Batteries, consumables, cut wires, clearance items