Introduction
DFRobot released its 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
- 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
Num | Label | Description |
---|---|---|
1 | RX | RX |
2 | TX | TX |
3 | GND | GND |
4 | VCC | VCC |
5 | Detector connection | Detector 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
- DFRduino UNO x 1.
- Gravity UART Infrared CO2 Sensor
- DuPont cables
- Software
- Arduino IDE Click to Download Arduino IDE from Arduino.
Connection Diagram
Sample Code
/*!
* @file SEN0220.ino
* @brief Infrared CO2 Sensor 0-50000ppm(Wide Range)
* @n This example is used for detectting CO2 concentration.
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @license The MIT License (MIT)
* @author lg.gang(lg.gang@qq.com)
* @version V1.0
* @date 2016-06-06
*/
#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℃)
FAQ
- | Some general Arduino Problems/FAQ/Tips |
---|---|
Q | I found the output data is always cyclic variation. Why? |
A | Yes, 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. |
A | For any questions, advice or cool ideas to share, please visit the DFRobot Forum. |