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

 

Advertisements

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.

 

 

 

 

Week 5-6 Sustainability Project

Project: Soil Moisture measuring with soil moisture sensor kit to prevent the saltation in the agricultural fields

 

My project involves the measuring of the moisture in the soil (Agricultural fields). Especially in the Mediterranean region due to over watering the agricultural fields causes saltation (Occurrence of the salt crystals) of the agricultural fields.

To stop this happening farmers must use the right watering system with optimum watering level. some of the watering system as shown below.

In this project I will develop a automation system with Arduino to make a soil moisture warning system. When soil is to dry it warn with a red light and when the soil’s moister level is good enough light will stay green.

Fritzing  Chart:

 

moisture-sensor-fritzing

Arduino Coding of the project:

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);
}

 

Different watering systems as follows;

1- Dripirrigation (One of the most efficient watering system for agricultural fields)

Dripirrigation

2- Bulk watering ( Wrong way of watering of the agricultural fields)

 

Wrong balk watering

 

3- Irrigation Sprinkler, a good way of watering certain crops.

irrigation-sprinkler

 

3- Pivot with drops watering system. It is another efficient watering system for certain crops.

 

PivotWithDrops1

 

 

Week1- 2: Arduino Motion sensor

Author: Suleyman Akbulut

Using motion sensors and an Arduino you can trigger lights, fans, etc. This kind of sensor is known as the Passive Infrared Motion Detector or PIR. These sense the infrared radiation emitted by all objects above absolute zero. When something passes in front of a PIR sensor it detects the change in background temperature and then triggers an output voltage. This voltage can be read by an Arduino digital input and then the Arduino can act upon it.

The Motion sensor I used for this project is shown below;

sakbulut_motion_pic

Here is the circuit for my Arduino motion sensor project;

 

SAKBULUT_Circuit diagram_MOTION_SENSOR_bb

P.S. I used barometric pressure sensor on this diagram as there wasn’t a motion sensor on the menu to use.

The Arduino code for the project as follows;

This code activates an LED when you wave your hand over the motion sensor.
int motion_1 = 2;
int light_1 = 13;
void setup(){
pinMode (motion_1,INPUT);
pinMode (light_1, OUTPUT);
}
void loop (){
digitalWrite (light_1,LOW);
delay(1000); //this delay is to let the sensor settle down before taking a reading
int sensor_1 = digitalRead(motion_1);
if (sensor_1 == LOW){
digitalWrite(light_1,HIGH);
delay(500);
digitalWrite(light_1,LOW);
delay(500);
}
}

The photos of motion sensor project as follows;

SAKBULUT_Motion_sensor_photo1

SAKBULUT_Motion_sensor_photo2

SAKBULUT_Motion_sensor_photo3

References:
https://www.wired.com/2012/09/using-motion-detectors-with-an-arduino/
https://en.wikipedia.org/wiki/Motion_detector
https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor?view=all
http://engineering.nyu.edu/gk12/amps-cbri/pdf/Intro%20to%20Sensors.pdf
https://www.researchgate.net/publication/303314563_AUTOMATIC_LIGHTING_AND_SECURITY_SYSTEM_DESIGN_USING_PIR_MOTION_SENSOR