An-Najah National University Faculty of Engineering and Information Technology Computer Engineering Department Graduation Project 2 Holy Land Juices Accomplished by: Israa Odeh, Raghad Sabri. Supervisor: Dr. Raed Qadi. Presented in partial fulfillment of the requirements for a Bachelor’s degree in Computer Engineering. 3 September 2023 يمِ حِ الرَّ نِ مِ حْ الرَّ هللاِ مِ سْ بِ 1 Dedication With Allah's infinite compassion and grace, the Most Merciful, we commence this dedication, acknowledging His boundless blessings that have guided us through the path of knowledge. To all those who have added their beautiful touch through their support and inspiration on this journey. To our beloved families, whose unwavering encouragement and love have been our driving force and the motivation to persist, who stood by us during the late nights and challenging moments, reminding us that we were never alone on this path. To our mentors and educators, whose guidance and expertise have shaped our understanding and passion for the world of computer engineering. 2 Acknowledgment We extend our heartfelt gratitude to all those who have supported and contributed to the successful completion of our hardware graduation project, Holy Land Juices. Their invaluable guidance, encouragement, and assistance were integral to the realization of this endeavor. Foremost, we express our sincere thanks to our supervisor, Dr. Raed Qadi, whose support, expertise, and insightful feedback were pivotal throughout the project's entirety. His mentorship has been truly invaluable, enriching our learning experience. Additionally, our appreciation extends to the faculty members of the Computer Engineering Department for fostering a suitable learning environment and providing the necessary resources for project completion. We are equally thankful to our extraordinary families and friends, who consistently offered encouragement, understanding, and belief in our capabilities. We also extend our gratitude to the teacher assistants who generously volunteered their time and cooperation to oversee the diverse testing phases of the project. In closing, our profound gratitude extends to every individual who played a part, regardless of its magnitude, in shaping this project and contributing to the achievement of this milestone. Your contributions have indelibly marked our academic journey, and for that, we are truly thankful. 3 Disclaimer This report was written by students Israa Odeh and Raghad Sabri at the Computer Engineering Department, Faculty of Engineering, An-Najah National University. It has not been altered or corrected, other than editorial corrections, as a result of the assessment, and it may contain language as well as content errors. The views expressed in it together with any outcomes and recommendations are solely those of the students. An-Najah National University accepts no responsibility or liability for the consequences of this report being used for a purpose other than the purpose for which it was commissioned. 4 Table of Contents Dedication .................................................................................................................................... 1 Acknowledgment ......................................................................................................................... 2 Disclaimer .................................................................................................................................... 3 List of Figures .............................................................................................................................. 5 Abstract ........................................................................................................................................ 6 1 Introduction ............................................................................................................................... 7 1.1 General background ............................................................................................................ 7 1.2 Objectives of the work ........................................................................................................ 7 1.3 Significance of the work ..................................................................................................... 7 1.4 Organization of the report ................................................................................................... 7 2 Theoretical Background and Previous Work .............................................................................. 9 3 Methodology ........................................................................................................................... 10 3.1 Hardware Components ...................................................................................................... 10 3.2 Mechanism of Action ........................................................................................................ 17 3.3 Constraints ........................................................................................................................ 22 4 Results and Discussion ............................................................................................................ 23 5 Conclusions and Recommendations ......................................................................................... 24 References .................................................................................................................................. 25 5 List of Figures (LOF) Figure (3.1): Arduino Mega 2560 ............................................................................................... 10 Figure (3.2): Arduino UNO ........................................................................................................ 10 Figure (3.3): IR sensor ................................................................................................................ 11 Figure (3.4): Ultrasonic sensor ................................................................................................... 11 Figure (3.5): Laser diode ............................................................................................................ 11 Figure (3.6): LDR light sensor module ....................................................................................... 12 Figure (3.7): 12V liquid pump .................................................................................................... 12 Figure (3.8): 12V DC gear motor ................................................................................................ 12 Figure (3.9): H-Bridge L298N .................................................................................................... 13 Figure (3.10): 5V DC gear motor ................................................................................................ 13 Figure (3.11): 4-Relay module .................................................................................................... 13 Figure (3.12): ISO air cylinder .................................................................................................... 14 Figure (3.13): Solenoid air valve ................................................................................................ 14 Figure (3.14): 2-Relay module .................................................................................................... 14 Figure (3.15): 12V NEMA17 stepper motor ............................................................................... 14 Figure (3.16): YS-DIV268N-5A driver ....................................................................................... 15 Figure (3.17): MG996R high torque servo tower pro .................................................................. 15 Figure (3.18): Mean Well T-60A DC switching power supply .................................................... 16 Figure (3.19): The design of the Holy Land Juices system .......................................................... 17 Figure (3.20): Bottle size detection stage .................................................................................... 17 Figure (3.21): Filling stage ......................................................................................................... 18 Figure (3.22): 2800 ml liquid tanks ............................................................................................. 18 Figure (3.23): Caps’ slider .......................................................................................................... 19 Figure (3.24): Star wheel ............................................................................................................ 19 Figure (3.25): Bottle’s slider ....................................................................................................... 19 Figure (3.26): Capping stage ...................................................................................................... 20 Figure (3.27): Classification stage .............................................................................................. 21 6 Abstract Nowadays, numerous companies are involved in beverage manufacturing, such as the National Beverage Company Coca-Cola/Cappy (NBC), and water bottling companies. These businesses rely on automating the filling and production processes to create a wide variety of drinks in substantial quantities with high precision. Manual methods of filling and capping, like those used by street drink vendors with carts, would demand significant time and effort, are susceptible to human labor errors, and the maximum production capacity per day would be insufficient to effectively meet customer demand. Additionally, they may not maintain the same level of quality and consistency because achieving precise proportions of juice and water manually each time is challenging. Therefore, automating this manual process by implementing an automated filling and capping machine is necessary. Our solution is to create an automatic juice filling and capping machine, comprising four key stages: detecting the size of the inserted bottle using three distinct IR Sensors in the initial stage, allowing only correctly sized Cappy bottles to proceed, while promptly rejecting others if they are oversized or undersized, ensuring a seamless process transition; then filling juice bottles with specific juice type and water concentrations in the following stage; conducting the capping process in the third stage; and finally, placing the capped bottles in designated boxes according to the filled juice type. The ultimate goal is to fully automate the juice filling and capping process, thereby reducing the reliance on manual labor. The Holy Land Juices project is developed using components such as the Arduino Mega, Arduino UNO, DC, servo, and stepper motors, liquid pumps, H-Bridge, YS-DIV268N driver, relays, ultrasonic sensors, IR sensors, laser diode, LDR light sensor module, and pneumatic pistons consisting of an air solenoid valve and an air cylinder. 7 1 Introduction 1.1 General background Meeting the ever-expanding customer demands solely through human resources has become a daunting task in the global beverage market's rapid expansion. Consequently, it is imperative to investigate alternative avenues that reduce our reliance on human labor and lean toward automation. This strategic shift not only trims production expenses but also results in more competitive pricing, facilitating businesses in effectively addressing the mounting demands. Embracing automated filling and capping machines within the beverage industry has not only enhanced production efficiency but substantially curtailed production line downtime. 1.2 Objectives of the work The objective of implementing this system is to achieve automation of the juice filling and capping procedures. This automation not only saves time and minimizes effort but also boosts production while reducing labor expenses. In contrast to the resource-intensive manual method, an Arduino-based filling and capping machine is utilized to automate the system's functions, ensuring outcomes of good precision compared to manual execution. Through this automation, the filling and capping processes are carried out efficiently and consistently, underscoring the precision of each individual step. Consequently, replicating the same filling and capping process results in identical juice bottles with uniform proportions of the juice-water mixture and consistent capping tightness. This approach guarantees the production of juice bottles with consistent and good- quality standards. The integration of this automated approach holds the potential for optimizing both operational efficiency and overall product quality. 1.3 Significance of the work In the world of beverage filling and capping, a number of vital industry standards are crucial, including customer satisfaction, market demand, and machinery production percentages. By combining these metrics, we can gauge the prowess of companies in this sector and indicate their potential for success. As a result, automation has become imperative. By using an Arduino-based system, we have automated the juice filling and capping process by allowing users to specify the juice type to be filled. The process begins with the detection of the bottle's size, allowing only 330ml Cappy-sized bottles to pass. The second step involves filling the juice and water into the bottle, capping the bottle, and classifying the juice bottles into the appropriate containers based on their juice type – mango or blueberry. The system is beneficial for the beverage industry in terms of enhancing productivity and saving time. 1.4 Organization of the report The main body of the report is divided into several chapters, each serving a distinct purpose. The first chapter, known as the Introduction, encapsulates the project's general background, work objectives, significance, and the logical arrangement of the report. The second chapter, called "Theoretical Background and Previous Work," puts the project in context with what is already known. It looks at past research and theories that support the current work. 8 After that, the Methodology chapter describes the system's hardware components, mechanism of action, and how any constraints encountered were dealt with. Then, the Results and Discussion chapter presents the project's findings and engages in a discussion of the results. The Conclusions and Recommendations chapter, the final section, summarizes the project and offers valuable insights for refining and enhancing the approach in future endeavors. 9 2 Theoretical Background and Previous Work Numerous studies on automatic filling and capping juice machines have been conducted in recent decades. Smith et al. [1] propose a strategy involving a conveyor belt to transport empty bottles to the filling station, followed by the capping section. Once filled and capped, the bottles move to the packaging area. This process, monitored by a human interface, optimizes performance and increases productivity based on bottle size and shape while reducing manpower and energy consumption. A study by Koggalage et al. [2] focuses on developing a cost-effective automated filling and capping machine tailored to small-scale industries facing financial constraints. This research project highlights the importance of creating an approach that not only resolves complexities but also ensures affordability and accessibility. The resultant machine boasts a simplified design and operates using electric power, effectively replacing pneumatic components. Sensing mechanisms are integrated into the process to enable proper automation. The study by Lakshmeesha et al. [3] focuses on automating small-scale bottle-filling industries using Arduino technology. It replaces costly PLC boards with affordable Arduino Uno microcontrollers to improve efficiency. The paper outlines the system's components, such as relays, solenoid valves, and IR sensors, and explains its working principle. The system's advantages include cost-effectiveness, reliability, and ease of use. The research has potential applications in diverse industries. 10 3 Methodology 3.1 Hardware components: To ensure accurate and smooth operation, a variety of hardware components were necessary for constructing this system. The components employed in building this system include: Arduino Mega 2560: This microcontroller served as the central control unit for a diverse range of components. These components included a DC motor for the conveyor belt and its associated H-Bridge, IR sensors for detecting bottle sizes and allowing only Cappy-sized bottles to pass, as well as an IR sensor to detect the presence of a bottle at the filling stage, and an additional IR Sensor to detect the presence of caps. The microcontroller also supervised the pneumatic piston and its relay, which was utilized to eject bottles not conforming to Cappy-sized bottles, liquid pumps with their corresponding relays, ultrasonic sensors, and a servo motor responsible for adjusting the slider's position based on the type of juice. Its primary role involved processing inputs and executing actions in accordance with the predefined requirements. Figure (3.1): Arduino Mega 2560. Arduino UNO: This microcontroller is employed to control the star wheel components, which encompass the bottle-holding mechanism utilizing the NEMA17 stepper motor and its YS-DIV268N driver. Alongside this, a laser diode and an LDR light sensor module are tasked with detecting bottle presence on the star wheel to initiate the capping process. Furthermore, it supervises the pneumatic piston responsible for pressing the cap onto the bottle, as well as a 5V DC motor. The microcontroller's role includes receiving and processing commands to subsequently execute corresponding actions. Figure (3.2): Arduino UNO. 11 IR sensor This system incorporated a total of five IR sensors. Three of these sensors were dedicated to detecting the size of the bottles introduced into the system. The first sensor was positioned at the base of a wooden holder to identify the bottom of the inserted bottle. The second sensor was strategically placed slightly below the top of a Cappy-sized bottle, maintaining a specific distance. The third sensor was fixed a bit higher than the level of the Cappy-sized bottle to detect larger bottles. The fourth sensor was employed to identify the arrival of a passed Cappy-sized bottle at the filling stage, while the fifth sensor continuously monitored the presence of caps to control the activation of the conveyor belt system. Figure (3.3): IR sensor. Ultrasonic sensor Three ultrasonic sensors were required due to the presence of three liquid tanks: mango juice, blueberry juice, and water. These sensors continuously monitored the liquid levels to ensure they remained within permissible ranges, avoiding both depletion and overfilling. Figure (3.4): Ultrasonic sensor. Laser diode Emits a laser beam that is consistently detected by the LDR sensor fixed on the corresponding spot. When the beam is interrupted, it indicates that the bottle has reached the star wheel. Figure (3.5): Laser diode. 12 LDR light sensor module It is positioned at the end of the conveyor belt, this sensor is aligned so that when a bottle enters the star wheel, it interrupts the laser beam. This interruption signals the start of the star wheel's rotation, an integral part of the bottle capping mechanism. Figure (3.6): LDR light sensor module. 12V liquid pump Because of the existence of three liquid tanks, the situation calls for the use of three liquid pumps to draw the liquids into the bottles. Figure (3.7): 12V liquid pump. 12V DC gear motor It was incorporated into the conveyor belt system, functioning to rotate the belt as required. Figure (3.8): 12V DC gear motor. 13 H-Bridge L298N It is used to connect the 12V DC gear motor with the 12V power supply and the Arduino Mega board, this component facilitates motor activation and direction control. Figure (3.9): H-Bridge L298N. 5V DC gear motor After the pneumatic piston capper activates to press the cap, this motor initiates rotation to close the cap, effectively sealing the bottle by tightening the cap. Figure (3.10): 5V DC gear motor. 4-Relay module The first three relays of the module connected the liquid pumps to the Arduino Mega board and the 12V power supply. The fourth relay linked a 5V DC motor, utilized for cap tightening, to the Arduino Mega board, enabling control over the motor's activation. Figure (3.11): 4-Relay module. 14 220V pneumatic piston Two pneumatic pistons were employed: the first for ejecting bottles larger or smaller than the Cappy-sized ones, and the second for pressing caps onto the bottles. Each piston consists of a DNC-32-50-PPV-A ISO air cylinder and an Airtac 4V210-08: solenoid air valve - 4V21008A. Figure (3.12): ISO air cylinder. Figure (3.13): Solenoid air valve. 2-Relay module The first relay connected the 220V capper pneumatic piston to both the Arduino board and the 220V power source. The second relay performed a similar task, connecting the bottle’s ejector pneumatic piston to the same components. Figure (3.14): 2-Relay module. 12V NEMA17 stepper motor It is connected through a coupler to the central rod of the star wheel, this motor serves to execute accurate step-by-step motions upon a bottle's arrival at the star wheel. These movements are crucial for drawing a cap from the caps' slider and placing it onto the bottle, aligning the bottle beneath the capper pneumatic piston, before finally returning to its original position. Figure (3.15): 12V NEMA17 stepper motor. 15 YS-DIV268N-5A driver It is coupled with a NEMA17 stepper motor and is used to precisely control and automate motion. The driver translates input signals into specific step movements, allowing the NEMA17 stepper motor to achieve accurate positioning and rotation. This driver enabled us to control both the motor's current and its stepping mode. Figure (3.16): YS-DIV268N-5A driver MG996R high torque servo tower pro It is connected to a plastic base, which is attached to a slider that moves to the left or right box according to the juice choice. Figure (3.17): MG996R high torque servo tower pro. 16 Mean Well T-60A +5V/5A, +12V/2.5A, -5V/0.5A DC switching power supply It is employed to supply the necessary power to the system hardware components, ensuring their seamless operation. The 5V supply is utilized in place of the 5V required from the Arduino Board, while the 12V supply is employed to power 12V components. Figure (3.18): Mean Well T-60A DC switching power supply. 17 3.2 Mechanism of action The implementation of this project was divided into three key stages. Firstly, the overall design of the project was created, as shown in Figure (3.19), ensuring a comprehensive plan was in place. Next, the project hardware was physically constructed, bringing the design to life. Finally, the necessary connections and code were implemented to ensure the seamless integration of all components, ensuring the project works harmoniously as a unified entity. Figure (3.19): The design of the Holy Land Juices system. As evident from Figure (3.19), the project encompasses four distinct stages, which are as follows:  Bottle size detection stage: During this phase, bottles placed onto the conveyor belt by workers undergo a size check to permit the passage of exclusively Cappy-sized bottles to subsequent stages. This implies that any smaller or larger bottles are ejected into an external box integrated into the design, which serves to contain improperly sized entries. To accomplish this, three distinct IR sensors are mounted on a wooden stand at varying heights. One is positioned near the stand's bottom to detect smaller bottles, another just beneath the top of the Cappy-sized bottle to identify Cappy bottles, and the last slightly above the Cappy-sized bottle to detect larger ones. The ejection process is accomplished using a pneumatic piston, serving as an ejector mechanism. Upon completion of this process, only appropriate bottles will proceed to the filling stage. Figure (3.20): Bottle size detection stage. 18  Filling Stage: In this phase, the bottle is filled with one type of juice, either mango juice or blueberry juice. Where users can select the required juice before starting the system. Depending on the choice, the bottle is filled with the chosen juice at a standard concentration and mixed with water to create a balanced and tasty blend. Figure (3.21): Filling stage. For this process, three 2800 ml tanks are used: one for mango juice, one for blueberry juice, and one for water. An illustration of these tanks can be seen in Figure (3.22). Each tank has a liquid pump fixed on one side at the bottom, and an ultrasonic sensor at the top of it to ensure there are sufficient liquid levels to fill the bottle. The liquid pumps are connected to pipes mounted on a wooden stand. Additionally, the stand holds an IR sensor that detects the bottle's presence under the pipes to start the filling process. Figure (3.22): 2800 ml liquid tanks. 19 The first two stages are positioned and managed on the conveyor belt side, while the last two stages are located on the left side of it.  Capping Stage: Once the bottle is filled, the next step is to cap it. This stage employs a set of 3D printed components, including the caps’ slider shown in Figure (3.23), the star wheel depicted in Figure (3.24), and the bottle slider displayed in Figure (3.25). The caps’ slider holds the bottle caps in place, while the star wheel functions as a holder for the bottle as it leaves the conveyor belt. Figure (3.23): Caps’ slider. Figure (3.24): Star wheel. Figure (3.25): Bottle’s slider. 20 As the bottle enters the star wheel, it triggers an LDR light sensor module mounted on the conveyor belt's outer edge. This interruption of the laser indicates that it is time to begin the capping process. The star wheel's stepper motor initiates movement, allowing the bottle to draw a cap from the caps’ slider. The star wheel continues its motion until it reaches a corner where a wooden holder is located. This holder accommodates the capper pneumatic piston and the 5V DC motor with its capping mechanism. At this point, the stepper motor pauses briefly, and the capper pneumatic piston descends to press the cap onto the bottle. Subsequently, the 5V DC motor activates to tighten and secure the cap. Once this process completes, the motor turns off, and the capper pneumatic piston returns to its normal position. The star wheel's stepper motor then resumes its motion, moving the bottle out of the star wheel and into the subsequent classification stage. Figure (3.26): Capping stage.  Classification Stage: Now that the bottle is filled and capped, it is time to place it in the correct box. This makes sorting various juice bottles based on their juice type easier. Workers can simply take the bottles and put them into the designated packages without needing to sort them manually. To achieve this, a curved metal piece is installed at the end of the conveyor belt. As the stepper motor continues its motion, the bottle smoothly collides with this metal piece. This causes the bottle to exit the star wheel and slide onto a plastic slider positioned on top of a servo motor. The servo motor is placed in a way that it can move to the left, towards the mango juice box, or to the right, towards the blueberry juice box, based on the chosen juice type. This ensures that the bottle ends up in the appropriate box without manual intervention. This automated process significantly reduces the time needed for sorting and separating different juice types, streamlining the overall operation. 21 Figure (3.27): Classification stage. 22 3.3 Constraints During the project, we faced various challenges that disrupted its progress. At each stage, new constraints and issues arose, including the following: One of the main challenges we encountered was financial. The project required costly components such as the conveyor belt system, wooden handler, hardware like motor drivers and pneumatic pistons, 3D printed parts, and more. The total cost exceeded 2,000 shekels, a significant amount for students working on a graduation project. Dealing with the financial obstacle, we connected with some acquaintances in the industry field to get components at lower costs, making the project possible within our budget limits, otherwise the cost would be much higher than what we obtained. On the other side, we faced critical issues related to the IR sensors either for the bottle size detection, the caps presence detection, or the bottle presence in the filling stage detection, they were affected continuously by other infrared resources from sunlight or even fluorescent lights, which leads to interference problems, which in its turn affects the IR receiver ability to detect the right original signal among all other unrequired signals, therefore the sensor doesn't work properly and generates incorrect outputs. Furthermore, because these sensors are very sensitive, there are times when they pick up wrong signals because of electrical problems or other outside influences. This usually messes up how the whole system is supposed to work together. To tackle this, we strategically placed the project in a shaded corner to avoid sunlight interference. We also isolated the IR sensors by mounting them on wooden stands, serving as protection against external signals. In critical scenarios, we swapped out sensitive IR sensors that were not working at all with a laser diode and its LDR light sensor module. For instance, the sensor that is employed to identify bottle presence on the star wheel, triggering the rotation of the stepper motor as the bottle enters. Another challenge pertained to the 3D-printed components, particularly the star wheel and capper cap, which were not accurately produced to the exact dimensions needed. This was due to their resizing to accommodate the Cappy bottle, leading to occasional failures in the system. When the Cappy bottle entered the star wheel, it did not fit perfectly within the gaps, prompting us to design a curved 3D part encircling the star wheel to prevent bottle misplacement. Additionally, the weight and size of the capper cap posed an issue, as it did not align precisely, impacting the tightness of the capping process, albeit still functional. Our resolution involved crafting a plastic insert for the capper cap, effectively mitigating the problem's impact. Designing the wooden structure of the system was the last hurdle. Finding a carpenter for graduation project designs was tough due to time constraints on their regular work. A week after searching, we found one who dedicated a whole day to helping us design and apply what we needed, enabling us to achieve our desired structure and shape. 23 4 Results and Discussion Holy Land Juices system successfully demonstrated its capability to produce two distinct juice types, namely mango and blueberry, based on user preferences selected. This advancement effectively addresses the longstanding challenge associated with manual procedures for filling and capping juice bottles. The implementation of the system's four integral stages: size detection, filling, capping, and classification represents a remarkable leap toward automappating and optimizing the juice production process. The unique proposition of the Holy Land Juices system lies in its holistic integration of these stages into a singular, comprehensive system. This approach not only overcomes challenges related to manual labor but also harnesses technology to deliver consistent and high-quality juice production. The integration of microcontrollers, sensors, motors, and communication modules exemplifies the synergy between computer engineering principles and the beverage manufacturing domain. While the system's achievements are noteworthy, the project faced many challenges during its implementation. Budgetary constraints presented a substantial barrier, requiring adaptability to obtain crucial components and services within the defined budget limits. Moreover, technical obstacles emerged due to the vulnerability of IR sensors to external interferences, and the lack of precision in fabricating 3D-printed components resulted in operational problems within the capping mechanism. 24 5 Conclusions and Recommendations In conclusion, the successful implementation of the Holy Land Juices system not only highlights its potential to revolutionize juice production but also showcases the collaborative synergy between engineering and industry. Through the integration of advanced hardware components, microcontrollers, and intelligent design, this system streamlines operations, enhances product quality, and reduces reliance on manual labor. As we look to the future, there is room for further improvements in efficiency and reliability through the refinement of sensor technology and optimization of the capping process. In this ever-expanding global beverage market, embracing automation as our trusted ally is essential. This transformative approach not only reduces production costs but also ensures more accessible pricing, empowering businesses to meet the rising tide of consumer demands. With automatic filling and capping machines leading the charge, we enter a new era of production excellence, where precision and efficiency reign supreme and every drop of your favorite beverage is crafted to perfection. This is not just a shift; it is a revolution that quenches your thirst and propels businesses toward success in this field. 25 References: [1]: Joseph Smith, et al. “Automatic Adjustable Filling and Capping Machine Using Programmable Logic Controller and Human Interface.” IOSR Journal of Mechanical and Civil Engineering (IOSRJMCE), 17(6), 2020, pp. 23-44. [2]: R. L. W. Koggalage, A. G. M. I. S. Wijesinghe, H. P. S. S. Caldera and R. R. Samarawickrama, "Design and Implementation of an Automated Multi-Purpose Filling and Capping Machine," 2021 From Innovation To Impact (FITI), Colombo, Sri Lanka, 2021, pp. 1-5, doi: 10.1109/FITI54902.2021.9833035. [3]: Lakshmeesha, Kotian, Ganesh, and Sriganesh. (n.d.). Automated Bottle Filling & Capping Machine using ARDUINO. https://ijics.com/gallery/16-may-669.pdf