CO2 sensor caexecutelibration

Post Reply
Prsindia
Posts: 18
Joined: Fri Oct 06, 2017 6:49 am
Company: PRSIPL

CO2 sensor caexecutelibration

Post by Prsindia » Fri Feb 23, 2018 1:15 pm

HI,
I am using waspmote pro v1.5, waspmote gas sensor board v3.0 and TGS4161 for reading CO2 gas. I have executed the code but i am getting CO2 ppm around 20 to 100 in fresh air. actually it should be around 350PPM(I think so). what was the problem? i have used the code GA_V30_03_CO2_sensor reading from example codes in waspmote IDE.

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

Re: CO2 sensor caexecutelibration

Post by libelium-dev » Mon Feb 26, 2018 10:03 am

Hi,

Could you share with us some images of the gases board with the sensor plugged on?

You need to calibrate the sensor to get more accurate values. You should put the sensor in a place of know CO2 concentrations and replace the voltage obtained.

Code: Select all

// Concentratios used in calibration process (PPM Values)
#define POINT1_PPM_CO2 350.0  //   <-- Normal concentration in air
#define POINT2_PPM_CO2 1000.0
#define POINT3_PPM_CO2 3000.0

// Calibration vVoltages obtained during calibration process (Volts)
#define POINT1_VOLT_CO2 0.300
#define POINT2_VOLT_CO2 0.350
#define POINT3_VOLT_CO2 0.380
Regards

Prsindia
Posts: 18
Joined: Fri Oct 06, 2017 6:49 am
Company: PRSIPL

Re: CO2 sensor caexecutelibration

Post by Prsindia » Tue Feb 27, 2018 6:23 am

Hi
Here i am attaching the pics of gases board with sensor connected along with the output.

https://ibb.co/nR4v2c
https://ibb.co/b1xR8H
https://ibb.co/f9Qra

Prsindia
Posts: 18
Joined: Fri Oct 06, 2017 6:49 am
Company: PRSIPL

Re: CO2 sensor caexecutelibration

Post by Prsindia » Tue Feb 27, 2018 6:53 am

And the code i have used is

Code: Select all

// Library include
#include <WaspSensorGas_v30.h>
#include <WaspFrame.h>

// CO2 Sensor must be connected physically in SOCKET_2
CO2SensorClass CO2Sensor;

// Concentratios used in calibration process (PPM Values)
#define POINT1_PPM_CO2 350.0  //   <-- Normal concentration in air
#define POINT2_PPM_CO2 1000.0
#define POINT3_PPM_CO2 3000.0

// Calibration vVoltages obtained during calibration process (Volts)
#define POINT1_VOLT_CO2 0.300
#define POINT2_VOLT_CO2 0.350
#define POINT3_VOLT_CO2 0.380

// Define the number of calibration points
#define numPoints 3

float concentrations[] = { POINT1_PPM_CO2, POINT2_PPM_CO2, POINT3_PPM_CO2 };
float voltages[] =       { POINT1_VOLT_CO2, POINT2_VOLT_CO2, POINT3_VOLT_CO2 };

char node_ID[] = "CO2_example";

void setup()
{    
  // Configure the USB port
  USB.ON();
  USB.println(F("CO2 Sensor reading for v30..."));

  // Calculate the slope and the intersection of the logarithmic function
  CO2Sensor.setCalibrationPoints(voltages, concentrations, numPoints);
  
  ///////////////////////////////////////////
  // 1. Turn on the board and the SOCKET
  /////////////////////////////////////////// 
  
  // Switch ON and configure the Gases Board
  Gases.ON();  
  // Switch ON the CO2 Sensor SOCKET_2
  CO2Sensor.ON();
}

void loop() 
{
  ///////////////////////////////////////////
  // 2. Read sensors
  ///////////////////////////////////////////  

  // Voltage value of the sensor
  float CO2Vol = CO2Sensor.readVoltage();
  // PPM value of CO2
  float CO2PPM = CO2Sensor.readConcentration();

  // Print of the results
  USB.print(F("CO2 Sensor Voltage: "));
  USB.print(CO2Vol);
  USB.print(F("volts |"));
  
  USB.print(F(" CO2 concentration estimated: "));
  USB.print(CO2PPM);
  USB.println(F(" ppm"));

  ///////////////////////////////////////////
  // 3. Create ASCII frame
  /////////////////////////////////////////// 
  
  // Create new frame (ASCII)
  frame.createFrame(ASCII, node_ID);
  // Add CO2 PPM value
  frame.addSensor(SENSOR_GASES_CO2, CO2PPM);
  // Show the frame
  frame.showFrame();
  
  delay(1000);
}

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

Re: CO2 sensor caexecutelibration

Post by libelium-dev » Tue Feb 27, 2018 9:20 am

Hi,

The boards and code seem good. You should calibrate the sensor to get accurate values. If you change the volt points you will see how the CO2 values change.

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest