Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use CO2 sensor : Examples, Pinouts, and Specs

Image of CO2 sensor
Cirkit Designer LogoDesign with CO2 sensor in Cirkit Designer

Introduction

A CO2 sensor detects the concentration of carbon dioxide (CO2) in the air. It is commonly used for monitoring air quality and ensuring proper ventilation in indoor environments such as offices, homes, greenhouses, and industrial facilities. These sensors are essential for maintaining healthy air quality, optimizing energy usage in HVAC systems, and ensuring compliance with safety standards in enclosed spaces.

Explore Projects Built with CO2 sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP8266-Controlled CO2 Monitoring System with Multi-Color LED Indicators and Buzzer Alarm
Image of Copy of PROYECTO MICA MONITOREO INALAMBRICO DE LA CALIDAD DEL AIRE: A project utilizing CO2 sensor  in a practical application
This circuit is designed to monitor CO2 levels in an environment using a SenseAir S8 CO2 sensor, with an ESP-8266 microcontroller handling data processing and communication. The ESP-8266 controls three LEDs (red, yellow, green) and a buzzer as indicators of CO2 concentration levels, and it is programmed to send CO2 data to a ThingSpeak server for remote monitoring. A push switch is connected to the reset pin of the ESP-8266 for manual resetting of the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Pro Mini Based CO2 Monitoring System with LoRa Wireless Transmission
Image of Caboma : A project utilizing CO2 sensor  in a practical application
This circuit is designed for CO2 monitoring and wireless data transmission. It uses an Arduino Pro Mini to read CO2 levels from a SenseAir S8 CO2 sensor and transmit the data via a LoRa Ra-02 SX1278 module. A step-up boost power converter is used to adjust the voltage for the Arduino and sensor, powered by an 18650 battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Air Quality and Fire Detection System with RGB Indicator and Alarm
Image of GAS SENSOR detector: A project utilizing CO2 sensor  in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an MQ135 gas sensor for CO2 detection, a KY-026 flame sensor for fire detection, a buzzer for alarms, and an RGB LED to visually indicate CO2 levels. A 16x2 LCD displays CO2 concentration and fire alerts, while potentiometers control LCD contrast. The embedded code manages sensor readings, activates the buzzer based on predefined thresholds, and adjusts the RGB LED color in response to CO2 levels.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO WiFi CO and Temperature Monitoring System with Bluetooth Connectivity
Image of Fire Detector: A project utilizing CO2 sensor  in a practical application
This circuit is a CO and environmental monitoring system using an Arduino UNO R4 WiFi, an MQ-7 CO sensor, a DHT22 temperature and humidity sensor, and a Bluetooth HC-06 module. The Arduino reads data from the sensors and transmits it via Bluetooth, while also providing visual alerts through an LED if CO levels exceed a predefined limit.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with CO2 sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Copy of PROYECTO MICA MONITOREO INALAMBRICO DE LA CALIDAD DEL AIRE: A project utilizing CO2 sensor  in a practical application
ESP8266-Controlled CO2 Monitoring System with Multi-Color LED Indicators and Buzzer Alarm
This circuit is designed to monitor CO2 levels in an environment using a SenseAir S8 CO2 sensor, with an ESP-8266 microcontroller handling data processing and communication. The ESP-8266 controls three LEDs (red, yellow, green) and a buzzer as indicators of CO2 concentration levels, and it is programmed to send CO2 data to a ThingSpeak server for remote monitoring. A push switch is connected to the reset pin of the ESP-8266 for manual resetting of the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Caboma : A project utilizing CO2 sensor  in a practical application
Arduino Pro Mini Based CO2 Monitoring System with LoRa Wireless Transmission
This circuit is designed for CO2 monitoring and wireless data transmission. It uses an Arduino Pro Mini to read CO2 levels from a SenseAir S8 CO2 sensor and transmit the data via a LoRa Ra-02 SX1278 module. A step-up boost power converter is used to adjust the voltage for the Arduino and sensor, powered by an 18650 battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of GAS SENSOR detector: A project utilizing CO2 sensor  in a practical application
Arduino UNO Based Air Quality and Fire Detection System with RGB Indicator and Alarm
This circuit features an Arduino UNO microcontroller interfaced with an MQ135 gas sensor for CO2 detection, a KY-026 flame sensor for fire detection, a buzzer for alarms, and an RGB LED to visually indicate CO2 levels. A 16x2 LCD displays CO2 concentration and fire alerts, while potentiometers control LCD contrast. The embedded code manages sensor readings, activates the buzzer based on predefined thresholds, and adjusts the RGB LED color in response to CO2 levels.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Fire Detector: A project utilizing CO2 sensor  in a practical application
Arduino UNO WiFi CO and Temperature Monitoring System with Bluetooth Connectivity
This circuit is a CO and environmental monitoring system using an Arduino UNO R4 WiFi, an MQ-7 CO sensor, a DHT22 temperature and humidity sensor, and a Bluetooth HC-06 module. The Arduino reads data from the sensors and transmits it via Bluetooth, while also providing visual alerts through an LED if CO levels exceed a predefined limit.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Below are the general technical specifications for a typical CO2 sensor. Note that specific values may vary depending on the sensor model.

