Author Topic: Soilwatch 10 ( 3V output) on Dragino minidev  (Read 8725 times)

gerardvtk

  • Newbie
  • *
  • Posts: 10
Soilwatch 10 ( 3V output) on Dragino minidev
« on: February 09, 2018, 07:08:10 AM »
Hi used your sketch but the Dragino mini dev is an ATMega328P, so my output first was always 1023. I changed the analogReference to DEFAULT. Now I see a value of 560. What should be my next step to get the soil moisture reading on the right level?
thanks

gerardvtk

  • Newbie
  • *
  • Posts: 10
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #1 on: February 09, 2018, 01:01:12 PM »
By the way I also this with an Arduino uno. I do something wrong? regards

pinolec

  • Administrator
  • Jr. Member
  • *****
  • Posts: 99
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #2 on: February 10, 2018, 12:44:26 AM »
Hi,

I assume you get readings in between 0-560. That is exactly how it should be. With  DEFAULT reference you measure 0-1023 which correspond to 0-5V. So 5/1023*560 equals 2.74V. See updated example for SoilWatch 10 below:

Code: [Select]
/*
SoilWatch 10 soil moisture sensor example
 
Reads analog value of soil moisture sensor and displays it
on serial port.
 
The circuit:
* Sensor output (white wire) connect to Analog A0 on Arduino.
Connect VCC (brown wire) to 3.3V or 5V on Arduino (3.3V gives more stable readings)
Connect GND (green wire) to GND on Arduino.
 
created 30 Aug. 2017
last update 9 Feb 2018
by Piotr Trembecki
https://pino-tech.eu/sw10
 
This example code is in the public domain.
 
*/

/*
******** SETUP ********

 For 1.1V version set is1V1Output to true. A usual maxADC value will be around 1000.
 For 3V version set is1V1Output to false. A usual maxADC value will be around 600.

***********************
*/
const int analogInPin = A0;           // Analog input pin that the sensor output is attached to (white wire)
int minADC = 0;                       // replace with min ADC value read in air
int maxADC = 600;                     // replace with max ADC value read fully submerged in water
bool is1V1Output = false;             // set true if 1.1V output sensor is used for 3V set to false

 
int moistureValue, mappedValue;
 
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);

if(is1V1Output == true)
  analogReference(INTERNAL); //set ADC reference to internal 1.1V
}
 
void loop() {
// read the moisture value:
moistureValue = analogRead(analogInPin);
 
// print ADC results to the serial monitor:
Serial.print("ADC = " );
Serial.print(moistureValue);
Serial.print(", " );

mappedValue = map(moistureValue,minADC,maxADC, 0, 100);

// print mapped results to the serial monitor:
Serial.print("Moisture value = " );
Serial.println(mappedValue);
 
// wait 500 milliseconds before the next loop
delay(500);
}

Please let me know if this sorted out your issue.

gerardvtk

  • Newbie
  • *
  • Posts: 10
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #3 on: February 10, 2018, 06:20:49 AM »
thank you for your fast reply,

yes I see now better values like:
ADC=305 moisture value =47.
But I still think that this moisture value is too high.
A vol percentage of 47% is very wet. With 47% you can almost feel the water in the soil.

I have experience with the Stevens Hydraprobe and the AT WET sensor and their values are lower.

Your Soilwatch is now in the soil of a plant in house. Is their somewhere a reference ?

thank you.

pinolec

  • Administrator
  • Jr. Member
  • *****
  • Posts: 99
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #4 on: February 10, 2018, 12:32:55 PM »
The readings you get are not absolute values. If you like to get the volumetric content of water you will need to calibrate the sensor yourself against known volumetric values and apply math to convert them. The response of the sensor is not linear. We don't have response curves for sensors. I don't have any experience with Hydra Probe but I think it is a completely different league.

So to summarise 47 is not volumetric content it's just 47% of the sensor measuring range.

We are working to get approximate sensor calibration curves. We will release them soon.

Thanks

gerardvtk

  • Newbie
  • *
  • Posts: 10
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #5 on: February 10, 2018, 09:12:46 PM »
thank you for your answer.

gerardvtk

  • Newbie
  • *
  • Posts: 10
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #6 on: February 11, 2018, 11:01:12 AM »
Hi, I did some calibration with a WET sensor. Not yet enough measureure points in the low area. In the low area this will give a negative situation, so I think it is not liniair in that part

But the first results ( with help of scatter cards Excel) here:

MoistureValue >180
MoistureVolume =(0.0667*moistureValue)-5.9556

MoistureValue <=180
MoistureVolume= 0.00009*pow(moistureValue,2)-(.0223*moistureValue)*1.1629




regards


pinolec

  • Administrator
  • Jr. Member
  • *****
  • Posts: 99
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #7 on: February 15, 2018, 11:51:17 AM »
Hi,

Thanks for posting your work. I didn't try it yet but it looks promising. I think in future we will try to base conversion on mapped values. It will be more flexible approach as every sensor have slightly different range. So first you set sensor range and then map it to some constant range 0-100 or better 0-1000 and then apply conversion math.
Great job, keep it up.

regards,
Piotr

gerardvtk

  • Newbie
  • *
  • Posts: 10
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #8 on: February 16, 2018, 01:45:25 PM »
Hi Piotr, just started again with sand. The different soils needs a different setting. I like to use your SoilWatch on golfgreens in combinations with a lorawan node. regards

gerardvtk

  • Newbie
  • *
  • Posts: 10
Re: Soilwatch 10 ( 3V output) on Dragino minidev
« Reply #9 on: February 16, 2018, 03:00:57 PM »
More data today.