How to get voltage reading into ppm

sriankit30
Posts: 11
Joined: Mon May 12, 2014 6:55 am

How to get voltage reading into ppm

Post by sriankit30 » Tue May 20, 2014 11:46 am

Dear Dev,

I am getting readings in volts for following sensors

1) Air pollutants 1
2) Calibrated NH3
3) VOCs
4) CO2

I am not an expert coding guy. I need co-relation formula to convert VOLTS into PPM.

Also i don't have facility to get sensors calibrated for my local conditions so i want to use the co-relation studies done by company to get the reading in ppm.

As i see in the document the logarithmic graph is plotted but i am not able to deduce the formulae. Kindly provide the formula to convert the readings.

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: How to get voltage reading into ppm

Post by libelium-dev » Wed May 21, 2014 8:55 am

sriankit30,

you have some useful posts here:
http://www.libelium.com/forum/viewtopic.php?f=15&t=8659

Also if you use search tab you could find other useful ones.

Which code are you using to measure the sensors?

mez118123
Posts: 1
Joined: Sat Nov 19, 2016 9:28 am

Re: How to get voltage reading into ppm

Post by mez118123 » Sat Nov 19, 2016 9:34 am

I am not able to view this link kindly help

http://www.libelium.com/forum/viewtopic.php?f=15&t=8659

libelium-dev wrote:sriankit30,

you have some useful posts here:
http://www.libelium.com/forum/viewtopic.php?f=15&t=8659

Also if you use search tab you could find other useful ones.

Which code are you using to measure the sensors?

sakshi
Posts: 7
Joined: Wed Oct 26, 2016 12:37 pm

Re: How to get voltage reading into ppm

Post by sakshi » Sat Nov 19, 2016 9:38 am

Hi There

I need help with converting CO2 sensor values in volts to ppm. The link of the thread mentioned in the above post does not open. It says I'm not authorized to readthis forum, although I'm registered on the Libelium forum.

Kindly help me with this issue or suggest an alternative info link for conversion from volts to ppm.

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: How to get voltage reading into ppm

Post by libelium-dev » Mon Nov 21, 2016 10:44 am

Hi,

That topic can not be seen because it is in a section that we no longer support.

Anyway we share with you what it says.
AmroQuandour wrote:Ok,

various topics have been mentioned regarding the interpretations of the TGS4161 which is the Carbon Dioxide sensor. I have decided to write my own tutorial to explain to you how to use the results from the Waspmote and relate them to the datasheet and graphs.

First, you need to know a few things:

1. The output of the CO2 sensor is in VOLTS.
2. The voltage under normal air concentration is 220 mV
3. EMF = sensor voltage
4. DELTA-EMF = sensor voltage - 220 mV


Now let us analyse the graph to obtain the main equation. Notice two things on CO2 graph:
1) The X-axis is given in logarithmic scale.
2) The Y-axis is standard.

These will come into play once we calculate the gradient (m), which can be calculated as follows:

* Take two points P(X,Y):

P1 = (3000, 60), P2 = (1000, 30)

Now m = ( Y2-Y1 ) / ( Log(X2) - Log(X1) ) = (30 - 60) / (Log1000 - Log3000)
: . m = 62.877

* Find b from the linear equation formed by:

y=m*log(x) + b

b = y - m*log(x)
b = 30 - 62.877*log(1000)
b = -158.631

The general equation for the concentration of CO2 in air is as follows:

y = 62.877*log(x) - 158.631

where x: ppm concentration and y: DELTA(EMF).

now we are interested in the x term, so if we re-arrange the equation we obtain:

x = 10^( (y+158.631)/62.877 )


----
Now If you take several readings using the Waspmote as I did using the code I am providing you with:

Code: Select all

float Sensor=0;

void setup()
{
  USB.begin();
  
  SensorGas.setBoardMode(SENS_ON);delay(1000);
  SensorGas.configureSensor(SENS_CO2,1);
  SensorGas.setSensorMode(SENS_ON, SENS_CO2);
}

void loop(){
  
  delay(30000);
  
  Sensor = SensorGas.readValue(SENS_CO2);
  USB.println(Sensor);
  Sensor=0;
  
} 
I obtain several readings such as:

0.0096774187
0.0064516124
0.0064516124
0.0096774187
0.0064516124


Once these values are calculated you do the following calculations:

* Finding delta-EMF:

Delta-EMF = y = Voltage(at 350 ppm) - V_(sensor)
: . y = 0.2 - 0.0096774187 = 0.1903

so Delta-EMF = 0.1903 Volts

* Apply into the linear equation to find x:

x = 10 ^ ( (0.1903 + 158.631)/62.877 ) = 335 ppm << which is the normal air concentrations.

-----

Hope you guys find this useful.
To convert from volts to ppm you can implement your own functions. The concentration may be estimated using the output graphs provided in the Gases Board Guide (v12), which correspond to the typical response of the sensors.

Regards.

sakshi
Posts: 7
Joined: Wed Oct 26, 2016 12:37 pm

Re: How to get voltage reading into ppm

Post by sakshi » Tue Nov 22, 2016 11:11 am

Thank You so much for your revert. Have been trying to access this post of yours since long. However I have a few queries:

1. The voltage under normal air concentration is assumed to be 220 mV. The datasheet provides a range between 220 mV-490mV against 350 ppm. I believe this value (voltage under normal air concentration is 220 mV) will vary from place to place.

The sensor reading as captured in a room comes out to be around 2.6-2.7V where I'm working. If I convert that to ppm with the method described above, it comes around 305-307 ppm. I doubt if the sensor is showing the right values.

2. In the method described above, the two points chosen are P1 = (3000, 60), P2 = (1000, 30), whereas as per the CO2 curve, the delta EMF against 3000 ppm isn't 60mV.

Please clarify

Thanks in advance

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: How to get voltage reading into ppm

Post by libelium-dev » Tue Nov 22, 2016 12:55 pm

Hi,

Do you configure the sensor with gain 1? What code are you using?

This post was written by a user in 2012, there may be some error. The value of 60mV is approximate. You can change it by 65.

Regards.

sakshi
Posts: 7
Joined: Wed Oct 26, 2016 12:37 pm

Re: How to get voltage reading into ppm

Post by sakshi » Wed Nov 23, 2016 6:30 am

I'm using the GA-04 code for CO2 sensor readings. Have modified the code a bit so as to obtain sensor readings in Volts as well as ppm. I'm writing the sensor readings to a file on the SD card. The GAIN value being used is 7.

As per the CO2 sensor reading curve in the datasheet, the voltage against 3000 ppm is approximately 43mV it seems. Will it be fine if I use this value?

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: How to get voltage reading into ppm

Post by libelium-dev » Wed Nov 23, 2016 1:21 pm

Hi,

Sorry for the confusion, the graph of the guide have an error. You can see the graph correct in the data sheet of the sensor. For 3000 ppm the value is 60mV.

Regards

sakshi
Posts: 7
Joined: Wed Oct 26, 2016 12:37 pm

Re: How to get voltage reading into ppm

Post by sakshi » Mon Nov 28, 2016 7:16 am

Hey

Thanks a lot! :)
Now if I have to re-calibrate the sensor, since its been long that I have this sensor with me but I have just started using it recently, I'll require sensor measurements for atleast 2 known CO2 concentrations (in ppm). Right?
With this I'll me able to plot a graph and find m and C values using y=mx+C

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest