# Forum Home Renovation Water Saving Garden Ideas  Automagic pot plant waterer

## Uncle Bob

Thought I'd post up a little something that I cobbled together, an automated plant watering system.
I have some plants in pots that I need water and feed while I'm away next year. 
I have a reservoir that I mix plant food to the water. I usually just use drippers coming out from the bottom of tank, but have found them less than perfect. 
After some youtubing, I saw some ideas with using a micro controller to swtich on pumps or solenoids, and decided to go down this path.
What I've done so far isn't permanent and still needs some tweaking and expanding. 
Firstly the soil moisture level sensor is turned on, then the moisture level in the pot is read and then the Arduino micro controller compares this value against what's set in the code and decides whether or not to run the pump.
If the Arduino sees the moisture below the set threshold, it turns on a solid state relay that switches the 230v on to the pump (currently set for five seconds).
Then it sleeps for 30 minutes and repeats.  
The beauty of doing this in a micro controller is that the program can be easily changed and even more functionally added at any time. If you can program in "C" then this is easy. Lucky I can copy and paste, and understand the code enough to get by  :Smilie:   
Moisture Sensor   
Solid State relay PCB with fuse   
Bottom side of PCB. Notice the electrical isolation. You don't often see that of cheap ebay stuff.   
On the bench testing

----------


## Uncle Bob

As I said above I'm not a coder, so this is a bastardization of code found on the interwebs and portals.
Here's the code for giggles from coders  :Smilie:   

```
int led1 = 13;
int probe = 7;
int mostureSensor = 0;
 
void setup() {
 
// Serial Begin so we can see the data from the mosture sensor in our serial input window.
Serial.begin(9600);
 
// setting the led pins to outputs
pinMode(led1, OUTPUT);
pinMode(probe, OUTPUT);
}
 
// the loop routine runs over and over again forever:
void loop() 
{
 
// Power-up the probe and pause for the driver
digitalWrite(probe, HIGH);
 
delay(1000);
 
// read the input on analog pin 0:
int sensorValue = analogRead(mostureSensor);
 
// print out the value you read:
Serial.println(sensorValue);
 
if (sensorValue < 350)
{
digitalWrite(led1, HIGH);
Serial.println("Pump_Run");
delay(5000);
} 
if (sensorValue >= 350)
Serial.println("Pump_Off");
{
digitalWrite(led1, LOW);
}
 
// Power-down the probe
digitalWrite(probe, LOW);
delay(1800000); // wait half an hour
}
```

----------


## woodbe

What is the cable from under the powerpoint to the circuit board running? 240v?

----------


## Uncle Bob

5vdc to the opto-isolated Solid State relay in the top mounting block.

----------


## PlatypusGardens

I read this....   

> Notice the electrical isolation. You don't often see that of cheap ebay stuff.

   
....Then looked at this.....  

> 

  
....and was like.....   :Unsure:  Yeh that's some industrial grade plastic packaging isolation stuff you got there......      :Rofl5:

----------


## Uncle Bob

> I read this....     
> ....Then looked at this.....   
> ....and was like.....   Yeh that's some industrial grade plastic packaging isolation stuff you got there......

  Yes it is. It even came with the screws in it that are holding it down  :Wink:  
But yes, this is a prototype, just testing the operation of it currently. If it works as planned (and at this point in time I can't see any reason why it won't  :Smilie:  ), then it will get revamped into an IP56 case with water proof sockets etc.

----------


## Bros

When we go away my wife ends up losing half her pot plants as our kids who look after them kill them with kindness with to much water.

----------


## woodbe

> 5vdc to the opto-isolated Solid State relay in the top mounting block.

  So the white wire is 5v DC and the relay is actually under the powerpoint? 
This relay gadget is the one under the Powerpoint?:

----------


## Uncle Bob

Yes. In it's own box inside the mounting block.

----------

