Soil Moisture Sensor
Posted: Mon Apr 28, 2014 3:37 pm
Hi,
I have a soil moisture Sensor,

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 ?
thank you ,
[/size][/color][/b]
I have a soil moisture Sensor,
and i want to read from DO (Digital Output) "without ADC", but i cant do
_______________________
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);
}
[/size][/color][/b]