Watermark Sensor Values

Sensor_artist
Posts: 8
Joined: Thu Oct 04, 2018 2:09 pm
Company: Adam Gibney

Watermark Sensor Values

Post by Sensor_artist » Thu Oct 04, 2018 3:14 pm

Hello,

I have the Plug and Sense Smart Agriculture package. I have been running a specific test code for the last two months which has been working quite well.
In the last two days I have had an issue with my Soil Moisture Sensor. It keeps giving me the same reading of '8333', if I make the are around the sensor more wet, it briefly gives me a lower value (7196) but then returns to 8333.

Could you advise on what may be causing this problem please?

With thanks,

Code: Select all

/*  
 *  ------ [802_02] - send packets -------- 
 *  
 *  Explanation: This program shows how to send packets to a gateway
 *  indicating the MAC address of the receiving XBee module 
 *  
 *  Copyright (C) 2016 Libelium Comunicaciones Distribuidas S.L. 
 *  http://www.libelium.com 
 *  
 *  This program is free software: you can redistribute it and/or modify 
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or 
 *  (at your option) any later version. 
 *  
 *  This program is distributed in the hope that it will be useful, 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 *  GNU General Public License for more details. 
 *  
 *  You should have received a copy of the GNU General Public License 
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 *  
 *  Version:           3.0
 *  Design:            David Gascón 
 *  Implementation:    Yuri Carmona
 */
 
#include <WaspXBee802.h>
#include <WaspFrame.h>
#include <WaspSensorAgr_v30.h>

// Destination MAC address
//////////////////////////////////////////
char RX_ADDRESS[] = "0013A200416CC927";
//////////////////////////////////////////
// Define the Waspmote ID
char WASPMOTE_ID[] = "node_01";

// define variable
uint8_t error;
float battery;
float volt;
float watermark2;
float temp;
int waterint;
//String str = "hello";
uint32_t luxes = 0;
watermarkClass wmSensor2(SOCKET_2);

void setup()
{
  // init USB port
  USB.ON();
  USB.println(F("Sending packets example"));
  
  // store Waspmote identifier in EEPROM memory
  frame.setID( WASPMOTE_ID );
  
  // init XBee
  xbee802.ON();
  Agriculture.ON();
}


void loop()
{
  ///////////////////////////////////////////
  // 1. Create ASCII frame
  ///////////////////////////////////////////  
 USB.ON();
  xbee802.ON();
  Agriculture.ON();
  frame.setID( WASPMOTE_ID );
 
  // create new frame
 // frame.createFrame(ASCII);  
  luxes = Agriculture.getLuxes(OUTDOOR);
  temp = Agriculture.getTemperature();
  // add frame fields
  //frame.addSensor(SENSOR_STR, "new_sensor_frame");
  //frame.addSensor(SENSOR_BAT, PWR.getBatteryLevel()); 
  
  
  //WATERMARK
  USB.println(F("Wait for Watermark 2..."));  
  watermark2 = wmSensor2.readWatermark();    
  waterint =  (int) watermark2;
  USB.print(F("Watermark 2 - Frequency: "));
  USB.print(watermark2);
  USB.println(F(" Hz"));  
//Change to String
  char waterx[20];
  Utils.float2String (watermark2, waterx, 0);
  USB.println(waterx);

  //Luxes
 luxes = Agriculture.getLuxes(OUTDOOR);
 USB.print(F("Luxes: "));
  USB.print(luxes);
  USB.println(F(" lux"));
  char luxesx[20];
  Utils.float2String (luxes, luxesx, 0);
  USB.println(luxesx);

  //Temp
 USB.print(F("Temperature: "));
  USB.print(temp);
  USB.println(F(" Celsius"));
  char tempx[20];
  Utils.float2String (temp, tempx, 0);
  USB.println(tempx);
  
  //Battery 
  USB.print(F("Battery Level: "));
  USB.print(PWR.getBatteryLevel(),DEC);
  USB.println(F(" %"));
  battery = PWR.getBatteryLevel(),DEC;
  char batteryx[20];
  Utils.float2String (battery, batteryx, 0);
  USB.println(batteryx);
  
  USB.print(F(" | Battery (Volts): "));
  USB.print(PWR.getBatteryVolts());
  USB.println(F(" V"));
  volt = PWR.getBatteryVolts();
  char voltx[20];
  
  USB.println(voltx);
  Utils.float2String (volt, voltx, 1);
  USB.println(F("send"));

// char data [] = "hello";
 error =  xbee802.send( RX_ADDRESS, "a");
  USB.println(F("send a"));

 delay(500);
  error =  xbee802.send( RX_ADDRESS, waterx);
   delay(500);
   error =  xbee802.send( RX_ADDRESS, "b");
   USB.println(F("send b"));
 delay(500);
  error =  xbee802.send( RX_ADDRESS, luxesx);
  delay(500);
   error =  xbee802.send( RX_ADDRESS, "c");
   USB.println(F("send c"));
 delay(500);
 
  error =  xbee802.send( RX_ADDRESS, tempx);
delay(500);
   error =  xbee802.send( RX_ADDRESS, "d");
   USB.println(F("send d"));
 delay(500);
  error =  xbee802.send( RX_ADDRESS, batteryx);
  delay(500);
   error =  xbee802.send( RX_ADDRESS, "e");
   USB.println(F("send e"));
 delay(500);
 error =  xbee802.send( RX_ADDRESS, voltx);
delay(500);
error =  xbee802.send( RX_ADDRESS, "s");
USB.println(F("send s"));




error =  xbee802.send( RX_ADDRESS, "z");
USB.println(F("send z"));
 
 
 
  
  ///////////////////////////////////////////
  // 2. Send packet
  ///////////////////////////////////////////  

  // send XBee packet
 // error = xbee802.send( RX_ADDRESS, frame.buffer, frame.length );   
  
  // check TX flag
  if( error == 0 )
  {
    USB.println(F("send ok"));
    
    // blink green LED
    Utils.blinkGreenLED();
    
  }
  else 
  {
    USB.println(F("send error"));
    
    // blink red LED
    Utils.blinkRedLED();
  }

USB.println(F("enter deep sleep"));
 PWR.deepSleep("00:00:05:00",RTC_OFFSET,RTC_ALM1_MODE1,ALL_OFF);
USB.ON();
  USB.println(F("\nwake up"));

  // After wake up check interruption source
  if( intFlag & RTC_INT )
  {
    // clear interruption flag
    intFlag &= ~(RTC_INT);
    
    USB.println(F("---------------------"));
    USB.println(F("RTC INT captured"));
    USB.println(F("---------------------"));
    Utils.blinkLEDs(300);
    Utils.blinkLEDs(300);
    Utils.blinkLEDs(300);
  }

  // wait for five seconds
  delay(5000);
}


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

