1 An-Najah National University Faculty of Engineering and Information Technology Computer Engineering Department Graduation Project II TOOLGO Prepared by: Areen Ateeq & Eyad Al Hasan Supervised by: Dr. Abdallah Hasan Rashed Presented in partial fulfillment of the requirements for bachelor’s degree in computer engineering. 2 Acknowledgment: As a start, we thank God for blessing us and entrusting us with our task. We wish to use the information we have gained through the kindness of God to benefit our religion and country. We are extremely thankful to our supervisor, Dr. Abdallah Hasan Rashed; we really feel happy to have him as our supervisor. Thanks for constantly listening to us and for encouraging us, in addition to providing advice continuously. Also, we would like to thank our families for providing support. We could not have completed this challenge without their assistance. 3 Disclaimer Students Areen Ateeq and Eyad Al Hasan from the Computer Engineering Department of the Faculty of Engineering at An-Najah National University prepared this report. An-Najah National University disclaims all duty and responsibility for the outcomes of using this study for reasons other than those for which it was authorized, including the possibility that it may include linguistic or informational errors. 4 Content Acknowledgment ................................................................................................. 2 Disclaimer ............................................................................................................ 3 Table of Figure ..................................................................................................... 5 Abstract ................................................................................................................ 6 1. Introduction ........................................................................................................... 7 1.1 The problem ................................................................................................... 7 1.2 Project importance ......................................................................................... 7 1.3 Project objective and scope ........................................................................... 7 Report Organization ............................................................................................ 9 2. Constraints and Earlier Coursework.................................................................. 10 2.1 Constraints ...................................................................................................... 10 2.1.1 insufficient budget .................................................................................... 10 2.1.2 limited mechanical expertise ................................................................... 10 2.1.3platform organization ................................................................................ 10 2.1.4 limited access to some components ........................................................ 10 2.1.5 ESP32 pins are not enough ...................................................................... 10 2.2 Earlier coursework ......................................................................................... 10 3. Literature Review ............................................................................................... 11 4. Methodology ...................................................................................................... 12 4.1 Component .................................................................................................. 12 4.2 ESP32 Connection ....................................................................................... 14 4.3 Movement part ............................................................................................. 17 4.4 Vending Machine ...................................................................................... 19 4.5 App Inventor ................................................................................................ 23 4.6 Ending process ............................................................................................. 24 5. Results and Discussion ...................................................................................... 25 6. Conclusion and Future work ............................................................................. 27 6.1 Conclusion ................................................................................................... 27 6.2 Future work .................................................................................................. 27 5 Table of Figure Figure 1: Project at first stage without any work .................................................. 12 Figure 2: Control Stepper Motor with A4988 Motor Driver ........................................... 17 Figure 3: Connecting each stepper motor with a wheel ................................................. 17 Figure 4: priority page ................................................................................................................. 18 Figure 5: ESP-CAM ........................................................................................................................ 19 Figure 6: Ultrasonic at the bottom of the machine ........................................................... 19 Figure 7: stepper motors for vending machine .................................................................. 20 Figure 8: Vending machine after connecting the helical spring .................................... 20 Figure 9: Drivers for motors (vending machine and wheels) ....................................... 20 Figure 10: Login page ................................................................................................................. 20 Figure 11: Card on machine ...................................................................................................... 20 Figure 12: Vending machine page ........................................................................................... 21 Figure 13: Buttons on machine ................................................................................................ 22 Figure14: Lift scissor diagram .................................................................................................. 22 Figure 15: Hardware used to build lift scissor ..................................................................... 23 Figure 16: Page1 ........................................................................................................................... 23 Figure 17: Page2 ........................................................................................................................... 23 Figure 18: Page3 ........................................................................................................................... 24 Figure19: Finish button .............................................................................................................. 24 6 Abstract We think that hospitals suffer from a lack of organization in the use of medical tools in emergency rooms, and because human life and health are the most important things that can be thought of, we decided to make a machine that carries medical tools. The nurse calls the machine while he is in the patient’s room instead of going by himself and bringing the necessary tools, and thus we save time and effort for the nurse. The main objective of our project is to support the nurse's work by providing necessary medical products. This reduces the nurse's effort to go to the medical tool room and then return to aid by making necessary procedures, which later also helps the doctor diagnose the patient's condition faster and thus receive the necessary treatment. We designed a machine that can provide medical products using a vending machine system (all boxes filled with medical products), and to be more secure, the machine activates using the nurse’s card. To be more effective, the machine is supported by a scissor lift (using a 3D printer). This machine will move between the hospital rooms (especially the emergency rooms) at the request of the nurses. The nurse will send the request to the machine using a mobile application (TOOLGO), so the car will carry out this request and go to the room. First, the car stops at the reference point, then moves to the room if a nurse requests it, then returns to the reference point if there are no other requests. Surely there are certain criteria for the path that the car will cross and a technique to avoid obstacles. 7 1 Introduction 1.1 The problem Despite all efforts to improve it, our country suffers from a weakness in the medical sector. The overall population keeps growing in a narrow geographic region, and the number of emergency cases that reach hospitals is increasing, either as a consequence of traffic accidents or stressful political situations, making the situation harder for doctors and nurses who work in emergency departments and need to rapidly evaluate the patient's condition and provide immediate medical care, if possible. We noticed that nurses are under a lot of stress because when a patient arrives in an emergency room, they must check their vital signs, then go to a place where the supplies are and bring them either with a cart or a basket rapidly. So, we decided to try to solve this problem and reduce back-and-forth operations. We attempted to develop a machine that operates according to the nurse's card and brings it to the room where he is by pressing a button on the mobile application. 1.2 Project importance The significance of the idea lies in creating a machine that transports medical equipment to the room needed, reducing the nurses' stress. Every moment of the patient's life is significant; we designed the tools to move between them because it is obviously impossible to supply unique tools for every patient independently. 1.3 Project objective and scope The aim of this project is to assist nurses in hospitals, and it can be used in any hospital around the world with a few modifications to make it more efficient. In this project, we Created a hardware system that’s controlled by a mobile application (using App Inventor) to enable the nurse to get the necessary medical tools in less time and effort to assist the patient immediately and to keep his medical situation stable. As a result, the following services must be offered: - With the ability to control the specific vending machine, nurses can load any medical product on it using a mobile application and choose any product from it using manual buttons. 8 - The ability to work with a priority system that nurses decided - The machine's ability to follow a predetermined and known path - The machine's ability to move freely inside the rooms - The ability to control the machine with a camera placed on it using an app on a phone to avoid obstacles 9 Report Organization - Chapter 2: Constraints and Earlier Coursework. - Chapter 3: Literature Review. - Chapter 4: Methodology. - Chapter 5: Results and Discussions. - Chapter 6: Conclusion and Future Work. 10 2. Constraints and Earlier Coursework 2.1 Constraints 2.1.1 insufficient budget. A few suggestions require more money for construction, which could put the project's cost beyond its limitations; for example, a 3D printer was used to create some of the components. 2.1.2 limited mechanical expertise. We had to do a lot of research on several mechanical components, particularly those that have to do with balancing when moving. 2.1.3 platform organization. Mobile application Available only Android. 2.1.4 limited access to some components. 2.1.5 ESP32 pins are not enough. 2.2 Earlier coursework We initially attended Arduino classes to deal with it, then evolved into something more specific and learned NodeMCU. Also, the several college courses we completed, such as Wireless, Microcontroller, Digital Design, Electrical Circuits, and CPU Lab, were helpful for us since they provided the basics of knowledge and made it simpler to find and comprehend the harder topics. 11 3. Literature Review There are many pros to advancing technology in work environments, all of which positively affect workforce members. By automating routine, daily tasks, people can spend time on the creative and troubleshooting aspects of their jobs. "Medical assistance robots" are robots that help doctors and nurses. These robots are produced to do actions that assist with patient care, accelerate medical processes, and relieve pressure on medical staff like nurses and doctors. They can be employed at facilities such as hospitals, clinics, and plenty of other medical centers. Therefore, our concept for this project was to design a machine that aids nurses in emergency rooms specifically and in hospitals generally, relieving them of their task of running back and forth to get supplies so they can concentrate on the patient and complete the most important procedures needed by the doctor. We read numerous papers, one of which describes the creation and design of hospital-specific delivery robots. The field of automation has grown into virtually every service-oriented industry, and it has now entered the medical industry [1]. We reviewed one project that utilized ultrasonic sensors to detect people and estimate their distance from them so that they could be followed. Their project does not save any paths [2]. In our project, we decided that the system would save routes to be more efficient. We also reviewed one project where they chose a path using a specific algorithm, but they only focused on the path [3], so we decided to add an idea in addition to the path. We used a small vending machine as a model. We added many features to it, like a lift system and, to be more secure, using a nurse's card instead of coins. 12 4. Methodology This chapter goes extensively into the procedures and strategies we followed for building the machine. Basically, we chose the structure of the project. Figure 1: project at first stage without any work 4.1 Component Name Quantity Image of component A4988 Driver 9 ESP32-CAM 1 13 RFID 1 IR Sensor 1 ESP32-Wroom 1 3D Printed piece -Scissor Lift - 1 Wires N Mecanum wheel 4 14 Ultra sonic sensor 1 Stepper Motor 9 Power Supply 1 Helical Spring 4 Button 4 ESP8266 1 4.2 ESP32 Connection This project depends on the ESP32-Wroom to control the movement of the machine and to connect with a mobile application. System-on-a-chip microcontrollers in the ESP32 series are affordable, low-power, and come with built-in Wi-Fi and dual-mode Bluetooth, so the ESP32 is the best choice for this project. 15 And here are the pins that we used on the ESP32-Wroom: Pin Connected With GPIO0 ECHO_PIN - ultrasonic GPIO2 TRIGGER_PIN - ultrasonic GPIO13 Step - stepper1 (back left) GPIO12 Direction - stepper1 GPIO14 Step – stepper2 (front right) GPIO27 Direction – stepper2 GPIO33 Step – stepper3 (back right) GPIO32 Direction – stepper3 GPIO26 Step – stepper4 (front left) GPIO25 Direction – stepper4 GPIO5 Step – stepper5 (lift) GPIO18 Direction – stepper5 (lift) GPIO19 Step – stepper7 (vending machine) GPIO21 Direction – stepper7 (vending machine) GPIO22 Step – stepper6 (vending machine) GPIO23 Direction – stepper6 (vending machine) GPIO16 Step – stepper8 (vending machine) GPIO17 Direction – stepper8 (vending machine) GPIO3 Step – stepper9 (vending machine) GPIO1 Direction – stepper9 (vending machine) GPIO34 first button pin as input with internal pull-up resistor GPIO39 second button pin as input with internal pull- up resistor GPIO36 third button pin as input with internal pull-up resistor GPIO4 fourth button pin as input with internal pull-up resistor 16 Note: We used the esp8266 because it is available to us instead of buying a esp32 because the first one's pins are not enough. Pin GPIO15 with Input – card Pin GPIO3 in ESP8266 connected with Pin GPIO15 at ESP32. 17 4.3 Movement part Each of the four stepper motors takes responsibility for moving the corresponding wheel. These motors have 1.8° steps, or 200 complete steps, for each rotation. We used the A4988 driver for each motor, which is a micro- stepping driver that permits greater accuracy by accepting intermediate step positions. Figure 2: Control Stepper Motor with A4988 Motor Driver Figure 3: Connecting each stepper motor with a wheel 18 About the process: The machine was positioned at the reference location. When a nurse needs medical supplies, he uses a smartphone application to request the machine. The nurse's responsibility is to prioritize the necessity of using the products based on the patient's condition. For instance, a patient with little stomach discomfort is different from one who arrives after an accident and may have damaged his spine. Figure 4: priority page When the machine is in the reference room, it accepts requests with the associated priority and organizes them from the highest to the lowest. Also, while the machine is operating, it is also accepting requests. After completing the highest-priority request, it moves on to the next-highest-priority request in arranged array. On the ESP32 chip, we programmed the code that saves the path along which a machine moves based on the total number of steps and the direction of progress. We utilized ESP-CAM in combination with an ultrasonic sensor to prevent the machine from hitting a nearby object. Ultrasonic sensors use ultrasonic waves to determine distance. The ultrasonic signal is sent by the sensor head, which then picks up the wave that the target reflects to it. The time elapsed between the emission and reception is measured by ultrasonic sensors to determine the target's distance. And with the ESP32-S chip, the ESP32-CAM is a tiny camera unit. A place for microSD cards is offered in addition to the OV2640 camera and numerous 19 GPIOs for connecting components, and this camera lacks a USB port, so an FTDI programmer is required. Figure 5: ESP-CAM At the device's bottom, we have placed the ultrasonic sensor. Figure 6: Ultrasonic at the bottom of the machine When an ultrasonic sensor detects an object near the machine, a notification will be sent to the user, and the ESP-CAM will be on to enable the user to control the machine manually. 4.4 Vending Machine We used four stepper motors, each with an A4988 driver. In general, it's a machine that mechanically delivers consumer products such as cigarettes, food, or gasoline once money is input; in this instance, to make the machine more secure in the hardware field, we replaced the money with the nurse's card to activate the vending machine. To do that, we used an RFID card (radio- frequency identification), which is frequently used in applications that identify people or things, such as systems for attendance. In the software field, we create a log-in page, and if the nurse is not in the system, the vending machine will not operate. 20 Figure 7: Stepper motors for vending machine Figure 8: Vending machine after connecting the helical spring Figure 9: Drivers for motors (vending machine and wheels) Figure 10: Login page Figure 11: Card on machine 21 We loaded medical supplies into the machine’s boxes; nurses could also load medical supplies or choose any product into the machine via a mobile application. We've programmed eight buttons on the application, and every two of them are linked to one of the machine's four boxes, which are each packed with various medicinal supplies. If the nurse presses any of the buttons on the mobile application, the machine won't operate if the nurse doesn't exist in the system. The first button for each box is named "I need this item" and is used to select one of the products. When a nurse presses it, a stepper motor turns on and a spring rotates, dropping the required item. In addition, the nurse may place numerous requests by pressing multiple buttons, and they will be delivered in order. The second button for each box is named "Click to Load "and is used when a nurse needs to load products. Figure 12: Vending machine page The machine also contains four push buttons that link to the esp32; each is responsible for one box. A stepper motor will work to deliver the required product when the nurse hits a specific button. 22 like a mobile application. If the nurse isn't present in the system, the card won't be recognized, and pressing any button won't cause any products to drop. Figure 13: Buttons on machine In vending machines, the product typically falls to the bottom of the device; however, we thought that if the product lifted to the top of the device, it would be easier for the nurse to get it. To do this, we employed a scissor lift mechanism that was created using a 3D printer. The movable scaffold used to hoist items is known as a scissor lift. The crisscrossed beams operate like scissors, lifting and lowering the platform. In our project, the home position of the lift scissor is at the lowest point of the machine. Instead of dropping the product to the bottom when pressing the button (I need this item) on the mobile application or pressing the real button on the machine, the lift will go up and stand in front of the needed box, then a stepper motor will work and a spring will rotate, pushing the product inside the lift. When finished, the lift will go up to the top of the machine with the product needed. If the nurse needs several products, the lift will go to each box separately in order, then go to the top of the machine with all the products needed. Figure14: Lift scissor diagram This is the hardware used to build a lift scissor: a stepper motor, a coupler, and a square-tooth bolt. 23 Figure 15: Hardware used to build lift scissor 4.5 App Inventor The first step in making our system easy to use and readily available was developing the mobile application. To build the application, we utilized the drag-and-drop visual software App Inventor, which enables the basic creation and execution of mobile apps for Android devices. We began by designing the application's layout and graphical user interface, which featured several panels and buttons that users would interact with. The behavior and capabilities of the program were subsequently coded using blocks, including a system interface to enable the nurse to select the required room and determine priority. Figure 16: Page1 Figure 17: Page2 24 Figure 18: Page3 4.6 Ending process We have a button on the mobile application that, when pressed, the machine goes out of the room which exists in it. Figure19: Finish button 25 5. Results and Discussion TOOLGO is an ESP32-based system that is about car-carried medical supplies that are kept in places that are intended to be used as products inside a vending machine. By minimizing a nurse's trips back and forth to the medical supplies area, this idea benefits the nurses working in the emergency room as well as the entire hospital. We tested it manually using two physical devices (two mobile applications on Android). At first, the machine will be at the reference point; a nurse will select high priority, and the other nurse will send a lower one. The priority will be arranged (of course, the machine is still in the reference) from the highest to the lowest, and then the machine will go to them in order. Also, if the machine is on the path to the needed room with low priority, if any other nurse needs it with high priority, then the machine adds it to the array and arranges it, and when it is finished with the needed room, it goes to the highest one. The machine will not change the path if it already goes out of the reference point. We utilized ESP-CAM in combination with an ultrasonic sensor to prevent the machine from hitting a nearby object. The path was saved using the number of steps; the machine will arrive in a specific room, but we added an IR sensor to be more accurate, not as a primary method. To discover and evaluate the infrared light around them, people utilize electrical devices known as infrared (IR) sensors. When they hit a white surface, infrared photons reflect and are then captured by photodiodes, altering the voltage. By contrast, when IR light strikes a black surface, the light is absorbed by the surface and no rays are reflected, leaving the photodiode in the dark. We have limitations on a vending machine. Since it is small, not every product needed exists in it. 26 Project Outcome: - An application that enables the nurse to control the system. - The machine's ability to follow a predetermined and known path with specific priority - Controlling the vending machine 27 6. Conclusion and Future work 6.1 Conclusion In summary, we designed a system that consists of a machine that supports a Wi-Fi application to help nurses, especially in the emergency room and in the whole hospital. By dialing the machine using the application (TOOLGO), the system can provide medical supplies for nurses. This relieves the workload on nurses by reducing effort and time to get the wanted items. As a result, it can help patients by performing basic procedures more effectively and, as a result, rapidly recognizing the disease. Things we learnt: - Having more mechanical information and knowing how to handle motors and drivers - establishing a wireless and database connection for the ESP32 and coding it. 6.2 Future work In the future, it could be possible to employ artificial intelligence (AI) to let the machine travel along the hospital while continuing to determine the shortest path on its own to the required room, in contrast to the idea of saving the paths. Also, the number of steps in the stepper motor may not be the best way to calculate the distance between locations, so we need a better method than it. In addition, we can use AI instead of manually controlling a machine if it faces obstacles. A vending machine with better features may be able to chat with the user (like a waiter in a restaurant) about the order he wants instead of using buttons, and the application will be available on iOS and Android. 28 References [1] Zielinska, Teresa. Professional and Personal Service Robots. IGI Global, 2016. [2] Hammam Najem, Asem Ishtayah , I Follow You (Person-Tracking Robot System),2021. [3] Yousef Aslan, Mohammad Abueideh, Smart Cleaning Robot,2020. An-Najah National University Faculty of Engineering and Information Technology Computer Engineering Department Graduation Project II TOOLGO Acknowledgment: Disclaimer Table of Figure Abstract 1 Introduction 1.1 The problem Despite all efforts to improve it, our country suffers from a weakness in the medical sector. The overall population keeps growing in a narrow geographic region, and the number of emergency cases that reach hospitals is increasing, either as a consequ... We noticed that nurses are under a lot of stress because when a patient arrives in an emergency room, they must check their vital signs, then go to a place where the supplies are and bring them either with a cart or a basket rapidly. So, we decided to try to solve this problem and reduce back-and-forth operations. We attempted to develop a machine that operates according to the nurse's card and brings it to the room where he is by pressing a button on the mobile application. 1.2 Project importance Report Organization 2. Constraints and Earlier Coursework 2.1 Constraints 4. Methodology This chapter goes extensively into the procedures and strategies we followed for building the machine. Basically, we chose the structure of the project. 4.1 Component 5. Results and Discussion 6. Conclusion and Future work 6.1 Conclusion 6.2 Future work