Post a new topicPost a reply Page 1 of 1   [ 8 posts ]
Author Message
 Post subject: Gain and Resistor
PostPosted: Tue Jul 19, 2011 9:44 pm 

Joined: Tue Jul 19, 2011 9:07 pm
Posts: 2
Hi,

I am a beginner to use the waspmote gas sensors. I am trying to use it to collect CO2, NO2, O3, CO, and air contaminants type 0 and 1. But I don't know where to find the documents and procedure for setting the gains and resistors for all these sensors. Could anyone give me a guide on this?

In addition, do I need to calibrate these sensors, and is there any procedure to follow?

I have tested to collect indoor CO2 level using the sensor, but all the values I got is 0.000000. I set gain as 10. Here is my code:

SensorGas.configureSensor(SENS_CO2, 10);
SensorGas.setSensorMode(SENS_ON, SENS_CO2);
USB.println("sending CO2 sensor data after 30 seconds");
delay(30000); //minimal time for CO2 sensor to update
CO2 = SensorGas.readValue(SENS_CO2);
USB.print("CO2: ");
USB.println(CO2);

Is there any problem? I notice that it mentions that the initial value is at 350ppm, does that mean any value of CO2 below 350ppm could not be measured?

Thank you very much!

Suwan


Top
 Profile  
 
 Post subject: Re: Gain and Resistor
PostPosted: Wed Jul 20, 2011 1:07 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
Hi suwanseu,

You may find information about calibration and configuration in these posts:

viewtopic.php?f=15&t=3408
viewtopic.php?f=15&t=1801
viewtopic.php?f=15&t=2764
viewtopic.php?f=15&t=392
viewtopic.php?f=15&t=2447
viewtopic.php?f=15&t=2328
viewtopic.php?f=15&t=2174
viewtopic.php?f=15&t=2093
viewtopic.php?f=15&t=2095
viewtopic.php?f=15&t=1946
viewtopic.php?f=15&t=1867
viewtopic.php?f=15&t=1828
viewtopic.php?f=15&t=1159

Although the typical range of the CO2 sensor is 350~10000ppm, since 350ppm is approximately the CO2 concentration in a normal environment, you will find an increase in the output voltage when measuring concetrations bellow that, though in the manufacturer's documentation is no information about how the sensor behaves in this situations (this means you would need to calibrate the sensor under those conditions).

Regarding the code you showed, it seems correct but we will need the rest of it to check if there is some problem before.

Regards.


Top
 Profile  
 
 Post subject: Re: Gain and Resistor
PostPosted: Wed Jul 20, 2011 5:39 pm 

Joined: Tue Jul 19, 2011 9:07 pm
Posts: 2
Thank you! Here is the complete code. Please let me know if there is any problem. By the way, for the GPS module, does it need to be outdoor to get the signal?


void setup(){
//setup for Serial port
USB.begin();

SensorGas.setBoardMode(SENS_ON);
SensorGas.setSensorMode(SENS_ON, SENS_PRESSURE);

///////////////////CO2///////////////////////////////////////////
SensorGas.configureSensor(SENS_CO2, 10); /////////gain 10 need to be calibrated
SensorGas.setSensorMode(SENS_ON, SENS_CO2);
/////////////////////////////////////////////////////////////////
}

void loop(){
delay(30000);
double humidity=0;
double temperature=0;
double air_pressure=0;
double CO=0;
double CO2=0;
double NO2=0;
double Airpollution0=0;

humidity=SensorGas.readValue(SENS_HUMIDITY);
temperature=SensorGas.readValue(SENS_TEMPERATURE);
air_pressure=SensorGas.readValue(SENS_PRESSURE);

///////////////////////////////////CO2///////////////////////////////
CO2 = SensorGas.readValue(SENS_CO2);

USB.println("---------------Data----------------");
USB.print("Humidity: ");
USB.println(humidity);
USB.print("Temperature: ");
USB.println(temperature);
USB.print("Air Pressure: ");
USB.println(air_pressure);
USB.print("CO2: ");
USB.println(CO2);
///////////////////////// reading sensors///////////////////////
}


Top
 Profile  
 
 Post subject: Re: Gain and Resistor
PostPosted: Thu Jul 21, 2011 10:30 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
Hi suwanseu,

we have tested your code (used an air pollution sensor instead of CO2, since we are out of stock of this) and everything worked fine.

It is advisable to turn on the RTC using the RTC.ON() function just after turning the board on in order to prevent possible troubles with the I2C communication.

Could you post an image of the connections of the sensors?

Regards.


Top
 Profile  
 
 Post subject: Re: Gain and Resistor
PostPosted: Fri Jul 22, 2011 12:08 pm 

Joined: Mon Jun 20, 2011 1:48 pm
Posts: 21
Hi suwanseu,

let the CO2sensor be on for quite a long time (at least 10 mints continuously). I also got initial value of CO2 just like you i.e. 0.0000 but later when it was on for at least 10 minutes continuously i got the readings.

To Libelium-dev,
Would you pls explain that RTC.on in details.. I mean why we have to do that and all?
I'm using a gas sensor board. So, is it necessary for me also to switch on the RTC just after switching on the sensor board?

Regards


Top
 Profile  
 
 Post subject: Re: Gain and Resistor
PostPosted: Fri Jul 22, 2011 12:40 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
Hi abhi123,

it is owed to the I2C handling. If the RTC is off, it takes some power supply parasitically from the SDA and SCL lines, and the communication in them may be disrupted and cause a malfunction in those devices that may take to the hanging of the mote.

Regards.


Top
 Profile  
 
 Post subject: Re: Gain and Resistor
PostPosted: Fri Jul 22, 2011 2:38 pm 

Joined: Mon Jun 20, 2011 1:48 pm
Posts: 21
ok. thanks for the reply...
then should I also switch on the RTC after switching on the sensor board?


Top
 Profile  
 
 Post subject: Re: Gain and Resistor
PostPosted: Mon Jul 25, 2011 9:21 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
Hi abhi123,

yes, you should turn the RTC on just after the sensor board always you need to use the I2C bus.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 8 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use