Unfortunately, none of our products qualify for the HST tax break. Go Team Canada!

How to Build a Arduino Water Irrigation System Using UNO R4

Posted by Christina M on

Finished Automatic Irrigation Project

Why bother watering your plants manually when you can build a system that does it for you?

Below is an instructional video on the process of building a water irrigation system. It shows step-by-step the components needed and how to put them together. A system like this one may be implemented on a smaller scale that being a single plant or on a larger scale say a farm. If at any point the soil is too dry, water will be distributed until ideal soil moisture is reached. 

This water irrigation project can be constructed by all levels of experience, however, those who are new to electronics and coding may benefit from assistance. 

Although this project is designed for a single plant, it can be modified for more plants - this does not come without challenges. Ensuring each of the plants are equally watered is just one of the many thoughts that come with industrializing this project. An industrial application of this project may provide high water efficiency, sustainability and conservation. In places with water scarcity, this could be a great alternative to hand watering plants. 

Arduino UNO R4. The brains of the system.

The new Arduino R4 - more powerful than before - is used in this project, and can be found on the Canada Robotix site. Canada Robotix sells a variety of electronics; such as Arduinos and raspberry pies. If you would like to make a project just like this one, please refer to the instructional video, and the parts list which can all be found within this blog post.

Parts list:

Code:

/* wet is around 550 to 635, so dry is around 790 to 840*/
int waterpump = 13;

// function that runs initation code
void setup() {

// exchange data at a rate of 9600 bits per second
Serial.begin(9600);

// configures pin 13 (waterpump) to act as an ouput
pinMode(waterpump, OUTPUT);
}

// function that runs indefinitly until you power arduino off
void loop() {

// saves the value read from analog pin A0 to the variable humidity raw
int humidityRaw = analogRead(A0);

// map() is a function, saves the mapped value
// parameters: map(value, fromLow, fromHigh, toLow, toHigh)
// takes a value from one range to another range, this proportional
// purpose most likely is the raw number cannot be understood by another hardware peice it must talk to
// so they change the range, but its proportion stays the same
int humidityReal = map(humidityRaw, 1023, 0, 0, 100);

// print the value of the humidityReal
Serial.println(humidityReal);

// wait 100 miliseconds
delay(100);

// if humidityreal is greater than 30 set value of of pin 13 to high
// means it sends votaltage will be set a voltage greater than 0
if (humidityReal > 30) {
digitalWrite(waterpump, HIGH);
// if not greater set pin 13 to low so its voltage will be set to 0v
} else {
digitalWrite(waterpump, LOW);
}
}

        

Share this post



← Older Post Newer Post →


Leave a comment

Please note, comments must be approved before they are published.