Re: Watermark Sensor Values

Post by libelium-dev » Fri Oct 05, 2018 9:53 am

Hi,

What APi did you use to upload the code to the code?

Could you please sahre with us the output through the serial monitor?

Also please test the sensor using the example code to read it, so we will discard any bug in the code.
http://www.libelium.com/development/was ... r-reading/

Regards

Sensor_artist
Posts: 8
Joined: Thu Oct 04, 2018 2:09 pm
Company: Adam Gibney

Re: Watermark Sensor Values

Post by Sensor_artist » Fri Nov 30, 2018 4:02 pm

Hello,

Thanks for getting back to me and sorry for my late reply, I was away from this project for several weeks.

I uploaded the code via API v035.

I just uploaded the test code as advised. I have placed the sensor in a cup of water to see the maximum hz, and now it is at 7352 hz. Please see image attached. This is strange as when it was dryer it was stuck on 8333 hz. Any ideas as to why this might be happening, it is not very reliable in this state.

Thanks,

Adam

https://drive.google.com/file/d/1Zw8ism ... sp=sharing

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

Re: Watermark Sensor Values

Post by libelium-dev » Mon Dec 03, 2018 3:29 pm

Hi Adam,

It is a weird issue. The sensor should return low Hz values when it is dry. Could you perform the test again? Could you please share a video with that behavior?

Did you test the sensor in another socket?

Do you have v12 or v15 devices?

Regards

Sensor_artist
Posts: 8
Joined: Thu Oct 04, 2018 2:09 pm
Company: Adam Gibney

Re: Watermark Sensor Values

Post by Sensor_artist » Mon Dec 03, 2018 4:45 pm

Hello,

Please find the video attached. The sensor is not completely dry or wet at the start of the video.

I am using the V30 devices. I have tried another socket, and I seem to be getting the same readings.

https://drive.google.com/file/d/1my6PNT ... sp=sharing

Thanks


Adam

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

Re: Watermark Sensor Values

Post by libelium-dev » Tue Dec 04, 2018 10:09 am

Hi,

The sensor is wet internally. You have to wait hours up to the sensor was dry again.

Regards

Sensor_artist
Posts: 8
Joined: Thu Oct 04, 2018 2:09 pm
Company: Adam Gibney

Re: Watermark Sensor Values

Post by Sensor_artist » Thu Dec 06, 2018 2:29 pm

Hello,

I understand that. Could you please tell me what the maximum output hz should be when completely wet.

Thanks

Sensor_artist
Posts: 8
Joined: Thu Oct 04, 2018 2:09 pm
Company: Adam Gibney

Re: Watermark Sensor Values

Post by Sensor_artist » Mon Dec 10, 2018 3:18 pm

Hello,

So I let the sensor dry out, it has been dry four days and it is giving a value of 588. This sensor is not giving reliable readings. Its maximum wetness also changes from week to week.

Please advise,

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

Re: Watermark Sensor Values

Post by libelium-dev » Mon Dec 10, 2018 3:47 pm

Hi,

Apologies for our delay answering, the Libelium facilities was closed for national holidays.

The maximum output Hz should be between 7000-10000 Hz. It depends on each sensor.

What maximum values do you get each day? How much do the values vary? Do you have another watermark sensor to compare the behavior?

Regards

Sensor_artist
Posts: 8
Joined: Thu Oct 04, 2018 2:09 pm
Company: Adam Gibney

Re: Watermark Sensor Values

Post by Sensor_artist » Mon Dec 10, 2018 6:14 pm

Hello,

Since my last post, the dry sensor's reading went up rather than down to about 650 hz. I tested this on the three sockets.

Please see my video attached which shows this. The video also shows the sensor being immersed in water and then giving a reading of nearly 6000hz almost five mins later.

These maximum values seem to change by a couple of thousand hz each week. This sensor is giving unreliable readings. If you read my first post, the first problem was it was stuck on 8333 when in a dryer state than now.

I do not have another sensor to compare the behaviour.

I really need to sort this out as soon as possible please. This will be used to partly control a public art commission which is launching soon.

https://drive.google.com/file/d/1clX4zb ... sp=sharing

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest