Go Down

Topic: How to convert sensor readings to PPM? (Read 646 times) previous topic - next topic

vmandin

Hi guys! I have a CO2 sensor that has an analog output voltage of 0-4V which corresponds to 0-2000 PPM.

How can I display the Correct PPM units? Im getting around 1.15V as the lowest value? How can I get around 400PPM?

Pls help

bubulindo

4V = 2000PPM
1,15 = X

X = (1,15 * 2000) / 4 = 575 PPM.

Do you have another instrument, preferably calibrated, to verify how much CO2 you actually have?
This... is a hobby.

vmandin

No I dont have one. How is that formula youve given, translated into arduino code? Pls supply pseudo code sir.

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

retrolefty


Hi guys! I have a CO2 sensor that has an analog output voltage of 0-4V which corresponds to 0-2000 PPM.

How can I display the Correct PPM units? Im getting around 1.15V as the lowest value? How can I get around 400PPM?

Pls help


The map() function is your friend.
So something like this should work:

Code: [Select]
rawReading = analogRead(sensorPin);
ScaledReading = map(rawReading, 0, 820, 0, 2000);


Go Up