vmandin:
How can I calculate PPM. If my analog output voltage is 0-4V? and the sensitivity of the CO2 sensor is 0-2000PPM? Pls help!
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)
You'll need to use unsigned long arithmetic to avoid overflow, e.g. this code:
unsigned int ppm = ((unsigned long)analogRead(pin) * 2500)/1024;