MG811 Carbon Dioxide (CO2) Gas Sensor Module – Analog & Digital Output
The MG811 Carbon Dioxide (CO2) Gas Sensor Module is designed to detect changes in carbon dioxide concentration in the surrounding air. It uses an MG811 solid-electrolyte electrochemical gas sensor with an integrated heating element to generate an electrical signal related to CO2 concentration.
The module provides an analog output for monitoring sensor response and a digital output with an adjustable detection threshold. Its onboard potentiometer allows users to adjust the switching threshold for applications requiring a simple CO2 detection signal.
Suitable for Arduino, ESP32, and other microcontroller-based projects, the MG811 module can be used in environmental monitoring, greenhouse automation, ventilation control prototypes, and educational gas-sensing applications.
Key Features
-
MG811 CO2 Sensor: Uses a solid-electrolyte electrochemical sensing element to detect carbon dioxide.
-
CO2 Detection: Responds to changes in carbon dioxide concentration in the surrounding air.
-
Analog Output: Provides a voltage signal related to the sensor's response to CO2.
-
Digital Output: Provides a threshold-based switching signal.
-
Adjustable Threshold: Onboard potentiometer allows adjustment of the digital detection threshold.
-
Integrated Heating Element: Maintains the sensing element at the temperature required for operation.
-
Onboard Indicator: LED indication for the module's detection circuit.
-
Microcontroller Compatible: Can interface with Arduino and other development boards using suitable voltage levels.
-
Compact PCB Design: Suitable for embedded gas detection and monitoring projects.
Technical Specifications
| Parameter |
Specification |
| Sensor Model |
MG811 |
| Product Type |
Carbon Dioxide Gas Sensor Module |
| Target Gas |
Carbon Dioxide (CO2) |
| Sensing Technology |
Solid-Electrolyte Electrochemical |
| Operating Voltage |
6V DC (listed module supply) |
| Sensor Heater |
Integrated |
| Analog Output |
Yes |
| Digital Output |
Yes |
| Digital Threshold |
Adjustable via Potentiometer |
| Output Interface |
Analog Voltage / Digital Logic |
| CO2 Detection Range |
Depends on calibration and module design |
| Sensor Response |
Related to CO2 Concentration |
| Warm-Up Requirement |
Yes |
| Calibration |
Required for Quantitative CO2 Measurement |
| Indicator LED |
Yes |
| Mounting |
PCB Module |
| Dimensions |
Not confirmed |
Pin Configuration
| Pin |
Description |
| VCC |
Module Power Supply |
| GND |
Ground |
| AOUT / AO |
Analog Sensor Output |
| DOUT / DO |
Digital Threshold Output |
Note: Verify the pin labels printed on the actual PCB before connecting the module.
Arduino Connection Example
The MG811 module can be connected to an Arduino development board to monitor changes in CO2 sensor output.
| MG811 Module |
Arduino UNO |
| VCC |
Regulated 6V External Supply |
| GND |
Common Ground |
| AOUT |
A0, with voltage conditioning if required |
| DOUT |
Digital Input, with level shifting if required |
Connection Instructions:
- Connect the module to a suitable regulated power supply.
- Connect the module ground to the Arduino ground.
- Connect the analog output to an Arduino analog input, ensuring that the signal remains within the permitted ADC voltage range.
- Connect the digital output to a suitable digital input if threshold detection is required.
- Allow the sensor to warm up and stabilize before taking measurements.
- Read the analog voltage using the Arduino ADC.
- Adjust the onboard potentiometer to set the desired digital detection threshold.
- Calibrate the sensor using known CO2 concentrations if quantitative measurements are required.
ESP32 Compatibility
The MG811 module can also be used with an ESP32 development board.
Because the ESP32 uses 3.3V GPIO and ADC inputs, the module's output voltage levels must be checked before connection.
A suitable voltage divider or level-shifting circuit may be required to protect the ESP32 inputs.
The MG811 module should be powered from an appropriate external supply rather than directly from an ESP32 GPIO pin.
Applications
- Environmental monitoring projects
- Greenhouse CO2 monitoring
- Ventilation control prototypes
- Indoor air monitoring experiments
- Smart agriculture systems
- Gas detection projects
- Arduino and ESP32 sensor applications
- Educational electronics projects
- Laboratory gas-sensing experiments
- Data logging and environmental research
Important Notes
- The MG811 is a solid-electrolyte electrochemical sensor, not an infrared (NDIR) CO2 sensor.
- The sensor requires heating and a stabilization period before measurements become reliable.
- The module's analog output is not a direct CO2 concentration reading in ppm.
- Calibration is required to estimate CO2 concentration from the sensor response.
- The digital output indicates whether the adjustable threshold has been reached; it does not provide a numerical CO2 measurement.
- The relationship between output voltage and CO2 concentration depends on the sensing circuit and calibration conditions.
- The MG811 sensing element generally produces a signal that decreases as CO2 concentration increases, but the module's analog output may behave differently depending on its signal-conditioning circuit.
- Temperature, humidity, sensor aging, and other environmental factors may influence measurement performance.
- The sensor heater increases power consumption compared with many low-power environmental sensors.
- Verify the module's supply voltage and output levels before connecting it to Arduino, ESP32, or Raspberry Pi.
- A Raspberry Pi requires an external ADC to read the analog output.
- This module is not a calibrated, ready-to-use CO2 ppm meter.
- It should not be used as the sole sensor in life-safety, medical, or critical ventilation applications.
- For accurate indoor CO2 concentration measurement, a calibrated NDIR CO2 sensor is generally more suitable.
Package Includes
Note: Microcontroller, connection wires, and external power supply are not included.