Al-Najah National University Department of Computer Engineering Graduation Project II Smart Green Garden By: Rand Motaz Toqa Abdo Supervised by: Dr.Haya Samaana September 3, 2023 Abstract The agricultural sector makes up the economy of most countries This is due to the increasing need for food as a result of the increase in population in the world and due to the remarkable technical progress that the environment surrounding us has become increasingly inclined to work automatically, which is similar to manual work in terms of energy efficiency and productivity growth. In addition, it reduces the need for work. Hard manual. In this project, the concept of automation includes several aspects, which is the automatic irrigation process, continuous temperature checks, and the provision of a ventilation system if necessary, in addition to providing protection for the farm in the event of rain, fire, or attempts to steal, and providing appropriate lighting to carry out the photosyn- thesis process in In the event of a shortage, in addition to providing a fertilization system that works automatically on a weekly basis, con- tinuous examination of water tanks, and sending sms messages in the event of a decrease in the required limit. Table of Contents 1 Introduction 1 1.1 Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 Objectives and Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.4 Importance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.5 Report Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 Constraints and Earlier work 4 2.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.2 Previous work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3 Literature review 6 4 Methodology 7 4.1 Hardware Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.2 System Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.3 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5 Conclusion and Results 20 6 Future work 21 7 Acknowledgements 22 i Chapter 1 Introduction 1.1 Problem The problem here is the need for larger quantities of agricultural crops and the difficulty of having working hands throughout the day to check the conditions suitable for plant growth. 1.2 Purpose The best way to ensure quality and environmental harmony is to im- plement automation, which enables the farmer to remotely monitor and maintain his farm by creating the ideal conditions for the growth of these plants without requiring the time and labor of human hands. 1.3 Objectives and Scope This system can do the following: 1. He can sense the temperature and open the window if the temper- ature is high, but if there is rain and the temperature inside the greenhouse is high, the window will remain closed and a fan will be opened. 2. Door opening system: If the correct password is entered, if it is entered incorrectly three times, the farmer will be notified of this. 1 3. A fertilization system based on Schedule by the RTC that calcu- lates a specific concentration of fertilizer based on the number of seedlings on the farm. 4. A fire extinguishing system depends on CO a percentage, in case it exceeds the required limit, it extinguishes it. 5. Irrigation system in case the soil is dry. 6. Send sms based on the GSM module. 7. Mobile application that can take all its readings by making a con- nection with the hardware. 1.4 Importance The existence of plants on Earth is necessary because they and their root systems clean oxidizing environments, prevent desertification and soil erosion, reduce carbon emissions, regulate precipitation and weather patterns, and carry out numerous other tasks like supplying shelter, food, and a variety of other goods. 1.5 Report Organization 1. The the next chapter - Constraints & Earlier Coursework -,We will talk about the challenges we encountered and how we overcame them while working on our project, as well as the courses that were helpful to us. 2. The the fourth chapter - Literature Review -,We will examine some comparable works and projects and discuss how our project differs from them. 3. The the fifth chapter - Methodology -,We will go into detail about the system’s operation, the hardware components we utilized, how we connected them and how that worked, as well as how we made 2 communication between the various parts and the program that controls the system. 4. The sixth chapter - Results & Discussion -,is a discussion of the project’s outcomes and what is anticipated from it. 5. The the final chapter - Conclusion -,We will briefly go through the most crucial aspects of the project, what we learnt from it, and any recommendations that might be made for future use. 3 Chapter 2 Constraints and Earlier work 2.1 Limitations We had a lot of challenges to overcome on the route to completing this project. The following limitations are the most significant ones: 1. Determine the features on which the system will depend and the possibility of having the necessary parts to build it. 2. A place to create the project, because moving it after placing the pieces on it became difficult. 3. Many of the sensors were giving wrong readings when put together and many of the pieces were getting stuck for no reason. 4. A sudden defect occurs, which leads to the depletion of time to determine the type of problem, if it is a network, a damaged piece, a code, or a fault in the voltage collector. 2.2 Previous work In the beginning, we learned the basics of programming parts in the BIC course, then we applied that practically through the projects of that course. After that, we followed short YouTube videos related to 4 Arduino programming by Mr. Wael Abu Hamza Click Here To Show Arduino Course In Arabic. 5 https://youtube.com/playlist?list=PL93xoMrxRJIvMeOKPIUnnw3Hw1A5_UXM7&feature=shared https://youtube.com/playlist?list=PL93xoMrxRJIvMeOKPIUnnw3Hw1A5_UXM7&feature=shared Chapter 3 Literature review Smart Green Garden is a revolutionary method that seeks to keep the garden owner always in touch with his garden and perform important tasks without necessitating physical presence. There are other projects that are comparable to this one that have been established in the past that try to remotely operate home gardens: 1. Smart Indoor Farming System :This project has been completed at An-Najah National University. Sensors for temperature, soil mois- ture, fan speed, and light intensity are among the many devices included in it. 2. Smart Garden Monitoring and Control System with Sensor Tech- nology: In 2021, the Signals and Communications(ICPSC) project from the 3rd International Conference on Temperature, Humidity and Soil Moisture Sensors, (ICPSC) also contains a driver, a DC motor and a fan. 6 Chapter 4 Methodology The system process, the hardware components we utilized, how we connected them, and how we made communication between the com- ponents and the program that read the sensor value will all be covered in detail in this chapter. 4.1 Hardware Components 1. Arduino Mega2560:It is a microcontroller board based on the ATmega2560 which contains 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 hardware serial ports (UARTs), a 16 MHz crystal oscillator, a USB connec- tor, a power jack, an ICSP header, and a reset button. It comes with everything needed to support the microcontroller.[1] Figure 4.1: Arduino Mega2560 7 2. ESP32:There are integrated antenna switches, RF baluns, power amplifiers, low-noise receive amplifiers, and power-management modules in a range of low-cost, low-power system on a chip micro- controllers. Dual-mode Bluetooth and integrated Wi-Fi are also included.[2] We selected the ESP32 for our system since it comes with a built-in Wi-Fi module that enables remote control and data transmission. Figure 4.2: ESP32 3. Relay:It takes a signal from Arduino and connect the electrical circuit, We selected it to control water pumb and fan.[3] Figure 4.3: Relay 8 4. LM2596 voltage reguleter:It enables to accept a larger input voltage and produce a lower, controlled output voltage, is specif- ically made for step-down (buck) voltage regulation applications, We selected it to to convert from 12 volts to 5.6 volts to power the sensors and the rest of the other parts.[4] Figure 4.4: Reguleter 5. ULN2803:It is a high-voltage, high-current Darlington transistor array that can drive up to 8 relays at once. It is mostly employed as a relay driver, We selected it to To control each color in RGB strip by connect he anode lead to the negative terminal of the 9 power supply, and the red, green, and blue leads should be given a HIGH signal or VCC.[5] Figure 4.5: ULN2803 6. RGB LED Strip:This alludes to the three light colors produced by these LED strip lights. To produce a comprehensive spectrum of color, the LED strips combine various brightness levels in each of the three colors,We have used it in this project to determine the appropriate color for a plant to perform photosynthesis.[6] Figure 4.6: ULN2803 connication with RGB Led and aeduino 10 7. KeyBad:is a typical input device made up of a number of buttons. Pressing a button produces a distinct electrical signal that can be read by a microcontroller like an Arduino, and each button symbolizes a particular character or function.[7] We selected it to aske the farmer to enter the password and enter his farm and enter the number of seedlings to be fertilized . Figure 4.7: KeyBad Connection with arduino 8. LCD 16*2:is a type of flat panel display that operates primarily on liquid crystals. For both consumers and organizations, LEDs have a wide range of use cases.[8] 11 We selected it to display information about sensors reading and o onand we connect it with I2C driver to reduce the number of wires used for networking with Arduino. Figure 4.8: LCD with I2C Connection with arduino 9. Servo Motor:A servo motor is a type of motor that can rotate with great precision, we select it in our system to open door and window.[9] Figure 4.9: Servo Motor Connection with arduino 10. RTC:A real time clock, often known as an RTC, is a digital clock whose main purpose is to maintain precise timekeeping even when a power source is off or a device is in low power mode. An embed- ded quartz crystal resonator, an oscillator, and a controller make 12 up an RTC, we select it in our system to o organize the composting process on a weekly basis.[10] Figure 4.10: RTC Connection with arduino 11. SIM800L:I having a serial interface, a GSM module. It has the ability to make and receive phone calls as well as text messaging. Additionally, it can receive FM signals and connect to the internet, we select it in our system to to alert the farmer in the event of theft or fire, and in the event of a shortage of water tanks, and to remind the next fertilization date.[11] Figure 4.11: SIM800L Connection with arduino 12. Speaker:is is a transducer that converts electrical signals into sound waves,We Selectet it in order to issue music playing tunes.[12] 13 Figure 4.12: Speaker Connection with arduino 13. Ultrasonic:is a device that uses ultrasonic sound waves to gauge a distance to an item. An ultrasonic sensor transmits and receives ultrasonic pulses from a transducer to determine the proximity of an item,We have used it in this project to alert the farmer when there is a shortage of water in the tank.[13] Figure 4.13: Ultrasonic Connection with arduino 14 14. DHT11:It is a low-cost, basic digital temperature and humidity sensor,We Selectet it to measure the air temperature.[14] Figure 4.14: DHT11 Connection with arduino 15. water level sensor :It is employed to measure the maximum amount of chemicals that can flow,It has been used to sense whether or not it is raining .[15] Figure 4.15: water level sensor Connection with arduino 16. Light sensor :It is s a passive device that converts the light en- ergy into an electrical signal output,It has been used to check the amount of light and activate the light to carry out the process of 15 photosynthesis .[16] Figure 4.16: Light sensor Connection with arduino 17. Soil Moisture sensor :developed to gauge the moisture or water content of soil,It is used to regulate the irrigation process .[17] Figure 4.17: Soil Moisture sensor Connection with arduino 18. MQ7 sensor:It is an easy-to-use carbon monoxide (CO) sensor that can measure ambient CO concentrations. It is capable of 16 detecting CO-gas quantities between 20 and 2000 ppm,It has been used to detect fires .[18] Figure 4.18: MQ7 sensor Connection with arduino 19. Water Pump:It is a mechanical device designed to move or trans- port water from one location to another,It is used to pump water in the irrigation and fertilizer process.[19] Figure 4.19: Water Pump Connection with arduino 20. Fan:It i is a mechanical device used to create airflow and circulate air in an enclosed space,It is used to operate the air conditioner in case of high temperature and rain.[20] 17 Figure 4.20: Fan Connection with arduino 4.2 System Design This project was created to make it simpler for the farm owner to look after it and keep an eye on its status from a distance. We initially placed a high priority on safety by alerting the owner in the event of a farm invasion and detection of carbon monoxide gas, which ignites a fire and requires water to be pumped from the tank towards the source of the fire. Naturally, we check the moisture level in the soil and determine if there is a deficiency, Which results in irrigation of crops by drawing water from a reservoir. The plant will automatically light up and start playing music when the amount of light falling on the plants decreases. Of course, we will check the temperature, and if it rises above the required limit, the window will be opened for ventilation, and just in case If it rains, the window will be closed and the fan will be opened if it is higher than the required limit 18 Here below is a picture of the complete system networking: Figure 4.21: System Connection with arduino 4.3 Software This project supports the existence of a mobile application that pro- vides farmers with the display of sensor values as shown below: Figure 4.22: Mobile App 19 Chapter 5 Conclusion and Results The aim of this project was to demonstrate an efficient smart farm system. The use of automation is involved in a number of aspects including The farm has an automatic lighting system, temperature and humidity system, and sprinklers. The system is protected by a password-protected digital lock, ensuring the protection of plants on the farm. Smoke detectors are provided to reduce the risk of fire. The entire crop may be lost if it is not found in time. The GSM unit is attached to allow direct contact with the farm owner. Of course, this project taught us a lot of useful lessons, the most important of which is how to work with different electronic parts and read and adhere to instructions to prevent burning any of them. We learned how to use Arduino to connect the pieces and how to create codes to control those pieces. 20 Chapter 6 Future work There are many functions that can be added to this project, such as installing a camera to identify whether the crop is ripe, and providing a robot that harvests it. The camera can also be used to see if the plant has been exposed to a particular disease and to spray the necessary pesticide 21 Chapter 7 Acknowledgements First and foremost, praises and thanks to the God, the Almighty, for His showers of blessings throughout our graduation project work to complete it successfully. We would like to thank our great doctor Dr.Haya Samaana for her huge support, guidance and help for suc- cessfully achieving this project. A special thank for our parents and family for their support. we also want to thank our friends for the encouragement. 22 References [1] arduino mega2560 click here to see arduinomega2560 data sheet. [2] esp32 click here to see esp32 data sheet. [3] relay click here to see relay data sheet. [4] reguleter click here to see reguleter data sheet. [5] uln2803 click here to see uln2803 data sheet. [6] rgb led strip click here to see rgb led strip data sheet. [7] keybad click here to see keybad data sheet. [8] i2c lcd click here to see i2c lcd data sheet. [9] servo motor click here to see servo motor data sheet. [10] rtc click here to see rtc data sheet. [11] sim800l click here to see sim800l data sheet. [12] speaker click here to see speaker data sheet. [13] ultrasonic click here to see ultrasonic data sheet. [14] dht11 click here to see dht11 data sheet. [15] water level sensor click here to see water level sensor data sheet. [16] light sensor click here to see light sensor data sheet. 23 https://docs.arduino.cc/hardware/mega-2560 https://docs.arduino.cc/hardware/mega-2560 https://www.fcl.fujitsu.com/downloads/MICRO/fcai/relays/vs.pdf http://tpelectronic.ir/datasheets/20150123144301750.pdf https://www.sparkfun.com/datasheets/IC/uln2803a.pdf https://www.flexfireleds.com/content/ColorBright-RGB300-LED-strip-light-data-sheets.pdf https://cdn.sparkfun.com/assets/f/f/a/5/0/DS-16038.pdf http://handsontec.com/dataspecs/module/I2C_1602_LCD.pdf http://www.ee.ic.ac.uk/pcheung/teaching/DE1_EE/stores/sg90_datasheet.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/DS1307.pdf https://components101.com/wireless/sim800l-gsm-module-pinout-datasheet-equivalent-circuit-specs https://www.cuidevices.com/product/resource/gf0771.pdf https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf https://www.mouser.com/datasheet/2/758/DHT11-Technical-Data-Sheet-Translated-Version-1143054.pdf https://curtocircuito.com.br/datasheet/sensor/nivel_de_agua_analogico.pdf https://www.futurlec.com/Light_Sensor.shtml [17] soil moisture sensor click here to see light sensor data sheet. [18] mq7 sensor click here to see mq7 sensor data sheet. [19] water pump click here to see water pump data sheet. [20] fan click here to see fan data sheet. 24 https://www.instrumart.com/assets/smr110-Datasheet.pdf https://www.sparkfun.com/datasheets/Sensors/Biometric/MQ-7.pdf https://www.lenntech.com/Data-sheets/Danfoss-APP-11-13-L.pdf https://www.interempresas.net/FeriaVirtual/Catalogos_y_documentos/19488/Fan-Systems_ENGLISH.pdf Introduction Problem Purpose Objectives and Scope Importance Report Organization Constraints and Earlier work Limitations Previous work Literature review Methodology Hardware Components System Design Software Conclusion and Results Future work Acknowledgements