Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: Air Contaminants Sensor
PostPosted: Wed Aug 31, 2011 12:26 pm 

Joined: Tue Aug 02, 2011 10:05 am
Posts: 29
Hi,

after applying TGS2602 sensor configuration, the result is 0.000000. Why is this?
Below is the simple code to help me know what happens.

void setup(){

//setup for Serial port
USB.begin();
SensorGas.setBoardMode(SENS_ON);
SensorGas.configureSensor(SENS_SOCKET2A, 1, 10);
SensorGas.setSensorMode(SENS_ON, SENS_SOCKET2A);

}


void sendmsg(){

double airpolution=0;
delay (35000);
airpolution=SensorGas.readValue(SENS_SOCKET2A);
USB.print("Air Polution: ");
USB.println(airpolution);
delay (1000);

}

void loop(){

RTC.ON();
Utils.setLED(LED0,LED_OFF);

USB.println("---------------Data----------------");

delay(1000);

sendmsg();

delay (1000);

}


And the results are:


---------------Data----------------
Air Polution: 0.0000000000
---------------Data----------------
Air Polution: 0.0000000000
---------------Data----------------
Air Polution: 0.0000000000
---------------Data----------------
Air Polution: 0.0000000000
---------------Data----------------
Air Polution: 0.0000000000
---------------Data----------------
Air Polution: 0.0000000000



Thanks.
Ana.


Top
 Profile  
 
 Post subject: Re: Air Contaminants Sensor
PostPosted: Thu Sep 01, 2011 10:20 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7516
Hi AR_39,

we have been testing your code here in Libelium and it works pretty well, you only should place the RTC.ON() just after turning on the sensor board, in the setup, or may there be some trouble in the configuration (though this is not the cause of your reading). Usually, the most likely cause of this is a wrong connection. Could you post a picture of how is your sensor connected to your board?

Regards.


Top
 Profile  
 
 Post subject: Re: Air Contaminants Sensor
PostPosted: Thu Sep 01, 2011 1:19 pm 

Joined: Tue Aug 02, 2011 10:05 am
Posts: 29
I can not post the picture.

I have the cables according to specifications, into the socket2A, VCC (5V) on the two pins left, and RL and GND on the two pins on the right.

I changed RTC.ON(), but I get the same results.


Top
 Profile  
 
 Post subject: Re: Air Contaminants Sensor
PostPosted: Thu Sep 01, 2011 3:19 pm 

Joined: Wed Nov 10, 2010 9:45 am
Posts: 271
Location: Australia
Test this code and post your results: -

Code:
void setup()
{
 
  USB.begin();
 
  SensorGas.setBoardMode(SENS_ON);
 
  SensorGas.configureSensor(SENS_SOCKET2A,1,1);
 
  SensorGas.setSensorMode(SENS_ON, SENS_SOCKET2A);
 
}

void loop()
{
  USB.println("----------------------------------------");
   
  delay(30000);
 
  float Air1 = SensorGas.readValue(SENS_SOCKET2A) ;
 
  USB.print("Air = "); USB.println(Air1);
 
  USB.println("----------------------------------------");

}



Top
 Profile  
 
 Post subject: Re: Air Contaminants Sensor
PostPosted: Fri Sep 02, 2011 9:02 am 

Joined: Tue Aug 02, 2011 10:05 am
Posts: 29
No, the results are the same. I tried another identical sensor and another plate Waspmote to check that it is hardware failure. And the results are the same in both cases. Please, help me.


Air = 0.0000000000
----------------------------------------
----------------------------------------
Air = 0.0000000000
----------------------------------------
----------------------------------------
Air = 0.0000000000
----------------------------------------
----------------------------------------
Air = 0.0000000000
----------------------------------------
----------------------------------------


Top
 Profile  
 
 Post subject: Re: Air Contaminants Sensor
PostPosted: Fri Sep 02, 2011 2:36 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7516
Hi AR_39,

thanks for your help, AmroQuandour, but we tested her code here in Libelium and it works fine, so it is not a matter of software.

Did you try another gas sensor board?

Also, regarding the position of the sensor, are you sure you placed the sensor pin as pointed in the picture of page 24 of the technical guide?

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 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