Agriculture Water – Ali Rostam and Suleyman Akbulut

Over watering of agricultural fields is a problem that is happening all around the world. Globally agriculture usage of water takes up around 70 % of the worlds accessible fresh water. And with this countries are starting to reach there renewable water resource limits. This mainly comes down to poor watering systems and wrong methods of watering. A lot of it is as well as crops are being over watered. This is just not a waste of water it can also cause damage to plants. If watered too much plants can drown or salt crystals can form on the surface of the soil which can cause harm to the plants and makes it hard for the ground to be fertile.

Image result for over watering of agriculture fields

The aim of our project is to prevent the over watering of the large agricultural fields. We wanted to design a product that could control how much water the plants get and that they only get the amount they need. No more no less! To achieve this we developed an arduino system with a soil moisture sensor and a solenoid valve which are connected to each other. The filed will have sensors at regular intervals through out the field, which will send the readings of the moisture in the soil to the arduino micro controller. Through the micro controller solenoid valve receives the soil moisture readings. If there is not enough moisture in the soil then the solenoid will release water until the moisture sensor reads that the plant has enough water. The solenoid will release the water for set times until there is enough moisture in the soil for the plant.

 

Step 1 Moisture Sensor

Crop

The first thing we did was set up the moisture sensor and to test. We tested the sensor so we could make sure we were getting the correct readings of the soil and that we knew what values the soil would be for which state it was in. The way we tested the Moisture sensor was by setting up in different soils which all had different moister levels in it. After we had the results we would then use them in the code.

Step 2 Solenoid valve

SparkFun Hardware Solenoid Valve 12V  - 3/4"

The next thing was setting up the solenoid valve to work when the moister sensor read that the soil needs more water. So from the results we got from the moisture sensor we set up the code on the arduino to have thresh holds that would make the solenoid valve turn on when there is not enough water in the soil.

Step 3 Setting up the LED’s

Moisture Level Measurement

 

After we got the moister sensor and the solenoid working we looked into ways of showing the moisture from the circuit. So we set up a LED bar graph that indicates how much moisture the soil has. There are 5 LED’s one if all five are on then the plant has the perfect amount of water. If none are on then the moister level is too low and the solenoid will turn on to allow water to flow to the crops.

After this we then set up the code. We took the values we got from the moister sensor and implemented them into the code. We had to set up the code that the moisture senor would control when the solenoid valve would turn on and turn off. And for the LED’s to show what the moister levels are.

 

int rainPin = A0;
int solenoid = 7;
int sensorValue;
// you can adjust the threshold value
int thresholdValue = 1050;
int thresholdValue1 = 1000;
int thresholdValue2 = 850;
int thresholdValue3 = 700;
int thresholdValue4 = 550;
int thresholdValue5 = 400;

void setup() {
for(int i=2; i<=6; i++){ // sets up LEDs from pin 2 to pin 6
pinMode(i,OUTPUT);
}
pinMode(rainPin, INPUT);

pinMode(7, OUTPUT);// connected to S terminal of Relay;
Serial.begin(9600);
}

void loop() {
// read the input on analog pin 0:
sensorValue = analogRead(rainPin);
Serial.println(sensorValue);
checkMoisture(thresholdValue, LOW, 2, 6);
checkMoisture(thresholdValue1, HIGH, 2, 2); //checks moisture(your threshold value, LED HIGH or LOW, starting LED pin, ending LED pin)
checkMoisture(thresholdValue1, LOW, 3, 6);
checkMoisture(thresholdValue2, HIGH, 2, 3);
checkMoisture(thresholdValue2, LOW , 4, 6);
checkMoisture(thresholdValue3, HIGH, 2, 4);
checkMoisture(thresholdValue3, LOW, 5, 6);
checkMoisture(thresholdValue4, HIGH, 2, 5);
checkMoisture(thresholdValue4, LOW, 6, 6);
checkMoisture(thresholdValue5, HIGH, 2, 6);

if(sensorValue < thresholdValue){
digitalWrite(7,HIGH);// turn relay ON;
}
else {
digitalWrite(7, LOW);// turn relay OFF;
}
delay(2000);
}

