User Tools

Site Tools


en:co2

CO2

This page is focused on measuring CO2 concentration in the air.

CDM4161

CDM4161 is precalibrated CO2 sensor made by figaro company. It has measuring range 400-4000ppm. Sensor is 3-pin conected. Voltage input (5V), GND, and output voltage which increasing linearly with gas concentration. Output voltage is in range 0,4-4 volts and multiplying it by 1000 we get CO2 concentration in ppm.

data sheet

Code example:

CO2.ino
#define CO2_input A4
 
float CO2;
 
void setup()  { 
Serial.begin(9600);
delay(2000);
}
 
void loop(){
CO2=CO2_read(CO2_input);
Serial.print(CO2 concentration in ppm:);
Serila.println(CO2);
delay(1000);
}
 
 
float CO2_read(int pin){
float value=((double)analogRead(pin)*5000)/1024; //to get reading in ppm
return value; 
}
en/co2.txt · Last modified: 2018/01/29 10:12 (external edit)