350-10000 (10k) Electrochemical

The "Greenhouse Effect" is melting the icebergs every minute. By knowing the exact concentration of CO2, we can do something to reduce the atmosphere's CO2 level and to protect our earth. For that reason, our engineer's designed a high quality CO2 sensor. This is the first CO2 sensor on the opensource hardware market. The output voltage of the module falls as the concentration of the CO2 increases. The potentiometer on-board is designed to set the threshold of voltage. Once the CO2 concentration is high enough (voltage is lower than than threshold), a digital signal (ON / OFF) will be released.

  • It has MG-811 gas sensor onboard which is highly sensitive to CO2 and less sensitive to alcohol and CO, low humidity & temperature dependency. All components have industrial quality which ensures stability and reproducibility.

  • The onboard heating circuit brings the best temperature for sensor to function. 5V power input will be boosted to 6V for heating.

  • This sensor has an onboard conditioning circuit for amplifying output signal.

    • External power supply (7 ~ 12V) is necessary to supply the microcontroller board when you using this CO2 sensor module.
    • This module is an electrochemical sensor, you need to calibrate it before actual measurement.

Specification

  • Operating voltage: 5V
  • Interface: Analog
  • One digital output
  • High quality connector
  • Immersion gold surface
  • Onboard heating circuit
  • Size: 32x42mm (1.26x1.65 ")

Connecting Diagram

desc1

Tutorial

How to use this module? It is very easy. You need to set potentiometer onboard to the threshold value. Just make the red led turn off. With the CO2 concentration is enough high to make the sensor output voltage higher than threshold value, the led will be turned on. If you connect a buzzer to the module (right side), you will hear the alarm.

Calibration

This module is an electrochemistry sensor, you should calibrate it before actual measurement. You should provide stable power to this module, and the sensor will heatup while working. Please put this module into an area where the air is clean. After continuous working for about 48 hours, you can measure the output voltage of this module. Then modify the definition in the code with the voltage value (unit: V) divide by 8.5.

#define ZERO_POINT_VOLTAGE (voltage/8.5)

For example, the voltage you measured from the module is 2.4V, then 2.4 / 8.5 = 0.282. So modify the defination as below:

#define ZERO_POINT_VOLTAGE (0.282)

After the modification, upload the sample code to your Arduino board.

Sample code

/************************Hardware Related Macros************************************/
#define         MG_PIN                       (A0)     //define which analog input channel you are going to use
#define         BOOL_PIN                     (2)
#define         DC_GAIN                      (8.5)   //define the DC gain of amplifier

/***********************Software Related Macros************************************/
#define         READ_SAMPLE_INTERVAL         (50)    //define how many samples you are going to take in normal operation
#define         READ_SAMPLE_TIMES            (5)     //define the time interval(in milisecond) between each samples in
                                                     //normal operation

/**********************Application Related Macros**********************************/
//These two values differ from sensor to sensor. user should derermine this value.
#define         ZERO_POINT_VOLTAGE           (0.220) //define the output of the sensor in volts when the concentration of CO2 is 400PPM
#define         REACTION_VOLTGAE             (0.030) //define the voltage drop of the sensor when move the sensor from air into 1000ppm CO2

/*****************************Globals***********************************************/
float           CO2Curve[3]  =  {2.602,ZERO_POINT_VOLTAGE,(REACTION_VOLTGAE/(2.602-3))};
                                                     //two points are taken from the curve.
                                                     //with these two points, a line is formed which is
                                                     //"approximately equivalent" to the original curve.
                                                     //data format:{ x, y, slope}; point1: (lg400, 0.324), point2: (lg4000, 0.280)
                                                     //slope = ( reaction voltage ) / (log400 –log1000)

void setup()
{
    Serial.begin(9600);                              //UART setup, baudrate = 9600bps
    pinMode(BOOL_PIN, INPUT);                        //set pin to input
    digitalWrite(BOOL_PIN, HIGH);                    //turn on pullup resistors

   Serial.print("MG-811 Demostration\n");
}

void loop()
{
    int percentage;
    float volts;

    volts = MGRead(MG_PIN);
    Serial.print( "SEN0159:" );
    Serial.print(volts);
    Serial.print( "V           " );

    percentage = MGGetPercentage(volts,CO2Curve);
    Serial.print("CO2:");
    if (percentage == -1) {
        Serial.print( "<400" );
    } else {
        Serial.print(percentage);
    }

    Serial.print( "ppm" );
    Serial.print("\n");

    if (digitalRead(BOOL_PIN) ){
        Serial.print( "=====BOOL is HIGH======" );
    } else {
        Serial.print( "=====BOOL is LOW======" );
    }

    Serial.print("\n");

    delay(500);
}

/*****************************  MGRead *********************************************
Input:   mg_pin - analog channel
Output:  output of SEN-000007
Remarks: This function reads the output of SEN-000007
************************************************************************************/
float MGRead(int mg_pin)
{
    int i;
    float v=0;

    for (i=0;i<READ_SAMPLE_TIMES;i++) {
        v += analogRead(mg_pin);
        delay(READ_SAMPLE_INTERVAL);
    }
    v = (v/READ_SAMPLE_TIMES) *5/1024 ;
    return v;
}

/*****************************  MQGetPercentage **********************************
Input:   volts   - SEN-000007 output measured in volts
         pcurve  - pointer to the curve of the target gas
Output:  ppm of the target gas
Remarks: By using the slope and a point of the line. The x(logarithmic value of ppm)
         of the line could be derived if y(MG-811 output) is provided. As it is a
         logarithmic coordinate, power of 10 is used to convert the result to non-logarithmic
         value.
************************************************************************************/
int  MGGetPercentage(float volts, float *pcurve)
{
   if ((volts/DC_GAIN )>=ZERO_POINT_VOLTAGE) {
      return -1;
   } else {
      return pow(10, ((volts/DC_GAIN)-pcurve[1])/pcurve[2]+pcurve[0]);
   }
}

0-5000 (5k) ppm Infrared

Introduction

We released its latest high-precision analog infrared CO2 sensor. The effective measuring range is from 0 to 5000ppm. This sensor is based on non-dispersive infrared ( NDIR ) technology and has good selectivity and oxygen-free dependency. Additionally, its service life is up to 5 years! It integrates temperature compensation and supports DAC output. Most importantly, the product is easy to use and is compatible with all types of microcontrollers with ADC function. In addition, this product is a high-performance sensor that combines technology of mature infrared absorption gas detection with precision optical circuit design, as well as sophisticated circuit design. It has characteristics such as high sensitivity, high resolution, low power consumption , fast response, anti-water vapor interference, no poisoning, high stability and long life. This sensor is directly compatible with the Arduino IO expansion board thanks to its external interface.This characterizes the simplicity of use of the sensor since it is plug and play and does not need additional wiring. This product could be widely used in HVAC, indoor air quality monitoring, industrial process and security protection monitoring, agriculture and animal husbandry production process monitoring .

Feature

  • Waterproof and anti-corrosion
  • High sensitivity
  • Low power consumption
  • Excellent stability
  • Temperature compensation
  • Excellent linear output
  • High cycle life
  • Anti-water vapor interference
  • No poisoning

Specification

  • Gas Detection: Carbon Dioxide (CO2)
  • Operating Voltage: 4.5 ~ 5.5V DC
  • Average Current: <60mA @ 5V
  • Peak Current: 150mA @ 5V
  • Output Signal: Analog output (0.4 ~ 2V)
  • Measuring Range: 0 ~ 5000ppm
  • Accuracy: ± (50ppm 3% reading)
  • Preheating Time: 3min
  • Response Time: 120s
  • Operating Temperature: 0 ~ 50 ℃
  • Operating Humidity: 0 ~ 95% RH (no condensation)
  • Service Life:> 5 years
  • Size: 37mm * 69mm

Board Overview

CREATOR-gd-jpeg-v1-0-using-IJG-JPEG-v80-quality-95
NumLabelDescription
1SignalAnalog Output (0.4 ~ 2V)
2VCCVCC (4.5 ~ 5.5V)
3GNDGND

Tutorial

In this tutorial, we'll show you how to use Infrared Sensor within 5 minutes.

Requirements

  • Hardware: UNO, CO2 Sensor, IO Expansion Shield

  • Software: Arduino IDE

Connection Diagram

CREATOR-gd-jpeg-v1-0-using-IJG-JPEG-v80-quality-95

Data Analysis

When the IR CO2 sensor get 5V power supply, it will output 0.42V analog value, corresponding to 05000 ppm; And when the sensor finds faults during the self-checking process, it will output 0V.

desc3

Sample Code

int sensorIn = A0;

void setup(){
  Serial.begin(9600);
  // Set the default voltage of the reference voltage
  analogReference(DEFAULT);
}

void loop(){
  //Read voltage
  int sensorValue = analogRead(sensorIn);

  // The analog signal is converted to a voltage
  float voltage = sensorValue*(5000/1024.0);
  if(voltage == 0)
  {
    Serial.println("Fault");
  }
  else if(voltage < 400)
  {
    Serial.println("preheating");
  }
  else
  {
    int voltage_diference=voltage-400;
    float concentration=voltage_diference*50.0/16.0;
    // Print Voltage
    Serial.print("voltage:");
    Serial.print(voltage);
    Serial.println("mv");
    //Print CO2 concentration
    Serial.print(concentration);
    Serial.println("ppm");
  }
  delay(100);
}

Expected Results

Open your IDE serial monitor and wait for 3 minutes (preheat process), then you'll see the finial data. (Indoor Temperature: 30 ℃)

desc4


FAQ

Q. Can I use the CO2 sensor with 3.3V microcontroller?
A. Yes, but you need to power the C02 sensor with 5V power supply seperately, and change the conversion formula * float voltage = sensorValue \ (3300 / 1024.0) **

Q. How do I calibrate?
A. The sensor should be calibrated regularly. The cycle time should be no more than 6 months. Manual calibration of zero point is to calibrate the sensor's HD pin input low level (0V) to calibrate the zero point, and the low level shall last more than 7 seconds. The calibration of zero point is 400 ppm, Please ensure that the sensor is stable for more than 20 minutes at 400ppm.

0-50000 (50k) ppm Infrared (MH-Z16)

We released our latest wide range infrared CO2 sensor, whose effective range is up to 0 ~ 50000ppm. This sensor is based on non-dispersive infrared (NDIR) technology and has good selectivity and oxygen-free dependency. It integrates temperature compensation and support UART communication mode. Most importantly, the product is easy to use and is compatible with all types of microcontrollers with UART port, like Arduino, Raspberry Pi and other microcontrollers. Besides, it has a long service life, up to 5 years! In addition, this UART Infrared CO2 Sensor is a high-performance sensor that combines technology of mature infrared absorption gas detection with precision optical circuit design, as well as sophisticated circuit design. It has characteristics such as wide range detection, high sensitivity, high resolution, low power consumption,fast response, anti-water vapor interference, no poisoning, high stability and long life. It can be widely used in HVAC refrigeration and indoor air quality monitoring, industrial process and safety monitoring, agricultural and animal husbandry production process monitoring, etc ..


Feature

  • Wide Range
  • High Sensitivity
  • Low power consumption
  • Excellent stability
  • Temperature compensation
  • Excellent linear output
  • High cycle life
  • Anti-water vapor interference
  • No poisoning
  • Need 5V power supply, even you are using a 3.3V microcontroller, like Genuino 101 / Raspberry Pi or anything else.

Specification

  • Gas Detection: Carbon Dioxide (CO2)
  • Operating Voltage: 4.5 ~ 5.5V DC
  • Average Current: <85mA
  • Output Signal: UART / PWM / Analog output (the last two has not been developed)
  • Measuring Range: 0 ~ 50000ppm
  • Accuracy: ± (50ppm + 5% reading)
  • Preheating Time: 3min
  • Response Time: T90 <30s
  • Operating Temperature: 0 ~ 50 ℃
  • Operating Humidity: 0 ~ 95% RH (no condensation)
  • Service Life:> 5 years
  • Board Dimension: 21 * 27.11 mm / 0.83 * 1.06 inches
  • Weight: 42 g

Board Overview

CREATOR-gd-jpeg-v1-0-using-IJG-JPEG-v80-quality-95
NumLabelDescription
1RXRX
2TXTX
3GNDGND
4VCCVCC
5Detector connectionDetector connection

Tutorial

Upload the code to Arduino Uno, open the serial monitor to check the CO2 concentration.

NOTE : The CO2 concentration during the preheating time in the serial monitor is not accurate, just ignore the result in the first 3 minutes (Preheating Time).

Requirements

  • Hardware
  • UNO x 1.
  • UART Infrared CO2 Sensor
  • DuPont cables
  • Software
  • Arduino IDE

Connection Diagram

CREATOR-gd-jpeg-v1-0-using-IJG-JPEG-v80-quality-95

Sample Code

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
unsigned char hexdata[9] = {0xFF,0x01,0x86,0x00,0x00,0x00,0x00,0x00,0x79}; //Read the gas density command /Don't change the order
void setup() {

  Serial.begin(9600);
  while (!Serial) {

  }
  mySerial.begin(9600);

}

void loop() {
   mySerial.write(hexdata,9);
   delay(500);

 for(int i=0,j=0;i<9;i++)
 {
  if (mySerial.available()>0)
  {
     long hi,lo,CO2;
     int ch=mySerial.read();

    if(i==2){     hi=ch;   }   //High concentration
    if(i==3){     lo=ch;   }   //Low concentration
    if(i==8) {
               CO2=hi*256+lo;  //CO2 concentration
      Serial.print("CO2 concentration: ");
      Serial.print(CO2);
      Serial.println("ppm");
               }

  }

 }

 }

Expected Results

Open your IDE serial monitor and wait for about 3 minutes (preheat process), then you'll see the finial data. (Indoor Temperature: 25 ℃) 

desc3


FAQ

-Some general Arduino Problems / FAQ / Tips
QI found the output data is always cyclic variation. Why?
AYes, this is normal for the infrared CO2 sensor, It is using NDIR optical detection principle, the value will be hyperactive . But the finial result is still in the precision range. You can use some filtering algorithm to read the average value.