void checkMoisture(int threshold, bool ledLevel, int startingPin, int endingPin) { //checks moisture(your threshold value, LED HIGH or LOW, starting LED pin, ending LED pin)
if(sensorValue < threshold) {
for (startingPin; startingPin<=endingPin; startingPin++){
digitalWrite(startingPin,ledLevel);
}
}

}

 

We set up the curcuit of the board to the correct way. fritzing chart-APRIL 19

Because we needed a 12v power supply for the solenoid valve but we wanted to control it with the arduino which only runs at 5v we had to use a relay. The relay allows the switch between the power supplies with out over loading the board.

Flow Chart Capture A18

We set up the circuit and and code and tested to see if the model would work.

Are aim for this project was to lower the amount of water wasted in agricultural fields and try and make them as sustainable as possible. We have tried to do this by monitoring how much water is in the soil and when it needs to be watered and when it does not. We have done this by using a moisture sensor to read the moisture in the soil and a solenoid valve to control when to release the water to the plants.

With the model we made there was a couple of restrictions. the solenoid valve we used needs a mains water supply or a water supply with pressure behind it to push the water through. And because for are mini model we used a water bottle that the  pressure was gravity fed, there was not enough pressure to push a lot of water through at once and it only dribbled out slowly. This model is designed for a large scale design. So we designed it that it would be used with a mains water supply behind it to give more pressure.

By having this product it would help with the over watering problem as it would only water the plants when they need to be watered and not until then. There would be no over watering and would save a lot of time, money and water that is getting more and more reserved.

Final Design for Sustainability Project

The Project;

The aim of this project is to prevent the  over watering of the large agricultural fields. To achieve this we developed an Arduino system with soil moisture sensor and solenoid valve which are connected to each other. The agricultural field has sensors at regular intervals throughout the field which send the soil moisture data to the Arduino microcontroller. Through the microcontroller solenoid valve receives the soil soil moisture  data  and releases enough water to replenish the moisture in soil for a set of time. This process continues until the soil have enough water for the crop.

We strongly believe this system will help to reduce the over watering of crops and therefore save water and produce higher, healthier yield.

These improvements to water usage will lead to greater Sustainability.

Coding of the Project;

int rainPin = A0;
int solenoid = 7;
int sensorValue;
// you can adjust the threshold value
int thresholdValue = 1050;
int thresholdValue1 = 1000;
int thresholdValue2 = 850;
int thresholdValue3 = 700;
int thresholdValue4 = 550;
int thresholdValue5 = 400;

void setup() {
for(int i=2; i<=6; i++){ // sets up LEDs from pin 2 to pin 6
pinMode(i,OUTPUT);
}
pinMode(rainPin, INPUT);

pinMode(7, OUTPUT);// connected to S terminal of Relay;
Serial.begin(9600);
}

void loop() {
// read the input on analog pin 0:
sensorValue = analogRead(rainPin);
Serial.println(sensorValue);
checkMoisture(thresholdValue, LOW, 2, 6);
checkMoisture(thresholdValue1, HIGH, 2, 2); //checks moisture(your threshold value, LED HIGH or LOW, starting LED pin, ending LED pin)
checkMoisture(thresholdValue1, LOW, 3, 6);
checkMoisture(thresholdValue2, HIGH, 2, 3);
checkMoisture(thresholdValue2, LOW , 4, 6);
checkMoisture(thresholdValue3, HIGH, 2, 4);
checkMoisture(thresholdValue3, LOW, 5, 6);
checkMoisture(thresholdValue4, HIGH, 2, 5);
checkMoisture(thresholdValue4, LOW, 6, 6);
checkMoisture(thresholdValue5, HIGH, 2, 6);

if(sensorValue < thresholdValue){
digitalWrite(7,HIGH);// turn relay ON;
}
else {
digitalWrite(7, LOW);// turn relay OFF;
}
delay(2000);
}

void checkMoisture(int threshold, bool ledLevel, int startingPin, int endingPin) { //checks moisture(your threshold value, LED HIGH or LOW, starting LED pin, ending LED pin)
if(sensorValue < threshold) {
for (startingPin; startingPin<=endingPin; startingPin++){
digitalWrite(startingPin,ledLevel);
}
}

}

Fritzing Chart of The Project

 

fritzing chart-APRIL 19

 

Photos of the Project;

 

Moisture Level Measurement

 

portfol-1

Solenoid System

Sensor-Soil Moisture

Tab-Solenoid

