Pieter Blok is a researcher at PlantRe­search BV in the Nether­lands. He devel­oped this auto­mat­ic water­ing sys­tem to keep a his con­tain­er gar­den of spe­cial­ty pep­pers ade­quate­ly watered. The sys­tem has a water bar­rel and pump, con­trolled by an Arduino unit that reads a soil humid­i­ty sen­sor in a pep­per pot. When the soil humid­i­ty gets below a thresh­old, it turns on the pump until a humid­i­ty ceil­ing is reached.

[youtube_sc url=http://www.youtube.com/watch?v=V9qFkgEUruU&feature=youtu.be]

To make the sys­tem, Pieter used:

Here’s a dia­gram of the con­trol setup:

Soil moisture_bb

 

Code:

/*—–( Import need­ed libraries )—–*/
/*—–( Declare Con­stants )—–*/
#define RELAY_ON 0
#define RELAY_OFF 1
/*—–( Declare objects )—–*/
/*—–( Declare Vari­ables )—–*/
#define Relay_1  2  // Arduino Dig­i­tal I/O pin num­ber

int input­Pin = 5;
int val­ue = 0;
int coun­ter = 0;

void setup()
{
Serial.begin(9600);
//——-( Ini­tial­ize Pins so relays are inac­tive at reset)—-
digitalWrite(Relay_1, RELAY_OFF);

//—( THEN set pins as out­puts )—-
pinMode(Relay_1, OUTPUT);
delay(4000); //Check that all relays are inac­tive at Reset
}

void loop()
{
val­ue = analogRead(inputPin);
if (coun­ter < 60)
{
if (val­ue >= 550 && val­ue <= 1000)
{
Serial.println(“Switch pump on”);
coun­ter = counter+5;
Serial.println(counter);
digitalWrite(Relay_1, RELAY_ON);// set the Relay OFF
delay(4000); // wait see all relays OFF
}
else
{
Serial.println(“Switch pump off”);
digitalWrite(Relay_1, RELAY_OFF);// set the Relay OFF
delay(4000); // wait see all relays OFF
}
Serial.println(value);
delay(1000);
}
else
{
Serial.println(“Maximum liters already pumped (33 ml)”);
digitalWrite(Relay_1, RELAY_OFF);// set the Relay OFF
delay(4000); // wait see all relays OFF
}
}

Leave a Reply