# INTERFACING NDIR C02 MODULE WITH ARDUINO

From the previous post it is stated: "If 0V is 0ppm and 4V is 2000ppm and the device is linear and you are using the standard 5V analog reference, then:
ppm = (analog_reading * 2000 * 5)/(1024 * 4)"
I have a similar product ( i.e linear output 0 - 4 VDC, 0 ppm - 2,000ppm) , but from the graph attached , it does not measure voltage less than 1 VDC. It is possible to use the above formula?.
From the product manual, the calculation for the concentration is as follow:
Y = U/4FS i.e Y is the concentration (ppm), U is the voltage and FS is the full scale (2,000 ppm). Do I need to replace U with V which have the following formula:
V = (U
5)/(10244)and
Y = V
FS

Yes you can still use the formula

you better do the voltage (V or U) in milliVolts and use floats as integer division truncates.

Y = U/4*FS
float milliVolts = analogRead(A0) * 4.8828125; // * 5000/1024
int PPM = milliVolts /4 * 2; // 2 iso 2000 => millivolts to volts again.

Thank you for the answer, but I am confused. The answer given as follows:
"Y = U/4FS
float milliVolts = analogRead(A0) * 4.8828125; // * 5000/1024
int PPM = milliVolts /4 * 2; // 2 iso 2000 => millivolts to volts again."
At 2000 ppm , the voltage will be 4V and analogread(A0) will be 1024 , from REFERENCE. Lets substitute analogread(A0) when the ppm is 2000 with 1024
int PPM = ( 1024
5000/1024)*(2000/4000)
= 2500 ? Confused!

OK lets try again,

If 0V is 0ppm and 4V is 2000ppm

This means 500PPM per volt

If you use an EXTERNAL REFERENCE of 4Volt the formula is

``````int ppm =  analogRead(A0) * 1.955034213
``````

4Volt => 1023 * 1.955034213 => 2000

if you are using an EXTERNAL REFERENCE of 5Volt the formula is

``````int ppm =  analogRead(A0) * 2.44987775
``````

4Volt => 818*2.44987775=> 2000