Water Tank

Video of the Project; Testing the Solenoid Valve

Testing of the solenoid Valve

 

Testing of the system

 

Week 9 Sustainable Design Project

After setting up the circuit and testing we noticed that the values we set for the moister sensors were wrong and had to change this in the code to the correct values.

Moisture Level Measurement

We had changed the values on the code to correct them so that the LED’s would light up at the right moister levels. We did test on the soils to find the correct values.

When looking at the code we had we needed to clean it and make it more presentable.

int rainPin = A0;
int solenoid = 7;
int sensorValue;
// you can adjust the threshold value
int thresholdValue = 1050;
int thresholdValue1 = 1000;
int thresholdValue2 = 850;
int thresholdValue3 = 700;
int thresholdValue4 = 550;
int thresholdValue5 = 400;

void setup() {
for(int i=2; i<=6; i++){ // sets up LEDs from pin 2 to pin 6
pinMode(i,OUTPUT);
}
pinMode(rainPin, INPUT);

pinMode(7, OUTPUT);// connected to S terminal of Relay;
Serial.begin(9600);
}

void loop() {
// read the input on analog pin 0:
sensorValue = analogRead(rainPin);
Serial.println(sensorValue);
checkMoisture(thresholdValue, LOW, 2, 6);
checkMoisture(thresholdValue1, HIGH, 2, 2); //checks moisture(your threshold value, LED HIGH or LOW, starting LED pin, ending LED pin)
checkMoisture(thresholdValue1, LOW, 3, 6);
checkMoisture(thresholdValue2, HIGH, 2, 3);
checkMoisture(thresholdValue2, LOW , 4, 6);
checkMoisture(thresholdValue3, HIGH, 2, 4);
checkMoisture(thresholdValue3, LOW, 5, 6);
checkMoisture(thresholdValue4, HIGH, 2, 5);
checkMoisture(thresholdValue4, LOW, 6, 6);
checkMoisture(thresholdValue5, HIGH, 2, 6);

if(sensorValue < thresholdValue){
digitalWrite(7,HIGH);// turn relay ON;
}
else {
digitalWrite(7, LOW);// turn relay OFF;
}
delay(1000);
}

void checkMoisture(int threshold, bool ledLevel, int startingPin, int endingPin) { //checks moisture(your threshold value, LED HIGH or LOW, starting LED pin, ending LED pin)
if(sensorValue < threshold) {
for (startingPin; startingPin<=endingPin; startingPin++){
digitalWrite(startingPin,ledLevel);
}
}

}

 

Week 8 Sustainable Design Project

We decide to start setting up the solenoid valve and moister sensor together. When talking more about the project me and sully decided to use a LED bar graph instead of just two LED’s that say it has water or not. Instead we now have it set up with 5 LED’s that give you and indication on how much water the crop has.

Crop field plan for watering

The 5 LED’s give an indication on how much water the plant has. 5 being the most it should have. 4 being at it still has a lot of water, 3 being that it is at it medium range, 2 its now starting to get low on water and will need to be watered soon and 1 meaning that there is not enough water in the soil and that it needs more.

We came up with a code to accommodate this to have the solenoid valve open when at 1 LED.

The code we used:

int LED1 = 2;
int LED2 = 3;
int LED3 = 4;
int LED4 = 5;
int LED5 = 6;
int rainPin = A0;
int solenoid = 7;
// you can adjust the threshold value
int thresholdValue = 500;
int thresholdValue1 = 500;
int thresholdValue2 = 600;
int thresholdValue3 = 700;
int thresholdValue4 = 800;
int thresholdValue5 = 900;

void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(rainPin, INPUT);
pinMode(solenoid, OUTPUT);
}

void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(rainPin);
if(sensorValue < thresholdValue1) {
digitalWrite(LED1, HIGH);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
if(sensorValue < thresholdValue2){
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);

if(sensorValue < thresholdValue3) {
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);

if(sensorValue < thresholdValue4) {
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
digitalWrite(LED4, HIGH);
digitalWrite(LED5, LOW);
if(sensorValue < thresholdValue5) {
digitalWrite(LED5, HIGH);
}
}
}
}
}
if(sensorValue < thresholdValue){
digitalWrite(solenoid, HIGH);
}
else {
digitalWrite(solenoid, LOW);
}
delay(500);
}