Key Specifications

  • Measurement Range: 0 to 5000 ppm (parts per million)
  • Accuracy: ±50 ppm or ±5% of reading (whichever is greater)
  • Operating Voltage: 3.3V to 5V DC
  • Current Consumption: 10 mA to 150 mA (depending on the sensor type)
  • Output Signal: Analog voltage, PWM, or digital (I2C/UART)
  • Response Time: <30 seconds
  • Operating Temperature: -10°C to 50°C
  • Humidity Range: 0% to 95% RH (non-condensing)

Pin Configuration and Descriptions

Below is a typical pinout for a CO2 sensor with digital and analog output capabilities:

Pin Name Description
1 VCC Power supply input (3.3V or 5V DC, depending on the sensor model).
2 GND Ground connection.
3 OUT/ANALOG Analog output signal proportional to CO2 concentration.
4 PWM/DIGITAL Digital output (PWM or UART/I2C, depending on the sensor model).
5 RX UART receive pin (used for communication with microcontrollers, if applicable).
6 TX UART transmit pin (used for communication with microcontrollers, if applicable).

Usage Instructions

How to Use the CO2 Sensor in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Choose Output Type: Depending on your application, use either the analog output (OUT/ANALOG pin) or the digital output (PWM/DIGITAL pin). For UART communication, connect the RX and TX pins to the corresponding pins on your microcontroller.
  3. Read the Output:
    • For analog output, measure the voltage on the OUT/ANALOG pin using an ADC (Analog-to-Digital Converter) on your microcontroller.
    • For digital output, read the PWM signal or use UART/I2C communication to retrieve CO2 concentration data.
  4. Calibrate the Sensor: Some CO2 sensors require periodic calibration to maintain accuracy. Refer to the sensor's datasheet for calibration instructions.

Important Considerations and Best Practices

  • Preheat Time: Allow the sensor to warm up for 1-2 minutes after powering it on to ensure accurate readings.
  • Ventilation: Place the sensor in a location with good airflow to avoid stagnant air affecting the readings.
  • Avoid Contaminants: Keep the sensor away from dust, water, and volatile chemicals, as these can damage the sensor or affect its accuracy.
  • Power Supply: Use a stable power source to prevent fluctuations in the sensor's output.

Example: Connecting a CO2 Sensor to an Arduino UNO

Below is an example of how to connect and read data from a CO2 sensor with an analog output using an Arduino UNO.

Circuit Diagram

  • Connect the VCC pin of the sensor to the 5V pin on the Arduino.
  • Connect the GND pin of the sensor to the GND pin on the Arduino.
  • Connect the OUT/ANALOG pin of the sensor to the A0 pin on the Arduino.

Arduino Code

// CO2 Sensor Example Code for Arduino UNO
// This code reads the analog output of a CO2 sensor and prints the CO2 level
// to the Serial Monitor. Ensure the sensor is connected to pin A0.

const int sensorPin = A0; // Analog pin connected to the sensor's output
float voltage;            // Variable to store the sensor's output voltage
float co2Concentration;   // Variable to store the calculated CO2 concentration

void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600 baud
  pinMode(sensorPin, INPUT); // Set the sensor pin as input
}

void loop() {
  // Read the analog value from the sensor
  int sensorValue = analogRead(sensorPin);

  // Convert the analog value to voltage (assuming 5V reference)
  voltage = sensorValue * (5.0 / 1023.0);

  // Convert the voltage to CO2 concentration (ppm)
  // Example formula: CO2 (ppm) = (voltage - 0.4) * 2000
  // Adjust the formula based on your sensor's datasheet
  co2Concentration = (voltage - 0.4) * 2000;

  // Print the CO2 concentration to the Serial Monitor
  Serial.print("CO2 Concentration: ");
  Serial.print(co2Concentration);
  Serial.println(" ppm");

  delay(1000); // Wait for 1 second before the next reading
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings:

    • Solution: Check the power supply voltage and ensure proper connections to the sensor.
    • Tip: Verify that the sensor's preheat time has elapsed before taking readings.
  2. Fluctuating or Unstable Readings:

    • Solution: Ensure the sensor is placed in a well-ventilated area and away from heat sources or drafts.
    • Tip: Use a capacitor across the power supply pins to filter out noise.
  3. Sensor Not Responding to UART/I2C Commands:

    • Solution: Double-check the baud rate and communication protocol settings in your code.
    • Tip: Refer to the sensor's datasheet for the correct communication parameters.
  4. Sensor Requires Frequent Calibration:

    • Solution: Follow the calibration procedure outlined in the sensor's datasheet.
    • Tip: Use a known CO2 concentration environment for accurate calibration.

FAQs

  • Q: Can I use the CO2 sensor outdoors?

    • A: Most CO2 sensors are designed for indoor use. Outdoor use may expose the sensor to extreme temperatures, humidity, and contaminants, which can affect its performance.
  • Q: How often should I calibrate the sensor?

    • A: Calibration frequency depends on the sensor model and usage conditions. Refer to the manufacturer's recommendations, but typically, calibration is required every 6-12 months.
  • Q: Can I use the sensor with a 3.3V microcontroller?

    • A: Yes, as long as the sensor supports a 3.3V power supply. Check the datasheet to confirm compatibility.
  • Q: What is the lifespan of a CO2 sensor?

    • A: The lifespan varies by model but is typically 5-10 years under normal operating conditions.