Professional Documents
Culture Documents
PRESENTED BY:
AMMAR MAHMOUD, HAIDER ABDUL JABBAR, & ABDUL
MUHAIMIN SAAD
2ND STAGE (EVENING STUDY)
DR. OMAR YOUSSEF
Table of Contents:
Introduction………….…………………………. 2-4
Component…………………….…………………….5-6
Assemble ………………………………….………….……..6-8
Wiring …………………….…….9
OUTPUT ……………………….10-11
CONCLUSION …………………….…………..…..…..11-12
CODE………….……………………………………..13-16
16
Arduino-based system for soil moisture measurement
Intro:
exact properties of the soil, farmers are not only able to use
16
with irrigation system controllers. Connecting a moisture
16
content) are very expensive and require sophisticated
Goal of Project:
16
this project is a simple and functional way to test the
can sit on the shelf with your other household tools and when
it’s time to water the plants you can give them exactly as
1-Arduino Uno
16
3-Soil Moisture Sensor with Control Unit
Assemble:
16
Display. In order to properly measure the water potential
16
We then measure the voltage drop on the sensor and
16
Wiring:
16
OUTPUT:
16
CONCLUSION:
16
offers real-time monitoring. It is a suitable alternative to
16
Code:
//Library
#include "SevenSeg.h"
//Variables
int number=0; //Default number
int flag;
int sensorPin = A0;
int sensorValue;
int limit = 300;
void setup() {
Serial.begin(9600);
//Defines the number of digits to be "numOfDigits" and
the digit pins to be the elements of the array "digitPins"
disp.setDigitPins ( numOfDigits , digitPins );
//Only for common cathode 7segments
disp.setCommonCathode();
//Control brightness (values 0-100);
disp.setDutyCycle(50);
Serial.begin(9600);
16
}
void loop()
{
/*
This section will need to be calibrated based on what you
want each moisture level to display.
For me, most outside plants after a light rain will display
a 9 and will decrease after it drys out to a 1 after about a
week!
To calibrate I took two dry plants and watered one. I
measured each using Serial Monitor in this code
(Cntrl+Shift+M) and adjusted
the sensorValue so that the highest and lowest values set
to these measurements.
This took 2 tries before it worked well!
I also used an external phone charger as a power source
after uploading the code to the arduino so it could work
remotely.
*/
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
//Check if incoming data is available:
if (Serial.available() > 0)
{
number = Serial.parseInt();
flag=0;
}
16
//Print number to 7 segment display
disp.writeDigit(2);
}
if (sensorValue >270 && sensorValue <=300){
//Print number to 7 segment display
disp.writeDigit(3);
}
if (sensorValue >240 && sensorValue <=270){
//Print number to 7 segment display
disp.writeDigit(4);
}
if (sensorValue >210 && sensorValue <=240){
//Print number to 7 segment display
disp.writeDigit(5);
}
if (sensorValue >180 && sensorValue <=210){
//Print number to 7 segment display
disp.writeDigit(6);
}
if (sensorValue >150 && sensorValue <=180){
//Print number to 7 segment display
disp.writeDigit(7);
}
if (sensorValue >120 && sensorValue <=150){
//Print number to 7 segment display
disp.writeDigit(6);
}
if (sensorValue >90 && sensorValue <=120){
//Print number to 7 segment display
disp.writeDigit(7);
}
if (sensorValue >60 && sensorValue <=90){
//Print number to 7 segment display
disp.writeDigit(8);
16
}
if (sensorValue <=60){
//Print number to 7 segment display
disp.writeDigit(9);
}
delay(500);
// for stability
}
16