This code has set measures on it so when the moister sensor reads one of these it will show that many LED’s. We set it that once there is only one LED on then the solenoid would allow water to flow to water the plant at 05 second intervals. once back at 5 LED’s then the solenoid would turn back off.

Week 7 Sustainable design project

So we decide to start looking into ways of watering the plant with sensors. We looked into ways of allowing the moister sensor to control the when to deliver water to the plants.

the first thing we looked into getting was a water pump.1150 - Accessory Type:Pump

we could write a code that would pump water to the plant when the moister sensor. The water pump would be set up that when the green LED is on the moister sensor is reading that the plant has enough water. If the red LED is on that means that the moister sensor is reading that there is not enough water and that the plant needs more. So we can set it up that when the LED is red then the water pump turns on and waters the plant until the green  LED comes on.

But after talking to Drew he said to us that what we needed was something to let water through as most farms water their crops through water taps. So we looked into solenoid valves.

A solenoid valve is a electrically controlled valve. It works by a metal coil inside it and once this coil is electrically charged it makes a magnetic field. The magnetic filed pulls up the plunger inside the valve which allows the water to flow through. This is a good way of controlling the water to plants if you have a water mains to use.

This would be controlled the same way as the water pump. when the green LED is on there is no water flow. When the red LED is on then the water would run to the plants.

We also started to look at ways we could get are idea across with prototype.Crop

Three different soil pots to show three different stages of water moister in the crops.

 

Week 6 Product concept

We decide for our project we would use a moister sensor to measure that amount of water that is in the soil to tell whether the crops would need to be watered. So the first thing we did was make a circuit to test the moister sensor and see if it would work.

we set up this code light up green if the plant had enough water and red when it needed watering.

moisture-sensor-fritzing

int rainPin = A0;
int greenLED = 6;
int redLED = 7;
// you can adjust the threshold value
int thresholdValue = 800;

void setup(){
pinMode(rainPin, INPUT);
pinMode(greenLED, OUTPUT);
pinMode(redLED, OUTPUT);
digitalWrite(greenLED, LOW);
digitalWrite(redLED, LOW);
Serial.begin(9600);
}

void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(rainPin);
Serial.print(sensorValue);
if(sensorValue < thresholdValue){
Serial.println(” – Doesn’t need watering”);
digitalWrite(redLED, LOW);
digitalWrite(greenLED, HIGH);
}
else {
Serial.println(” – Time to water your plant”);
digitalWrite(redLED, HIGH);
digitalWrite(greenLED, LOW);
}
delay(500);
}

By using this coding we had the basic code to tell if the plant had water and to give out  indications whether it did have water or needed more. This sensor is important because it allows us to measure the soil moister and determine whether or not the plant needs water or not.

The next satge is to start looking at ways to water the plants the correct amount of water they need.

2018 Project 2 Sustainability Brief

Related image

For project 2 we have decided to work on the sustainability of agricultural watering. A lot of farms around the world have been accused of over watering there plants. this is not just a waste of water but it can also drown the plants and make it hard for future crops to grow there as the over watering can  make salt crystals in the soil.

Many big food producing companies like USA, China etc are close to reaching their renewable water resource limits. the main reasoning for this is because poor watering systems, wasteful field application methods and cultivation of thirsty crops not suited to the environment. Main point we will be trying to tackle is waste of water.

Too much water is being wasted because of poor methods. Farmers are watering there crops too much which waste the water which can lead to future droughts for the area when there is a limited amount of water and can damage the crops it self. Our aims is to help cut down the amount of water wastage and make it as efficient as possible.

The aim of our project is to prevent the over watering of the large agricultural fields. We wanted to design a product that could control how much water the plants get and that they only get the amount they need. No more no less!

Me and Sullyman Akbulut are in a group togther.

Week 9 Sustainability Design Project

Some necessary changes are made on the coding as shown below;

int rainPin = A0;
int solenoid = 7;
int sensorValue;
// you can adjust the threshold value
int thresholdValue = 1050;
int thresholdValue1 = 1000;
int thresholdValue2 = 850;
int thresholdValue3 = 700;
int thresholdValue4 = 550;
int thresholdValue5 = 400;

