International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 14-24 www.ijeais.org 14 Intelligent Embedded Agricultural Robotic System Ibrahim Adabara1, Nabasa Hiriji2, Ogwal Emmanuel3, Sunusi Mahmud Alkasim4, Kalyankolo Zaina5, Mundu M. Mustafa6 1,5Electrical, Computer and Telecommunication Engineering Department, Kampala International University, Uganda. 2,4Electrical Engineering Department, Kampala International University, Uganda. 3Telecommunication Engineering Department, Kampala International University, Uganda 6Physical Science Department, Kampala International University, Uganda. 1adabara360@gmail.com, 2nabasahiriji.kalim@gmail.com, 3ogwal_emmanuel@gmail.com, 4mumudsunusi97@gmail.com, 5Zynak208@gmail.com, 6mundumustafa@yahoo.com Abstract: The intelligent embedded agricultural robotic system is a low cost and efficient microcontroller robot which include; A soil moisture monitoring system which monitors the moisture content of the soil in the various parts of the field and the measured data to a microcontroller unit which in turn displays the received data on a Liquid Crystal Display to determine when to irrigate or spray the farm field. An automatic car, which follows a path designed in the field, i.e., a white line on a black surface integrated with a spraying and irrigating mechanism for carrying out agricultural spray and irrigation. An automatic solar tracking system that tracks the sun's position for maximum light intensity was used to charge the DC 12V battery which was used to power to the robotic system. A refilling system with obstacle detection feature was used for refilling water, chemical or fertilizer spray in the spraying and irrigating tank integrated with the line follower robotic system. This embedded system is useful for farmers who wish to monitor the soil moisture content of the field, and automate spraying and irrigation purposes at low costs and higher efficiency. Keywords: Atmega328P Microcontroller, Buzzer, DC Motor, IR Sensor, LCD JHD162A, Light Dependent Resistor, Soil Moisture Sensor, Solar Tracking System, Robot Chassis, Ultrasonic Range Sensor, Obstacle Detection and avoidance, Wheels. 1. INTRODUCTION The global agriculture and food sector are changing rapidly because of the intensive increase of global food demand, which is, in turn, the result of population growth and significant shifts in customer preferences. There is a clear need for improvement in the sector`s technological basis to ensure its sustainable development [23]. For many years, robotic systems have been widely used for industrial production and in warehouses, where a controlled environment can be guaranteed [14]. In agriculture and forestry, research into driverless vehicles has been a vision initiated in the early 1960s with basic research on projects on automatic steered systems and autonomous tractors [21]. Recently, the development of robotic systems in agriculture has experienced an increased interest, which has led many experts to explore the possibilities to develop more intelligent and adaptable vehicles based on a behavioural approach [13]. A combined application of new sensor systems, communication technologies, Global Positioning Systems (GPS) and Geographical Information Systems (GIS) have enabled researchers to develop new autonomous vehicles for high-value crops in the agriculture and horticulture sector, as well as for landscape management [13]. Due to the busy routine of farmers to perform irrigation process and as the size of farmland increases there is a need for farmers to automate its entire methods, such as Reseeding, Seedbed preparation, Seed mapping, weeding, Micro spraying, watering morning and evening [23]. Autonomous robots can perform these tasks, as they often require numerous repetitions and horticultural activities over an extended period and a large area. Several autonomous prototypes have been described for orchards and horticultural crops, such as oranges [25], strawberries [26] and tomatoes [24]. Moreover, automated systems for site-specific irrigation is based on real-time climatic conditions have been described for high-value crops. For field crops, there are also some systems, such as the Demeter system for mechanized harvesting equipped with a camera and GPS for navigation [24], the autonomous Christmas tree weeder [27] and the API platform for patch spraying [27]. 2. TECHNIQUES INVOLVING AGRICULTURAL ROBOTS. Processes like ploughing, seeding, fertilizing, weeding, harvesting, spraying, etc. require a large amount of manpower. Hence to reduce this need, and save time and money, robots are used. 2.1 Ploughing (Seedbed preparation) [17] Primary process; the topsoil is mixed and turned to prepare a seedbed, burying the surface crop residue. 2.2 Seed mapping Recording the geospatial position of each seed as it goes underground is "seed mapping." Checking and counting seed by placing an infrared beam below the seed chute. Seed cuts infrared beam and triggers a data logger that records a position orientation of seeder. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 15-24 www.ijeais.org 15 2.3 Reseeding This is the concept of being able to identify where the seed was not placed and can automatically place another seed in the same position. 2.4 Seed placement Placing seeds so that they get maximum air, light, water. A hexagonal or triangular seeding pattern, or less space in a row and more between rows may be applied by using robots. 3. EXISTING ROBOTIC TECHNOLOGIES USED IN AGRICULTURAL Field robots work concerning the environment and medium. They change themselves according to the required condition. Mobile robots are those who possess mobility concerning a medium. The entire system moves concerning the environment. 3.1Demeter-Robot farmer Demeter is a robot that can cut crops, it looks like a regular harvester, but can drive by itself without any human supervision. Demeter has cameras on it that can detect the difference between the crop that has been cut and crop that hasn't. This information tells it where to drive, where to put its cutter head, and when it has come to the end of a crop row so it can turn around. The Demeter system strives to provide three levels of automation:  First, a "cruise control" feature, which automatically steers, drive and control the harvesting header provided to harvester operations.  "Drone" feature is allowing one operator to control several harvesters remotely.  Thirdly, a fully autonomous machine which allows a harvester to completely harvest a field with no human supervision. 3.2Weed Controller A four-wheel-drive weed-seeking robot. The task of the weed-removing device is to remove or destroy the weed. Crops that are grown in rows can be wedded by running a hoe between the crop rows. An intelligent hoe uses vision systems to identify the rows of crops and steer itself accurately between them, considerably reducing the need for herbicides. Weed identification is based on colour photography. The equipped robot helps production of weed maps identifying the plant. 3.3Robotic Gantry Traditional spraying can be very efficient, especially when they cover large areas. The robotic gantry could apply both liquid sprays and fertilizer and be able to regulate itself according to current weather conditions. If it became too windy, then the gantry could stop and wait until conditions improved [12]. 3.4 Forest Robots (Treebot) A fearless mobile robot is helping scientists monitor environmental changes in forests. Treebot consists of combine networked sensors, a webcam, and a wireless network link. It is solar-powered and moves up and down special cables to take samples and measurements for vital analysis. It is very important in the biology community to understand the interaction between the atmosphere and the forest environment. But 90% of all interaction between the environment and atmospheric conditions happens high up in the forest canopy. The Treebot helps by being stealthy enough to travel through the forest canopy along specially constructed cabling, night and day [10]. 3.5 Forester robot Forester is a particular type of robot used for cutting wood, tending trees, and pruning of Xmas tree and for harvesting pulp and hardwood and in the forests. It employs special jaws and axes for chopping the branch. [10] 3.6Robot in Horticulture Robo is used in lawns to cut the grass in gardens. It can rip any lawn, regardless of its geometric shape. In automatic mode, a fully charged Robo-mower can typically mow a garden of 2500 to 3200 sq. ft., depending on the number of obstacles in its path, slopes, the height of grass, humidity, etc. It operates electrically on rechargeable batteries, mulching blades, whispers quiet operation and without any pollution [12]. 3.7 Fruit picking robot The fruit picking robots need to pick ripe fruit without damaging the branches or leaves of the tree. The robots must be able to access all areas of the tree being harvested. The robot can distinguish between fruit and leaves by using video image capture. The camera is mounted on the robot arm, and the colours detected are compared with properties stored in memory. If a match is International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 16-24 www.ijeais.org 16 obtained, the fruit is picked. If the fruit is hidden by leaves, an air jet can be used to blow leaves out the way to a clearer view and access can be obtained. It can move, in, out, up, down, and in cylindrical and spherical motion patterns. The pressure applied to the fruit is sufficient for removal from the tree, but not enough to crush the fruit. The shape of the gripper depends on the fruit being picked [12]. 3.8 Irrigating Robot A mechatronics system controls the farm irrigation process. The robotic vehicle system works based on the concept of obstacle detection and avoidance with left turn priority. The ultrasonic range sensor performs to identify obstacles prompting the robot to turn with left preference at the edge of the field hence completing the irrigation of the entire farmland [23]. 4. 4. SYSTEM DESIGN 4.1System Model Figure: 1. System block diagram The intelligent Embedded Irrigation Robotic System is a mechatronic system integration of the following systems: i. The soil moisture monitoring system which continuously measures and monitors the soil moisture content in the different parts of the field and displays on a Liquid Crystal Display (LCD) screen. The measured values determine when to irrigate or spray and when not to. ii. The line follower (tracer) robot in the form of a vehicle which integrated with a spraying mechanism. The line tracer follows a path designed to be a white line on a black surface. iii. A solar tracking system also is known as a solar tracker which tracks the direction of maximum sunlight intensity and rotates the solar panel in that particular direction. iv. A refilling system mechanism used to refill water in the spraying tank when it's used up. 4.2 Design of soil moisture monitoring system This system continuously measures the moisture content of the soil in the various parts of the field remotely. The system consists of an Atmega 328P microcontroller, a Liquid Crystal Display, a soil moisture sensor, a buzzer, and two LEDs (Red and Green) interfaced together. Figure 2: Soil moisture monitoring system The soil moisture sensor readings from the various parts of the field are continuously being fed to Atmega 328P microcontroller in a control centre. These analogue readings are processed and displayed on a 16X2 LCD screen. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 17-24 www.ijeais.org 17 A threshold value is set to say 800, and when the reading of the soil moisture sensor exceeds this value, it implies that water is not enough in the soil and therefore irrigation has to take place. The buzzer sounds an alarm, and the red LED turns on for an indication. However, when the reading of the soil moisture content is below the threshold value, it implies that there is enough water in the soil and therefore no need for irrigation. The buzzer goes off, and the green LED turns on for indication. 4.3 Design of Line Follower (Tracer) Robotic System The Line Follower Robot, as the name suggests, is designed as an automated guided vehicle, which follows a visual line embedded on the floor. The visual line is the path in which the line follower robot goes, and it is a white line on a black surface, using a metallic robot chassis, Atmega 328P microcontroller, DC motors, a 5V relay module, IR LEDs, Photodiodes, potentiometers, resistors, LM 358 IC and other components. Figure 3: Line follower robot system  Sensors: 2 IR Sensor Modules are used as the line detecting sensors for the robot.  Controller: Atmega 328P is the main controller (brain or control centre) in the robot design. The data from the sensors (IR Sensors) are fed to Atmega 328P, and it gives corresponding signals to the Relay Motor controller (driver).  Relay module: A 4 channel 5V Relay module is used in this design as a motor controller to drive the motors of the robot. It receives signals from Atmega 328P microcontroller based on the information from the IR Sensors.  Motors: Two DC motors were used at the rear of the line follower robot. These motors provide more torque than normal motors and can be used for carrying some load as well. 4.4 IR Sensor module design Two Infrared (IR) sensor modules are designed for line detection using components which include; IR LEDs, Photodiodes, LM 358 IC (Comparator), resistors, LEDs, Potentiometers and other components. Figure 4: IR Sensor module design The working of the line follower (tracer) robot is pretty simple: detect the white line drawn on a black surface using sensors and move along that line. For line detection logic, two IR Sensors are used, which consists of IR LED and Photodiode placed reflectively, i.e., side – by – side so that whenever they come into the proximity of a reflective surface, the light emitted by IR LED will be detected by Photodiode. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 18-24 www.ijeais.org 18 The working of a typical IR Sensor  In front of a light coloured surface and a white surface. As the reflectance of the light coloured surface is high, the infrared light emitted by IR LED will be maximum reflected and will be detected by the Photodiode. Figure 5: The working of a typical IR Sensor  In the case of a white surface, which has a low reflectance, the light gets completely absorbed by the white surface and doesn't reach the photodiode. Using the same principle, IR Sensors are set up on the Line Follower Robot such that the two IR Sensors are on either side of the white line on the floor as shown below. Figure 6: Forward movement configuration When the robot moves forward, both sensors wait for the line to be detected. For example, if the IR Sensor 1 above detects the white line, it means that there is a right curve (or turn) ahead. Atmega 328P microcontroller detects this change and sends a signal to the motor driver accordingly. To turn right, the motor on the right side of the robot is slowed down using PWM, while the motor on the left side is run at normal speed. Figure 7: Left and Right turn configuration Similarly, when the IR Sensor 2 detects the white line first, it means that there is a left curve ahead and the robot has to turn left. For the robot to turn left, the motor on the left side of the robot is slowed down (or can be stopped entirely or can be rotated in the opposite direction) and the motor on the right side is run at normal speed. Atmega 328P microcontroller continuously monitors the data from both sensors and turns the robot as per the line detected by them. To increase the efficiency of white line detection, the number of sensors can be increased. An array of sensors will be more accurate than just two sensors. In this robot design, the positioning of the sensors is very important. The width of the white line plays a major role in the placement of the sensors. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 19-24 www.ijeais.org 19 4.5 Design of Solar Tracking System The robot is powered by a solar system which keeps track of the direction of the maximum sunlight intensity. The system relies on automatic tracking adaptive mechanism or predefined motion. The sensors are the main feedbacks of the system which send signals to the control system. The backbone of the control system is a microcontroller which determines which motor should move in which direction to adjust the system in such a way that the sunlight falls orthogonally on the panel. A solar tracking system is designed using two DC motors, a light sensor consisting of four LDRs and four 10 KΩ resistors, L293D motor driver IC and other components. Figure 8: Solar tracking system model Four LDRs and Four 10KΩ resistors are connected in a voltage divider fashion, and the output is given to 4 analogue input pins of Atmega 328P microcontroller. The PWM inputs of two DC motors are given from microcontroller. LDRs are the main light sensors. Two DC motors are fixed to the structure that holds the solar panel. LDRs sense the amount of sunlight falling on them. Four LDRs are divided into top, bottom, left and right. For east-west tracking, the analogue values from two top LDRs and two bottom LDRs are compared, and if the top LDRs receive more light, the vertical DC motor will move in that direction. If the bottom LDRs receive more light, the DC motor moves in that direction. For an angular deflection of the solar panel, the analogue values from two left LDRs and two right LDRs are compared. If the left set of LDRs receive more light than the right set, the horizontal DC motor will move in that direction. If the right set of LDRs receive more light, the DC motor moves in that direction. 4.6 Design of Refilling System A refilling system is designed for refilling water into the tank which holds water for spraying and irrigation purposes. This refilling point is placed at specific points in the field to add water in the tank which is mounted on the robot. The system consists of an ultrasonic sensor, a microcontroller unit, battery (power supply), relay and an indicator (LED). Figure 9: Refilling system model The ultrasonic sensor continuously sends out acoustic waves, and when these waves come into proximity with any obstacle, the waves have reflected the sensor. A high signal is then fed to the microcontroller unit, and decision making is made depending on the distance of the obstacle calculated by the microcontroller unit. When the distance of the obstacle from the refilling point is less than "20" (calculated by microcontroller unit), the valve is turned on through the relay and turned off when the distance calculated is greater than the threshold value of "20". International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 20-24 www.ijeais.org 20 5. RESULTS AND DISCUSSION 5.1 Soil Moisture Monitoring System The soil moisture sensor measures the amount of soil moisture content in the various parts of the field, and the data is sent to MCU. The data is stored in EPROM chip which is simultaneously displayed on LCD. Microcontroller stores the digital data after converting the analogue data from the sensor unit through ADC. Below is the list of figures in which LCDs the output as per changing soil moisture sensor values (readings). Condition (sensor value<800) Figure 10: LCD of sensor value <800 Condition (sensor value>800) Figure 11: LCD of sensor value >800 It was observed that the soil moisture content of the soil can be monitored in an isolated place remotely using a soil moisture sensor and can be fed to a microcontroller and displayed on an LCD. 5.2 Line follower (tracer) robot The sensors in this system are a type of infrared sensor that senses the line and gives the feedback to the microcontroller unit.  The battery activates the circuit.  The sensor transmitters (IR LEDs) transmit the frequency, which reflects from the surface. Sensor receiver (Photodiodes) receive the reflected frequency and gives it to the microcontroller.  The microcontroller unit processes it and gives the signal to the Relay module motor controller.  The Relay module motor controller rotates the motors as per the signal received, and then the wheels rotate. 5.2.1 Forward movement For forward movement, both the left and right sensors are on the white surface hence none of the sensors detects the black line. Both the left and right motors rotate forward hence rotating the wheels, and the robot moves forward. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 21-24 www.ijeais.org 21 Figure 12: Forward movement 5.2.2 Left turn For a left turn, the right sensor detects the back line and the right sensor is on the white surface. The left motor is stopped or slowed down using PWM (differential steering), and the right motor rotates at normal speed. Hence, the robot turns left. Figure 13: Left turn 5.2.3Right turn For a right turn, the right sensor detects a black line and the left sensor is on the white surface. The right motor is stopped or slowed down using PWM while the left motor rotates at normal speed. Thus, the robot turns right. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 22-24 www.ijeais.org 22 Figure 15: Right turn 5.3 Solar tracking system The solar tracking system is a device onto which solar panels are fitted which tracks the motion of the sun across the sky ensuring that the maximum amount of sunlight strikes the panels throughout the day. After finding the sunshine, the tracker will try to navigate through the path guaranteeing the best sunlight is detected. This solar tracker is a double axis solar tracker having both a horizontal and a vertical axis and so can track the sun's apparent motion exactly anywhere in the world. This system can also be used to control astronomical telescopes and for concentrating a solar reflector toward the concentrator on heliostat systems. By tracking the sun, the efficiency of the solar panels can be increased by 30-40%. This system is an activity tracker which uses motors and gear trains to direct the tracker as commanded by a controller responding to the solar direction. The system has light-sensing trackers made of arrays of four Light Dependent Resistors configured differentially so that they output a null when receiving the same light flux. Mechanically, they are omnidirectional and are aimed 90 degrees apart. This causes the steepest part of their cosine transfer functions to balance at the steepest part, which translates into maximum sensitivity. Figure 17: a Solar tracking system 5.4 Refilling system The circuit of the refilling system was first built on a breadboard for quick testing to see whether it worked well and was then later transferred on a printed circuit board International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 23-24 www.ijeais.org 23 The system consists of an ultrasonic sensor which transmits acoustic waves via the "trig eye," and the reflected waves are received by the "echo eye"; a microcontroller unit which receives the signals from the sensor unit and makes decisions based on the received data. The detection distance was set at "20" as the threshold value. Below this value, the microcontroller unit would turn on the valve via a relay interfaced with the microcontroller and this condition is indicated by an LED. The system was then tested to confirm its working, and it was observed that above the threshold value nothing happens, i.e., the valve remains closed, and below the threshold value, the valve is turned on. 5. CONCLUSION AND FUTURE WORK Figure 4: Intelligent Embedded Irrigation Robotic System This system targets both large and small scale plantations both indoor and outdoor plants which can handle tasks such as detecting soil moisture content, automatic solar charging system, refilling system and irrigation with lower capital cost and better accuracy. This project design can be improved by incorporating more sensors (Temperature sensor, Humidity sensor, Motion sensor, PH Sensor) and, to integrate ZIGBEE module and Raspberry Pi for precision controls of the robot that can detect at what location of the farm field that need attention. REFERENCES [1]. Angeles, J. Fundamentals of Robotic Mechanical Systems: Theory, Methods, and Algorithms, (June 7-10, 2009). [2]. Arnold, James E. "Soil Moisture." NASA. Retrieved (15 June 2015). [3]. Ball, Robert Stawell, and Theory of screws: a study of the dynamics of a rigid body, Hodges, Foster, and Co., (1876). [4]. Bar-Shalom, Yaakov, and Li, Xiao-Rong. Estimation and Tracking, Principles, Techniques, and Software, (2007). [5]. Bolton, W., Mechatronics: electronic control systems in mechanical and electrical engineering, Longman, Singapore, 1999. [6]. Campbell, J. E. (1990). Dielectric properties and influence of conductivity in soils at one to fifty Megahertz. Soil Science Society of America Journal 54:332-341 [7]. Canudas de Wit, C., Siciliano, B. and Bastin, Georges, (Eds.), Theory of Robot Control. [8]. Conner, W. H. and J. R. Toliver. 1990. Long-term trends in the bald cypress (Taxodiumdistichum (L.) Rich.) Resource in Louisiana. Forest Ecology and Management 33/34:543-557. [9]. Decagon Devices "List of peer-reviewed publications using Decagon soil moisture sensors." Retrieved: (20 July 2015). International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2000-000X Vol. 3 Issue 1, January – 2019, Pages: 24-24 www.ijeais.org 24 [10]. Dickson, R.E., and T.C. Broyer. 1972. Effects of aeration, water supply, and nitrogen. [11]. Dirksen, C. and S. Dasberg. Improved Calibration of time domain reflectometry soil water content measurements. Soil Science Society of America Journal. 57:660–667 [12]. Gaikwad, Pramod. "Galvanic Cell Type Sensor for Soil Moisture Analysis." Analytical Chemistry. 87: 7439–7445. doi: 10.1021/acs.analchem.5b01653. [13]. Gupta, S. C., and R.J. Hanks. 1972. Influence of water content on the electrical conductivity of the soil. Soil Science Society of America Proc. 36:855–858. [14]. Handbook of robotics, Eds. Siciliano, Bruno and Khatib, Oussama. Springer, (2008). [15]. John David Warren, John Adams, and Harald Molle: Arduino robotics, Technology in action, (2011). [16]. Jon Carter Farmer, Trent Lugar, and Hwajung Lee, "Computer Aided Rescue Systems with Mobile Robot Agents," Big South Undergraduate Research Symposium, Radford, Virginia, April 9~10, (2010). [Abstract and Presentation], Undergraduate Research [17]. Kanal, L. N., and Lemmer, J. F., (Eds), Uncertainty in Artificial Intelligence. Latombe, Jean Claude. Robot motion planning, (2009). [18]. N., ISO/TR 8373: Manipulating Industrial Robots Vocabulary, ISO, (1988). [19]. Nilsson, N., Artificial intelligence: a new synthesis, (1998). [20]. Paul, R. P. Robot Manipulators: Mathematics, Programming, and Control. [21]. Robert H. Bishop: The Mechatronics Handbook. The University of Texas, (2002). [22]. Skowronski, Jan M., Control Theory of Robotic Systems, World Scientific, (1989). [23] Adabara I, 2018. Obstacle Detection and Avoidance Irrigating Robotic System. Mediterranean Journal of Basic and Applied Sciences (MJBAS) Volume 2, Issue 1, Pages 30-39, January-March 2018 [24] Chi, Y.T., and P.P. Ling.2004. Fast fruit identification for robotic tomato picker. ASAE Paper No. 043083. St. Joseph Mich: ASAE. [25] Hannan, W., and F.T. Burks. 2004. Current developments in automated citrus harvesting. ASAE Paper No. 043087. St. Joseph Mich: ASAE. [26] Kondo, N., K. Ninomiya, S. Hayashi, T. Ohta, and K. Kubota. 2005. A new challenge of the robot for harvesting strawberry grown on tabletop culture. ASAE Paper No. 043083. St. Joseph Mich: ASAE. [27] Bakker, Tijmen, Kees Asselt van, Jan Bontsema, Joachim Müller, and Gerrit Straten van.2010. Systematic design of an autonomous platform for robotic weeding. Journal of Terramechanics, 47 (2010): 63 73.