I have been asked to make a simple carbon dioxide monitoring system. My only issue is that I am really only a programmer and have limited knowledge about electronics. In the data sheet, they have a diagram for interfacing with a external micro controller (http://cdn.shopify.com/s/files/1/0019/5952/files/Spec070426-K22-PWM_ed2-2000.pdf?1254409988
). Although I have an idea of what to do, I do not want to damage the expensive sensor in anyway and would feel more comfortable if someone reaffirmed me.
I have already poked around online and seem to have stumbled on some working code already:
unsigned long duration;
unsigned long ppm; // adding for clarity
duration = pulseIn(pin, HIGH); // get the raw reading
ppm = duration - 177000UL; // subtract the 'zero point'
ppm /= 500UL; // divide by the gain
ppm += 350UL; // add the zero point back in
Serial.print(" PPM Co2: ");
Serial.print(" Raw Sensor: ");
I am really hoping someone can give me a detailed explanation of what I need to do but any help is appreciated.