void setup() {
for(int i=2; i<=6; i++){ // sets up LEDs from pin 2 to pin 6
pinMode(i,OUTPUT);
}
pinMode(rainPin, INPUT);

pinMode(7, OUTPUT);// connected to S terminal of Relay;
Serial.begin(9600);
}

void loop() {
// read the input on analog pin 0:
sensorValue = analogRead(rainPin);
Serial.println(sensorValue);
checkMoisture(thresholdValue, LOW, 2, 6);
checkMoisture(thresholdValue1, HIGH, 2, 2); //checks moisture(your threshold value, LED HIGH or LOW, starting LED pin, ending LED pin)
checkMoisture(thresholdValue1, LOW, 3, 6);
checkMoisture(thresholdValue2, HIGH, 2, 3);
checkMoisture(thresholdValue2, LOW , 4, 6);
checkMoisture(thresholdValue3, HIGH, 2, 4);
checkMoisture(thresholdValue3, LOW, 5, 6);
checkMoisture(thresholdValue4, HIGH, 2, 5);
checkMoisture(thresholdValue4, LOW, 6, 6);
checkMoisture(thresholdValue5, HIGH, 2, 6);

if(sensorValue < thresholdValue){
digitalWrite(7,HIGH);// turn relay ON;
}
else {
digitalWrite(7, LOW);// turn relay OFF;
}
delay(1000);
}

void checkMoisture(int threshold, bool ledLevel, int startingPin, int endingPin) { //checks moisture(your threshold value, LED HIGH or LOW, starting LED pin, ending LED pin)
if(sensorValue < threshold) {
for (startingPin; startingPin<=endingPin; startingPin++){
digitalWrite(startingPin,ledLevel);
}
}

}

Measurement of soil moisture level;

I used soil moisture sensor to measure the minimum up to maximum soil moisture value on every level. Then I used these values to set the Threshold values. Finally I used these values for coding.

int thresholdValue = 1050;
int thresholdValue1 = 1000;
int thresholdValue2 = 850;
int thresholdValue3 = 700;
int thresholdValue4 = 550;
int thresholdValue5 = 400;

Moisture Level Measurement

Week – 8 Sustainable Design Project

initial Final design drawings

In this crop field watering project I will use a Solenoid valve, Soil Moisture Sensor, LED lights and water pipes. LEDs show the level of moisture in the soil. When all the LEDs are off, solenoid valve will release the water for a set time.

Crop field plan for watering

Final design Fritzing chart

Solenoid valve

Final design Arduino code

int LED1 = 2;
int LED2 = 3;
int LED3 = 4;
int LED4 = 5;
int LED5 = 6;
int rainPin = A0;
int solenoid = 7;
// you can adjust the threshold value
int thresholdValue = 500;
int thresholdValue1 = 500;
int thresholdValue2 = 600;
int thresholdValue3 = 700;
int thresholdValue4 = 800;
int thresholdValue5 = 900;

void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(rainPin, INPUT);
pinMode(solenoid, OUTPUT);
}

void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(rainPin);
if(sensorValue < thresholdValue1) {
digitalWrite(LED1, HIGH);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
if(sensorValue < thresholdValue2){
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);

if(sensorValue < thresholdValue3) {
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);

if(sensorValue < thresholdValue4) {
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
digitalWrite(LED4, HIGH);
digitalWrite(LED5, LOW);
if(sensorValue < thresholdValue5) {
digitalWrite(LED5, HIGH);
}
}
}
}
}
if(sensorValue < thresholdValue){
digitalWrite(solenoid, HIGH);
}
else {
digitalWrite(solenoid, LOW);
}
delay(500);
}

 

 

 

 

Week – 7 Sustainable Design Project

Water level warning system for multiple crops with Arduino – Initial Ideas:

 

Crop

As shown above I made sketch of the water level warning system for the three different crops. On this Arduino system green LED shows(when it is ON) that crop has enough water level and red LED shows(when it is ON) that crops on that area have no enough water level so they need water.

This system can be expanded for as many crop as required in the agricultural fields.

With this system water will be used economically and crop farmers will save a lot. It will also help to prevent the Saltation (salt crystallisation in the fields due to wrong and excessive watering of the crop fields) in the agricultural fields.

I believe this system will make a grate contribution for Sustainable crop farming .

Especially water recourses are getting lower around the world due to global warming and wrong usage, this sort of projects will be helpful.