Smart Plant Supervisor: Dr.Luai Malhis Department of Computer Engineering Faculty of Engineering at An-Najah National University December , 2021 Acknowledgements Acknowledgements " First, praises and thanks to God, the Almighty, for His showers of blessings throughout our graduation project work to complete it successfully. We would like to express our extreme and sincere gratitude, thankfulness and love to our families for being with us and keep guiding us throughout our lives to reach this point and to be able to finish this graduation project. We are extremely grateful to our supervisor Dr. Luai Malhis. Absolutely, we would like to express our thankfulness to our friends and out great doctors and all of the computer engineering teaching staff and all of the department " Members Project Team Members Aseel Eyad Bouziah Shaymaa Abu Saada Contents Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v 1 Introduction 1 1.1 Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 Report Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Constraints, Standards/Codes 2 2.1 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.2 Standards/Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.3 Earlier Coursework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3 Literature Review 3 4 Methodology 4 4.1 Hardware Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4.1.2 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4.1.3 Hardware Development . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.1.4 Overall Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.1.5 Complete Semantics for the project . . . . . . . . . . . . . . . . . . 13 4.2 Software Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5 Result and Discussion 15 6 Conclusion and Recommendation 16 7 Future Work 17 Reference 18 iv Abstract Abstract " Plants, as we all know, are quite vital in our lives. They require water to exist and light to perform the photosynthesis process. The robot allows indoor plants to serve themselves in terms of these two primary needs without the intervention of people. Sun- Seeking planter is a robot that allows indoor plants to follow an algorithm to find the sunniest location in a room; it also allows them to measure the soil moisture, so when needed, it can get what it needs from the water and voice can also be used to detect movement of plant. In our opinion, the project’s major goal is to allow the plant to meet its own needs. Such as water and sunlight. The process outline of the project will go over three basic concepts: DC motor movement and obstacle detection, determining the sunniest spot using LDRs and algorithm, and determining soil moisture. Also the robot is controlled by an Arduino Uno microcontroller and driven by two DC motors. This project has been done before, but we will add a special feature that enable the plant move by using voice detector when we need to move it. " Chapter 1 Introduction 1.1 Problem In-door plants these days need more effort to take care of it. Also these things demand to look after for the plant to water it, to put it in sun light and extra. So we think about a plant that takes care of itself and does all these processes automatically. 1.2 Objectives The project consisting of two wheels,DC motors, with h-bridge,moisture sensor with esp32,LDRs, and an Arduino. The movement of the motor is automaticly and through a mobile application connected to Bluetooth with the Arduino, and it also contains the Ultrasonic sensor to stop DC motor If it is about to hit a wall or something. 1.3 Report Organization Here we will talk about the structure of this report . as here: • Chapter two( Constraints, Standards/ Codes ) that were used in the project ,and Earlier course work. • Chapter three( Literature Review) ,which presents some previous similar projects to our project . • Chapter four deals with methodology, it contains components that we used for hardware development and description for each . It also contained steps to perform this project and software development. • Chapter five ( results and discussion ),which explains problems and difficulties we faced , and talked about results that have been obtained . • Finally, chapter six ( Conclusion ) and steps that we intend to do in future works 1 Chapter 2 Constraints, Standards/Codes 2.1 Constraints • Lack of time • connection issues : H-bridge • pins faults in arduino 2.2 Standards/Codes " The code was built with the help of an external library called Blynk, which was necessary to deal with the Esp32 controller and enable wifi to send a notification when the plant needed water. After that, the pump(3.5-5) volt will work on its own. We also utilize the SoftwareSerial Library, which is used to provide serial communication on additional mega arduino pins, which is necessary when dealing with the HC-05 Bluetooth module, which can be used to move the plant. It does so because it uses the Serial Port Protocol (SSP). The module uses a USART (Universal Synchronous/Asynchronous Receiver/Transmitter) to communicate at a baud rate of 9600, although it also supports different baud rates. As a result, we may connect this module to any microcontroller that supports USART. In addition, the code explains how wheels and DC motors move, as well as how LDR sensors propel the wheels ahead. 2.3 Earlier Coursework Critical thinking, Microcontroller and Digital3 courses have helped to complete this project . " 2 Chapter 3 Literature Review " This section highlights other ideas of making a smart plant. One of the related projects in An-Najah National University is a graduation project in the Computer Engineering Department in 2015 called Smart Plant Robot[1]. The features added to our project that is we use much more components like the Hc-Bluetooth module we connect it to an application in Andriod that name is (BT Voice Control for Ardunio) this achieved the movement of a plant through the orders that we give such as forward and backward. In addition, we use an esp controller to connect the moisture sensor and pump water with the Blynk application to alert the user that his plant needs water and if he is can’t water it, a plant can automatically water itself. " 3 Chapter 4 Methodology 4.1 Hardware Parts 4.1.1 Overview This section will talk about the hardware components which have been used in this project: " • arduino UNO • esp32 • bluetooth module hc-05 • ultrasonic sensor • 2 DC motors • h-bedge • ldr sensors • moisture sensor • water pump • relay module " 4.1.2 Description This section is describing each of the previous components as following : " • Arduino UNO It is a microcontroller that has 6 analog inputs . It also has 14 digital output/input pins (6 of them can be used as PWM ).In addition , it contains 16 MHZ quartz crystal , and a USB connection.[2] 4 • ESP32 The ESP32 chip is a hybrid Bluetooth + WiFi-enabled microcontroller used in soil moisture and watering system.After measuring the soil moisture if it is less than required, esp send notification to blynk application. Chapter 4 5 • HC-05 Bluetooth It is a slave module that receives data from a master bluetooth device( smart phones ).It is used to receive commands from a smartphone to move the robot forward /backward/right/left based on the command sent. • DC motor A DC motor is motor within a class of electrical machines whereby direct current electrical power is converted into mechanical power[3]. A 12v DC motor is small and inexpensive, yet powerful enough to be used for smart plant project. Chapter 4 6 • Ultrasonic Sensor It is used to stop the robot if there is an obstacle to the movement and chang- ing the path of its movement • L298N Motor Driver It is used for driving a pair of DC motors and to control rotation direction of the 2 DC motors . " Chapter 4 7 • LDR sensors An LDR is a component that has a (variable) resistance that changes with the light intensity that falls upon it. • Soil moisture sensor With this module, you can tell when your plants need watering by how moist the soil is in your pot, garden, or yard. The two probes on the sensor act as variable resis- tors. Water is conductive, so the more water in the soil, the better the conductivity and the lower the resistance. Chapter 4 8 • Water Pump This is Micro Submersible Water Pump DC 3V-5V, can be integrate to watering system . The water pump works using water suction method which drain the water through its inlet and released it through the outlet. • Relay Module 2 Channel Relay Module use it as a switch to turn on pump(3.5-5) v Chapter 4 9 4.1.3 Hardware Development " The following describes the steps we went through to build this project from the begin- ning : 1. building the car body: we built the car design using wood . And we added the wheels to the bottom of the base of the car. 2. We added the batteries to the car ,we added the arduino and esp and connected it with the power bank, , we added the bluetooth, LDRS,dc-motors and the h bredg and connected them to the arduino. Also we added a moisture sensor and pump water to the esp. Finally, we connected the motors with wheels. 3. We downloaded BLYNK application to mobile which is used to send a notifications when the system is connected and when the plant is needed to water using esp32 wifi, then we wrote the code that is used to deal with the blynk library. Also, we download Bluetooth BT voice control for Arduino to android mobile which is used to control a car using bluetooth, then we wrote the code that is used to control the wheels. Finally, we tried to move the car to check if our work was correct. Chapter 4 10 4. In this step, we were trying to add the feature that prevents the car from crashing with any close obstacle or objects by using the ultrasonic sensor. So we added one sensor, at the front of the car. We connected the sensor with the arduino and wrote its related code. Finally test if the added feature is working properly. Note: the car will stop if it detects an object from 18 cm. " Chapter 4 11 4.1.4 Overall Design Chapter 4 12 4.1.5 Complete Semantics for the project Chapter 4 13 4.2 Software Implementation " Inside the loop function, we keep checking the LDR sensor to detect how the wheels will move. According to the LDR sensor read value, the plant will move to take the needs sunlight. inside the loop function aslo, we keep reading the bluetooth commands which is responsible for controlling the car movement. In addition, before moving the car according to the read commands, there is the ultrasonic sensor which measure the distance between the car and the obstacles in front of it, if the distance less than 18 cm the car stops, and will change the direction. Also in esp loop, we check if the moisture sensor is less than 700 we turn on the pump to water the plant. " Chapter 4 14 Chapter 5 Result and Discussion Finally, the project was completed, and it worked as planned, with all of the mentioned features outlined previously in this report. The smart plant was made by placing a wooden foundation on two wheels and placing the plant above them. The arduino electronic parts and sensors were added, and then the code was downloaded to get everything set to run the smart plant and verify its functionality. This image depicts the smart plant’s appearance: 15 Chapter 6 Conclusion and Recommendation " This robot is designed to help people take care of plants and keep plant from dying in the event of neglect. Through this project we learnt different skills : • We learnt about the moisture sensor; how to connect it with the esp32 and use it to soil measurement. • We learnt about the bluetooth module hc-05 ; how to connect it with the arduino. " 16 Chapter 7 Future Work " • Improve the project’s movement by primarily enhancing an algorithm. • Expand on non-household plants and make them self-serve in some way • An extra function that checks the percentage of elements and minerals in the soil to make sure there isn’t a deficiency if one exists. " 17 Bibliography [1]Smart Plant Robot project in An-Najah National University https://repository.najah.edu/handle/20.500.11888/12323 [2]What is Arduino? https://www.arduino.cc/en/pmwiki.php?n=Main/arduinoBoardUno [3]About DC motor https://www.metmotors.com/brief-overview-of-a-12v-dc-motor/ 18 Acknowledgements Abstract Introduction Problem Objectives Report Organization Constraints, Standards/Codes Constraints Standards/Codes Earlier Coursework Literature Review Methodology Hardware Parts Overview Description Hardware Development Overall Design Complete Semantics for the project Software Implementation Result and Discussion Conclusion and Recommendation Future Work Reference