Post a new topicPost a reply Page 1 of 1   [ 9 posts ]
Author Message
 Post subject: Watermark
PostPosted: Fri May 04, 2012 4:50 pm 

Joined: Mon Apr 02, 2012 4:43 pm
Posts: 13
Hello Libelium,

Can you give me please a complete guide to know how read the watermark sensor? I have already Watermark Sensors Interpretation Reference but I need more information about that. I know that watermark give me frequency, but for example, I have 50Hz, 344Hz but I don't know what is the equivalent in cb, and the guide that I have show me that it is out of range.

Regards.


Top
 Profile  
 
 Post subject: Re: Watermark
PostPosted: Mon May 07, 2012 9:47 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7818
Hi lorena0831,

The value in centibars may be extracted from the equations in the reference guide. Could you please tell us what values are you getting and how are you testing the sensor?

Regards.


Top
 Profile  
 
 Post subject: Re: Watermark
PostPosted: Tue May 08, 2012 12:19 pm 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
Hi,
i want to ask, could i make interruption to wake up the waspmote from sleep/deepsleep mode, using a threshold for the watermark?

and also could XBee modules wake up the micro when it recieves a packet, like the GPRS?

thanks


Top
 Profile  
 
 Post subject: Re: Watermark
PostPosted: Tue May 08, 2012 1:34 pm 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
and also how to set the threshold for watermark (soil moisture sensor) in order to wake the waspmote from sleep mode? because i tried to use the threshold function but an error said that this function is not a member in its class.

My objective is to have a program that would wake the waspmote up in three cases: either in critical battery situation, a XBee communication, or a sensor passing the threshold value. this node should be placed in a greenfield to indicate when the water level in the soil drops, or the battery goes down, or there's another node trying to communicate with this node for any reasons.

here's my code:

void setup()
{
// Init USB
USB.begin();
USB.println("Start Program");

// Init RTC
RTC.ON();
RTC.setTime("12:5:8:3:10:40:00");

SensorAgr.setBoardMode(SENS_ON);


// SensorAgr.setAnemometerThreshold(THRESHOLD)

// Inits the XBee ZigBee library
xbeeZB.init(ZIGBEE,FREQ2_4G,NORMAL);

// Powers XBee
xbeeZB.ON();

xbeeZB.setAPSencryption(XBEE_OFF);

delay(2000);

PWR.setLowBatteryThreshold(0.2);
SensorAgr.setThreshold(SENS_AGR_WATERMARK_1, 150);
enableInterrupts(UART0_INT);
enableInterrupts(SENS_INT);
enableInterrupts(BAT_INT);


}

void loop()
{
SensorAgr.setSensorMode(SENS_ON, SENS_AGR_WATERMARK_1);
delay(2000); //wa
float value_soil_humidity_1 = 0;
value_soil_humidity_1 = SensorAgr.readValue(SENS_AGR_WATERMARK_1);
delay(20000);

// RTC.setAlarm1 ("00:00:00:10",RTC_OFFSET,RTC_ALM1_MODE1);
PWR.sleep(UART1_OFF | RTC_OFF);

if( intFlag & UART0_INT)
{
// USB.begin();
USB.println ("Micro is open because of XB");
}

if (intFlag & SENS_INT)
{
// USB.begin();
USB.println ("Micro is open because of Sensors");
USB.println ("the soil moisture level is:");
USB.println (value_soil_humidity_1);

}

if (intFlag & BAT_INT)
{
// USB.begin();
USB.println ("Micro is open because of Battery");
}

}


Top
 Profile  
 
 Post subject: Re: Watermark
PostPosted: Tue May 08, 2012 4:19 pm 

Joined: Thu Feb 23, 2012 4:32 pm
Posts: 32
You can use the following snippet to get a watermark reading and convert it to cb.
Code:
//get soilmoist reading and convert to cb
uint16_t SoilMoisture_readValue(void){
  uint16_t freq=0;

  //get the frequency reading
  freq=SensorAgr.readValue(SENS_AGR_WATERMARK_1);

  //convert frequency to centibar
  uint16_t cb=0;
  cb=(150940 - 19.74*freq)/(2.8875*freq - 137.5);

  return cb;
}


Top
 Profile  
 
 Post subject: Re: Watermark
PostPosted: Tue May 08, 2012 6:14 pm 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
thanks a lot aggelos for the help.

Do u know about the threshold thing, and consequently waking up the waspmote from its sleep mode?


Top
 Profile  
 
 Post subject: Re: Watermark
PostPosted: Tue May 08, 2012 8:39 pm 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
i'm having a problem that after this equation, the cb evaluates to a negative value!! does anyone know why?


Top
 Profile  
 
 Post subject: Re: Watermark
PostPosted: Wed May 09, 2012 9:54 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7818
Hi Smart Agriculture,

I'm afraid it is not possible to configure an interruption from the Watermark sensor, that option was not implemented in the design of the board.

Regarding your negative values, that is owed to the linear approximation used to calculate the soil water tension from the frequency, that is only prepared to work in the operation range of the sensor, between 50Hz and 7650Hz approximately. You will get these values if you are testing your sensor in a very wet ground, recently irrigated, or by directly submerging it into water.

Regards.


Top
 Profile  
 
 Post subject: Re: Watermark
PostPosted: Wed May 09, 2012 5:56 pm 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
thanks a lot for the help


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