FAQ

Infrared CO2 Sensor FAQ【SEN0219】

userHead Winster 2022-09-09 17:33:23 3610 Views0 Replies

Q1:My sensor readings are fluctuating, why is this happening and how can I fix it?

A1:Due to the high sensitivity of the sensor, it is normal for the readings to vibrate. If you need to get a smoother output curve, you can take the average of the data in a range.

 

 

Q2:Why can't my sensor output normally?

A2:

1.The sensor needs to be preheated about 3 mins before use. And please calibrate the sensor for the first time. For details, please refer to Wiki: (https://wiki.dfrobot.com/Gravity__Infrared_CO2_Sensor_For_Arduino_SKU__SEN0219#target_4)

2. This carbon dioxide sensor has undergone product replacement, and the communication method has changed from analog(V1) to PWM(V2). Please check your sensor version. If it is V2 version, please refer to our Wiki example, if it is V1 version, please refer to the following 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);  
}  
(If you need to use V1 sensor with 3.3V motherboard, please adjust the code to float voltage = sensorValue*(3300/1024.0);)

 

Q3:What's the output frequency of the sensor?

A3:See the pic below:

 

 

If you have other questions, just feel free to post them in our forum for consultation. We will reply them as soon as possible and improve the product FAQ gradually.