adnenyak
Posts: 15
Joined: Tue Mar 25, 2014 5:26 pm

Soil Moisture Sensor

Mon Apr 28, 2014 3:37 pm

Hi,
I have a soil moisture Sensor,
Image

and i want to read from DO (Digital Output) "without ADC", but i cant do :(, when i read a value from GPIO3 i get 1,
_______________________
I have a arduino Code if any one can help me ?
:( :( :( :( :( :(

Code: Select all

// Soil Moisture Sensor Hygrometer example code
// Code author:  aafent. This code is copy free, if you want please mention the author's name and/or the site
//Interface Description (4-wire)
//VCC: 3.3v-5v
//GND: GND
//DO: Digital output interface (0 and 1) threshold taken from potentiometer
//AO: Analog output interface

const int moistureAO = 1;
const int moistureDO = 31;

int AO = 0;
int DO = 0;
int tmp = 0;

void setup (){
  Serial.begin(9600);
  Serial.println("Soil moisture sensor");
  pinMode(moistureAO, INPUT);
  pinMode(moistureDO, INPUT);
}

void loop ()
{
  tmp=analogRead( moistureAO );
  if ( tmp != AO ) 
  {
    AO=tmp;
    Serial.print("A=");
    Serial.println(AO);
  }
  
  tmp=digitalRead( moistureDO );
  if ( tmp != DO ) 
  {
    DO=tmp;
    Serial.print("D=");
    Serial.println(DO);
  }
  
  
  delay (1000);

}
thank you ,
[/size][/color][/b]

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Soil Moisture Sensor

Mon Apr 28, 2014 3:40 pm

Hi,
adnenyak wrote:I have a soil moisture Sensor
Please provide link to its data specification.

BTW: Are you from India ?


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

adnenyak
Posts: 15
Joined: Tue Mar 25, 2014 5:26 pm

Re: Soil Moisture Sensor

Mon Apr 28, 2014 3:48 pm

Feature:
1).This is a simple water sensor ,can be used to detect soil moisture .Module Output is high level when the soil moisture deficit,or output is low.Can be used in module plant waterer device, and the plants in your garden no need people to manage.
2).Adjustable sensitivity by adjusting the digital potentiometer (shown in blue)
3).Operating voltage:3.3V~5V
4).Dual output mode,analog output more accurate.
5).A fixed bolt hole for easy installation
6).Panel PCB Dimension: 30mm * 16mm
7).Soil Probe Dimension:60mm*30mm
8).With power indicator (red) and digital switching output indicator (green)
9).Having LM393 comparator chip, stable
Pin definition

Pin Definition
VCC 5V
GND GND
DO Digital output interface (0 and 1)
AO Analog output interface


I'm From TUNISIA :)

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Soil Moisture Sensor

Mon Apr 28, 2014 3:58 pm

Hi,

I hope you either:
- supply the sensor from 3.3V, or,
- supply it from 5V and decrease signal output voltage to meet 3.3V limit of GPIO input pin.

My next step would be to check with a voltmeter that a voltage level on DO pin is actually following moisture change (that the sensitivity is adjusted properly).

adnenyak wrote:I'm From TUNISIA :)
Ups, my wrong assumption... when people are annoying with huge bold colored text, there is a high probability that they are from India.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

adnenyak
Posts: 15
Joined: Tue Mar 25, 2014 5:26 pm

Re: Soil Moisture Sensor

Mon Apr 28, 2014 4:01 pm

Not Very Helpful,
i already do that :(

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Soil Moisture Sensor

Mon Apr 28, 2014 4:11 pm

Hi,
adnenyak wrote:Not Very Helpful,
i already do that :(
Ok, then check the code... leave the sensor disconnected and away for the moment.

Take a piece of wire and connect GPIO input pin with +3.3V pin. Check that a code returns "1".
Then connect this GPIO input pin to GND and check that code returns "0".
If the result is not as expected, the problem is in code. If the problem is as expected, then the issue is with the sensor board or its connection to GPIO pins.

To be on a safe side, you could use 1k resistor instead of piece of wire.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

Return to “Automation, sensing and robotics”