Introduction: Easiest Arduino Smart Plant Watering

Last time we wrote intructable on how to make an automatic plant watering system with arduino and sensors, our article gained a lot of attention and great feedback.

Afterwards, we’ve been thinking how could we make it better. It seems as our office grown also the number of flower pots in the office grown as well, and we needed a better more friendly watering solution. We came up with easy-to-make solution that will let us water up to 4 plants with one node! That’s incredible. With the previous solution we could only water 3 and also we needed them to be located one next to the other, which made it less convenient.

Our Solution: Smart Pump Shield

We got frustrated with all the jumpers and prototype boards so we came up with idea to develop our own shield. The shield contains 5 relays – 4 for the water switching mechanism and another one for the water pump, it has dedicated Crowtail interfaces for our sensors which eliminate the need for jumpers and breadboards and make the kit easy and fun to use! You can also use it as normal without Crowtail connectors for other projects you might come with!

Step 1: Gathering the Parts

Picture of Gathering the Parts

To Process this instructables we'll need to use “Crowtail smart pump kit” which the link to it can be found right

The Kit will include:

- x4 Crowtail soil moisture sensors

- x1 Crowtail Smart Pump Shield

- x1 Crowtail Water Pump

- x1 12V Adapter

- x1 Four channels water valve

- x1 one long water pipe (later we'll cut it to 6 pieces for our project)

You will also Need Crowduino Uno / Arduino Uno for the project

Why This Kit?

- Eliminate the need of breadboard and jumpers

- Less mess more productivity!

- Easy to use, just plug and play, anyone can do it!

- 12v connector for the pump and split into 5v for the arduino as well!

- Control up to 4 flowers at once with one shield!

Step 2: Uploading the Code to the Arduino Board

Picture of Uploading the Code to the Arduino Board

The next step will be uploading our code to the Arduino board,

we do it first because after connecting all the sensors and pumps it might get a little bit messy and difficult to connect, better do it now when you only have the board in your hand!

the code can be found at the bottom of this instructable, make sure that you choose Arduino Uno regarding the device you use (Arduino Or Crowduino Uno) in the ArduinoIDE.

If you are not familiar with Arduino, follow the following steps:

1. connect your Arduino board by USB to your computer

2. open Arduino IDE (if you don't have it, make sure to download it from their official website)

3. Open the project we gave at the bottom of the Instructable page

4. On top of the Arduino IDE choose "Tools > Board > Arduino UNO"

5. Click the V sign to verify the code and then right next to it the arrow-right button to push the code!

Step 3: Connecting the Shield to the Arduino Board

Picture of Connecting the Shield to the Arduino Board

Easy as it sounds - the next step will be connecting our smart pump shield to the arduino board.

NOTE: When you putting them one on top the other and connecting them together, make sure to do it slowly and easily as the Smart pump shield pins might be a bit sensitive.

After putting them together - it should look exactly as the picture below

Step 4: Connecting the Pump and the Switch

Picture of Connecting the Pump and the Switch

The Next step will be connecting our 4 channels switch that will control the water direction and the pump,

Moving to the switch:
It's difficult to miss - the switch is the biggest interface on the shield. make sure you place it at the right direction and it should *click* Now we got both pump and the switch connected to the board successfully

We'll start from the water pump:

if you look closely at your board, there are 6 crowtail interfaces aligned one with each other, this is the sensors interfaces. next to that there is one small lonely interface, smaller than the other one's - that's the pump interface.

you'll know it's the right interface when it will fit - the pump is the smallest interface between them all.

Step 5: Connecting the Soil Moisture Sensors

Picture of Connecting the Soil Moisture Sensors

The next step will be connecting the soil moisture sensors, we'll use this sensors to detect the soil level inside the plants and determine if they need water or not.

We'll connect it by using the 4 out of 6 Crowtail sensors interfaces, because we use 4/6 we can use the other two to give more advanced features to our project, few examples can be:

- adding light sensors to know if the plants get enough lights

- adding humidity sensor to detect if the humidity is alright

- temperature sensor to make sure it's not too hot or too cold

- rain sensor to detect if it's raining now and no need to water them and more ...

The order of the sensors is as following

- A0 - Flower number 1, in the switch it's the first one close to the water source interface

- A1 - Flower Number 2, in the switch it's the second one from the direction of the water source interface.

- A2 - Flower Number 3, in the switch it's the third one from the direction of the water source interface.

- A3 - Flower Number 4, in the switch it's the fourth one from the direction of the water source interface.

NOTE: Make sure it's correct else the pump will give water to the wrong flower!

Step 6: Connecting the Water Pipes

Picture of Connecting the Water Pipes

This step require to gather some scissors or knife.

we'll need to take the water pipe from the kit and cut it to 6 parts.

make sure the length is identical and better if the pipe that goes inside the water source (in our case it's a bottle of water) will be long enough to reach the water.

after we finish cutting it - it's time to connect them!

we'll connect 2 of them into our pump, one of the pump sides sucking the water while the other one pushing the water out. it might be confusing at first which one is which but if you look very very carefully on the pump it says "IN" and "OUT" the one that is "IN" should go to the water source while the one that is "OUT" should go to the switch.

After connecting the pump we'll need to wire it to our switch. the switch have 5 inputs. 4 of them are lined up, those are going directly to the flowers, the one that is on the left side, goes to the pump OUTPUT.

The switch works by closing a circuit at specific channel - it will let the water flow, if no circuit been closed, the water could not flow. we'll be opening the channels by the demand of the flowers to get water, that way - only the flowers that need in water, will get it.

Step 7: Powering It Up!

Picture of Powering It Up!

The Last step will be - Powering it up!

Now, this is one of the best features in our board. both the pump and the switch requires 12v input while the arduino can only stand 5v, so instead of supplying different power supplies to the arduino, the pump and the switch we made our shield to split the power between the arduino and the other devices. that way - the arduino will get 5v while the pump and the switch will get 12v.

NOTE: When connecting the power supply, make sure to connect it into the shield board and NOT the arduino. there is NO need in two power supplies as the shield will give power to the arduino as well.

We hope you find this instructable useful, easy and fun! we worked hard to make the most simple yet powerful kit, you can use the smart shield not only for this projects but for others too! let us know what will you make and the way you use our kit.

Comments

zumbador (author)2017-11-09

Not working for me. At first, the pump was on continuously, even if the soil was totally saturated it kept pumping. I reflashed the board and reset everything.Now the blue lights just cycle off and on. Pump no longer runs. Any ideas?

Elecrow (author)zumbador2017-11-14

Hi Zumbador,

Regarding your issue, the reason might be vary and we will need to ask some questions to deeply understand what's the reason our board didn't work for you.

first of all - did you manage to fix this issue or it's still relevant to now? if so, please contact us at support@elecrow.com and we will more than love to help you with any issue that come and solve it as fast as possible.

our guess will be it has something to do with with the way you plugged in the sensors or the board which you used as a controller.

we are looking forward to assist you! thank you!

ArtūrsG5 made it! (author)2017-10-13

Hi,

I made this solution of yours, and it is great as far as I've made it, it works, though I had some problems combining the Crowtail - smart pump shield to Genuino Uno, one of the pumps did not work, though I guess it was something to do with the voltage, did not check though. Other then that I managed to get it working with Crowduino. Thanks for this tutorial mate :)

P.S. - I had a question about some monitoring of the soil, first off how do you come up with the numbers 450 for the sensor as the optimal moment when to water the plants (though I presume that this is just a specific testing process for each plant)? Another question is about the fact of receiving the data from the moisture sensors, how I do it - I plug the Crowduinointo in to the PC, and everything is fine, the data comes in smoothly, even played around with the plotter for the Arduino IDE - fun. Though when ever I try to acquire the data from sensors and have the shield plugged in the wall so the pumps actually works, the sensors just shows the highest possible moisture, like its super sensitive, and when ever I take it out in mid air it jumps to 0, when I put it in super dry soil it shows the soil being super humid, though it is not the case.

Lastly I have added the code snippet of mine, that I combined together from your tutorial and https://chrisruppel.com/blog/arduino-soil-moisture-sensor/ tutorial, for the statistics. It might be messy, maybe, but take in consideration that I'm a beginner ;) and also some images, that aren't that attractive, since they are taken from a super weird angle - did not thought of taking picture before I put everything in place :P.

Elecrow (author)ArtūrsG52017-11-14

Hi Arturs! First of all, we are happy that you bought our kit and satisfied with it's performance, modified our code and made solution that is suitable for you!

Regarding your question.

1. about the soil moisture value that we came up with - we've been testing the soil moisture sensors for a while with multiple conditions and we came up with conclusion that 450 is optimal value for our kit to work, not too dry and not too wet, as you said - they are extremely sensitive which requires to put the right value when working with them, you could definitely modify it to the value that is more suitable for you.

2. Regarding the issue with the Genuino - we didn't test it on non crowtail or arduino boards, other boards might be vary so we highly recommend using crowtail high quality board which is made by us or official arduino uno for the best performance.

We are happy that you enjoyed it and hope to make your making easier like always!

ArtūrsG5 (author)ArtūrsG52017-10-13

Oh it seems that I cannot upload code as a file here... anyhow:

// set all moisture sensors PIN ID

const int moisture1 = A0;

const int moisture2 = A1;

const int moisture3 = A2;

const int moisture4 = A3;

// set water pump

const int pump = 2;

// Define our timer.

const int TIMER = 60; // in seconds

const int RESET = TIMER - 1;

const int SENSOR_DELAY = 10; // in milliseconds

int counter;

// declare moisture values

int moisture1_value = 0;

int moisture2_value = 0;

int moisture3_value = 0;

int moisture4_value = 0;

// set water relays

int relay1 = 3;

int relay2 = 4;

int relay3 = 5;

int relay4 = 6;

// setup

void setup() {

// declare moisture as input

pinMode(moisture1_value, INPUT);

pinMode(moisture2_value, INPUT);

pinMode(moisture3_value, INPUT);

pinMode(moisture4_value, INPUT);

pinMode(pump, OUTPUT);

// declare relay as output

pinMode(relay1, OUTPUT);

pinMode(relay2, OUTPUT);

pinMode(relay3, OUTPUT);

pinMode(relay4, OUTPUT);

// declare pump as output

pinMode(pump, OUTPUT);

// Start with sensor OFF

digitalWrite(pump, LOW);

// Setup timer.

counter = RESET;

// declare the ledPin as an OUTPUT:

Serial.begin(9600);

}

void loop() {

// If the counter is at the end of a cycle

// take a new reading and reset counter.

if (counter <= 0) {

// Turn sensor ON and wait a moment. Not turing it on now, doing it later, otherwise the pump kicks in each cycle for a millisecond and turns off again, in case there is nothing to replanish

// digitalWrite(pump, HIGH);

// delay(SENSOR_DELAY);

// read the value from the moisture sensors

moisture1_value = analogRead(moisture1);

moisture2_value = analogRead(moisture2);

moisture3_value = analogRead(moisture3);

moisture4_value = analogRead(moisture4);

// human readable plotter

Serial.print(moisture1_value);

Serial.print(" ");

Serial.print(moisture2_value);

Serial.print(" ");

Serial.print(moisture3_value);

Serial.print(" ");

Serial.println(moisture4_value);

// check which plant need water

// and open the switch for that specific plant

if(moisture1_value<=650){

digitalWrite(relay1, HIGH);

}

if(moisture2_value<=650){

digitalWrite(relay2, HIGH);

}

if(moisture3_value<=650){

digitalWrite(relay3, HIGH);

}

if(moisture4_value<=650){

digitalWrite(relay4, HIGH);

}

// make sure there is at least one plant that needs water

// if there is, open the motor

if(moisture1_value<=650 || moisture2_value<=650 || moisture3_value<=650 || moisture4_value<=650){

digitalWrite(pump, HIGH);

// let it water the plant for 5 seconds

delay(5000);

}

// turn the pump off

digitalWrite(pump, LOW);

// go each switch and turn them off

digitalWrite(relay1, LOW);

digitalWrite(relay2, LOW);

digitalWrite(relay3, LOW);

digitalWrite(relay4, LOW);

// Start new countdown.

counter = RESET;

// wait 1 sec and repeat the process | 300000 = 5 min

delay(1000);

} else {

delay(SENSOR_DELAY);

}

counter--;

delay(1000 - SENSOR_DELAY);

}

For anyone who's interested! ;)

About This Instructable

3,663views

73favorites

Bio: Elecrow is an open hardware facilitation company based in Shenzhen. We integrate resources to serve new era of innovation. To make your making and innovation ... More »
More by Elecrow:Easiest Arduino Smart Plant WateringDIY Halloween Haunted House (Arduino Project)Arduino sunflower - An electronic sundancer
Add instructable to: