Faculty of Engineering and Material Science Mechatronics Department Instant Noodles Vending Machine Bachelor Thesis Author: Eng. Ahmed Sabek Mohammed Mahrous Supervised By: Dr. Hisham El-Sherif Submission Date: June 4,2012
This is to certify that:(i) The thesis comprises only my original work toward the Bachelor Degree.(ii) Due acknowledgment has been made in the text to all other material used. Ahmed Sabek June 4, 2012
AcknowledgmentThis project would not have been possible without the support of many people. I wish toexpress my gratitude to my supervisor, Prof. Dr. Hisham El-Sherif, Head of Industrial Au-tomation Department who was abundantly helpful and offered invaluable assistance, sup-port and guidance. Special thanks also to all my team mates and group members;MoustafaEmad El-Din, Omar Aﬁfy,Mohammed AbdelAlim and Sherif Khaled for sharing the lit-erature and invaluable assistance. Not forgetting to express gratitude to my best friendswho have always been there; Moustafa Meleigy and Pakinam Ahmed. I would also liketo convey thanks to the Ministry and Faculty for providing the educational means andlaboratory facilities. I wish to express my love and gratitude to my beloved family; fortheir understanding & endless love, through the duration of the project. viii
AbstractMany of us enjoy eating noodles, considering it cheap, healthy, and delicious fast food.Our project idea came from this simple fact, our project aimed to help people enjoy eatingnoodles easily, quickly and in a wider scale. The ﬁrst stage was brainstorming, visualizingthe idea, forecasting all our needs in the project, and researching how other vending ma-chines work Once the general outline was set, a deeper research was held; a comparisonbetween all available alterative that can be used in the project was held and we decidedwhich speciﬁc components are to be used. A sequence operation was then introducedto arrange our priorities and set the guidelines in the coding and electric implementationMechanical, Electrical and Software Control implementation went all along in parallel.The control system and electrical work were integrated together and tested on simulationprograms and on board many times to insure accuracy and precision. Mechanical Imple-mentation was also integrated with components and wires for the facility of rebuildingand maintenance. It was also simulated a lot of times on Solid works®. Finally camethe stage of integrating all components together and testing them for the machine to beready to use , A study of wiring systems and electricity input output system was then held. Then errors and problems were handled and the machine was ready to use. The machinefunctions well, however future work research is being done on increasing the number ofﬂavors, decreasing serving time, decreasing the size of the machine and more securitysystems ix
List of AbbreviationsAVR Alf and Vegard’s Risccm CentimetersCPU Central Processing UnitDC Direct CurrentDVD Digital Versatile DiscEEPROM Electrically Erasable Programmable Read-Only MemoryI/O Input/OutputIDE Integrated Development EnvironmentKB Kilo BytesKg KilogramsLCD Liquid Crystal DisplayMHz Mega HertzMIG Metal Inert Gasmm MillimetersPCB Printed Circuit BoardPIC Peripheral Interface ControllerPLC Programmable Logic ControllerPWM Pulse Width ModulationRAM Random access memory x
LIST OF TABLES xiSRAM Static Random-Access MemoryUSB Universal Serial Bus
Chapter 1IntroductionAs people continue to seek for convenience, more and more technologies are invented.One of these technologies is the vending machine. Vending machines come in differenttypes as they are made for different purposes. Vending Machines are rarely found inthe market of Egypt and its industry hasn’t been made yet in addition to the increasingconsumption of instant noodles within different ages of people made the idea of designing& implementing an instant noodles vending machine; the availability of investing in a newvirgin ﬁeld with the knowhow of mechatronics can help in making this project a successfuland a practical realistic one. Before starting with details of the proposed project, we willﬁrst talk about some facts and history about variety of vending machines. 1
CHAPTER 1. INTRODUCTION 21.1 Cold and Frozen Vending Machines:This type is for ice cream, pies and other frozen foods. Typically, its features includetriple pane heated glass that eliminates condensation or frost. There is also an adjustableself-defrosting cycles for a fast cool down and recovery. This machine is a great advantageespecially to those who crave for desserts. Like most vending machines, they can acceptboth coins and bills. Figure 1.1: Cold & Frozen Vending Machine
CHAPTER 1. INTRODUCTION 31.2 Bulk Vending MachinesThese machines come in variety of sizes and styles and they are entirely mechanical. Op-eration is done by placing coins and turning a knob or pulling a lever. They can vendcandies, chocolates and gum balls. Bulk vending machines are usually found in depart-ment stores and malls where they can attract children and passersby. Figure 1.2: Bulk Vending Machines and Stands
CHAPTER 1. INTRODUCTION 41.3 Coffee or Tea Vending MachinesThis vending machine has a state-of-the-art brewing system and precise ingredient controlto satisfy every customer’s preference. In addition, it has instant or fresh brew conﬁgura-tions to dispense a broad menu of specialty 7 coffees and teas. With this vending machine,customers can drink their favorite coffee in just one touch. Figure 1.3: Coffee or Tea Vending Machine
CHAPTER 1. INTRODUCTION 51.4 Ofﬁce Supplies Vending MachinesIf one forgets to bring a pen or pencil in a very important appointment, there’s no need topanic. These ofﬁce supplies vending machines can be found in public libraries, campuses,airports, and other locations where ofﬁce workers and students are likely to go. Theydisplay stamps, pens, pencils, paper, USB ﬂash drives and other important ofﬁce andschool supplies. These machines are easy to load and dispense but the items are usually alittle more expensive than those in bookstores and convenience stores. Figure 1.4: Ofﬁce Supplies Vending Machines
CHAPTER 1. INTRODUCTION 61.5 Drink and Snack Vending MachineSnacks and beverage vending machines are among the most common vending machines.They are usually found in schools, ofﬁces, hospitals, airports and gasoline stations. Thiscombo machine features adjustable 8 trays allowing conﬁguration for the top selling prod-ucts. People can buy varieties of snacks and drinks, from Potato Chips, to cookies andcandy. The soda drink side of the machine vends both cans and bottles. Most of thesemachines can accept both coins and bills. Figure 1.5: Drink and Snacks Vending Machine
CHAPTER 1. INTRODUCTION 71.6 Entertainment Vending MachineCustomers don’t need to buy DVDs to watch their favorite movies because the entertain-ment vending machines are found in most fast food chains, restaurants, near entrance ofdepartment stores and convenience stores. These machines typically hold more than 500DVDs. They become popular because they offer quick and cheaper entertainment. Thisself-service machine is combined with interactive touch screen, a robotic disk array sys-tem and a web-linked electronic communications. The customer pays with a credit ordebit card and returns the DVD on the next day. Additional charges are applied if DVDsare not returned on their due dates. Figure 1.6: Entertainment Vending Machine
CHAPTER 1. INTRODUCTION 81.7 Change MachinesThese machines are usually found in laundry shops, restaurants and department stores.Although most of these machines provide bill-to-coin change, some of them accept creditcards or do bill-to-bill change. Operating the machine is quiet simple. You just need toinsert your bill and make the necessary selections as possible; then your change is alreadyright there in front of you. Some machines just dispense quarters and are easier to operate. Figure 1.7: Change Machines
Chapter 2Proposed Mechanical Design2.1 Introduction2.1.1 Theory of OperationInstant Noodles Vending Machine which offers both a “Take & Leave” or “Cook” optionfor different ﬂavors, with supplying an external fork to the consumer in a few seconds.2.1.2 Technical Features • Vertical channel storage and delivery for fast restocking. • Circular Product channel for saving space. • Up to 4 choices of food and can be made with the ability of adding 2 more options in the future if needed. • 6 internal channels for storing and merging with user choices. • High heat recovery boiler. • Automatic fork dispenser. • Water ﬂow control system. • Hot water injection System. • Rotating arm for delivery of cup to stages then to user. • Push Buttons and LCD interface for user. • Products availability monitoring. • Fast Cup delivery in few seconds. 9
CHAPTER 2. PROPOSED MECHANICAL DESIGN 102.2 3D ProposalThe designs of all of the parts of the proposed mechanical design is implemented usingSolidworks software and all the dimensions are measured in cm. Figure 2.1: Isometric 3D View Figure 2.2: 3D Design using Solidworks
CHAPTER 2. PROPOSED MECHANICAL DESIGN 12Upper Tray is a 60x60 square tray with a thickness of 1.5 mm. It is considered the maintray of operation as it combines most of the components and mechanisms. Dimensions on the Figure 2.2 illustrate the following: • Cups Opening with a diameter of 11 cm for Cups orientation. • Steel Bars Opening with a diameter of 8mm for four bars. • Cup Dispenser Opening with a diameter of 4 cm for Cups release & hold. • Water Injection Opening with a diameter of 2 cm for Cup Injection.2.2.2 Middle Tray Figure 2.4: Middle TrayThe middle tray is a 60 cm x 60 cm square tray with 1.5 mm thickness on which the servomotor attached to the rotating arm and allows the arm with the cup inside to move bystages (Cup dispensing into the arm, Water Injection & Cup delivery).
CHAPTER 2. PROPOSED MECHANICAL DESIGN 132.2.3 Lower Tray Figure 2.5: Lower TrayThe Lower tray is a 60 cm x 60 cm square tray with 1.5 mm thickness which holds the forkdispenser mechanism which dispenses an external fork for the user at the Fork window.
CHAPTER 2. PROPOSED MECHANICAL DESIGN 142.2.4 Cup Stacks Figure 2.6: Cup StacksThe Cups Stack can hold inside up to 8 noodles cups and it consists of Steel Bars andCircular Ring: • Steel Bars with a diameter of 8 mm and a Length of 91 cm. • Circular ring with four holes of diameter 8mm to carry the bars.
CHAPTER 2. PROPOSED MECHANICAL DESIGN 152.2.5 Machine Door Figure 2.7: Machine DoorMachine Door (Thickness 1.5 mm) contains openings for “LCD”, “Push Buttons”, “CupWindow” and “Fork Window” as well as a transparent plastic window.The dimensions of the openings is shown in ﬁgure 2.6
CHAPTER 2. PROPOSED MECHANICAL DESIGN 162.2.6 Machine Outer Casings18.104.22.168 Top and Bottom both with same dimensions Figure 2.8: Top / Bottom Design22.214.171.124 Left and Right both with same dimensions Figure 2.9: Left / Right casing
CHAPTER 2. PROPOSED MECHANICAL DESIGN 126.96.36.199 Back Part Figure 2.10: Back casing2.2.7 Hot Water Injection MechanismIt is basically a Scotch Yoke mechanism which converts the rotational motion of a servomotor into linear motion. This part is responsible for puncturing a hole in the nodulescup; throw the Scotch Yoke mechanism, and then injecting hot water - from the boiler -inside the cup in order for the nodules inside to be cooked. (a) Side view (b) Top View Figure 2.11: Hot Water Injection Mechanism
CHAPTER 2. PROPOSED MECHANICAL DESIGN 182.2.8 Fork Dispenser MechanismFork Dispenser Mechanism which holds a spring that rotates via DC Motor translatingone fork in each rotation in the Fork Dispenser Box. The spring has a diameter of 25 mmand a 50 cm length with a cross sectional diameter of 1 mm. . Figure 2.12: Fork Dispenser Mechanism
CHAPTER 2. PROPOSED MECHANICAL DESIGN 192.2.9 Rotating ArmThe Rotating Arm starts the cycle by carrying the cup selected by user and then transfer-ring it to the hot water injection stage which waits a period of time then delivers the cupat the cup window for the user to be ready to have it at once. The Arm is controlled by aservo motor and moves with the help of a moving wheel which carries the weight of theArm and smooths the rotation. (a) Front view (b) Top view Figure 2.13: Rotating arm design
CHAPTER 2. PROPOSED MECHANICAL DESIGN 202.2.10 Forks Output Box Figure 2.14: Forks Output BoxForks Box used for allowing the user to take the fork dispensed at the end of the transac-tion, the user opens the box door manually and grabs the fork then the door swings backto close.Forks Door is a swing door which is opened manually by the user then closes automati-cally to its rest position.
CHAPTER 2. PROPOSED MECHANICAL DESIGN 212.2.11 Water TankWater tank holds about 19 liters of water to cover all products in the machine; one cup ofnoodle takes about 125 cm3 of water. Water is pumped from the tank to the boiler thento the hot water injection mechanism and ﬁnally to the noodles cup. Water tank is to berested on the base of the machine next to the pump and below the boiler. Figure 2.15: Water Tank
CHAPTER 2. PROPOSED MECHANICAL DESIGN 222.2.12 Boiler CasingBoiler has dimensions of 6 cm x 6 cm x 20 cm, which stores hot water up to 90c, theboiler can store a volume of two cups to be ﬁlled with hot water. As the density of hotﬂuids is less than that of cold ﬂuids; hot water is taken from approximately the center ofthe boiler and cold water is injected into boiler at the bottom which comes from the pumpthen the exhaust vapor is get rid of from the top of the boiler. Therefore, the boiler hasfour openings: top opening for exhaust, center for hot water out, bottom for cold waterin and ﬁnally the heater opening which the heater ﬁts into at the bottom of the boiler. Alldimensions are shown on ﬁgure 2.16 Figure 2.16: Boiler casing
CHAPTER 2. PROPOSED MECHANICAL DESIGN 232.3 Water Flow System 1. Water Tank Flow Meter. 2. Water Pump. 3. Check Valve. 4. Boiler. 5. Security temperature sensor. 6. Heater. Temperature sensor. 7. Solenoid Water Valve. 8. To Water Injection mechanism. 9. Exhaust exit. Figure 2.17: Diagram illustrating the optimal water ﬂow system
CHAPTER 2. PROPOSED MECHANICAL DESIGN 24Cold Water is sucked by the pump from the water tank and goes through ﬂow meter whichdetects if there is water inside the tank or not, then goes into the boiler to be heated tillreaching a certain set up temperature of approximately 85 degrees by the means of a heaterﬁxed into the boiler which keeps on heating water till the temperature sensor reaches apredeﬁned temperature then heater stops. Hot water is then now ready and ﬂows to waterinjection mechanism through a solenoid water valve. This design allows for the contin-uous availability of hot water in the boiler as the boiler is designed to have a volume ofthree cups of Noodles and in each transaction pump is automatically started to compensatefor the water left and automatically water is again heated. Security temperature sensor isused for safety that will cut power to the heater incase of overheating and then power willbe restarted again when temperature goes down. In case of overheating pressure increasesand steam will be exhausted through exhaust exit back to the tank. Note: This water ﬂowsystem is the optimal system to be implemented, however there are some componentsthat weren’t implemented in this project but have been set up into consideration for futureexpansion phase which are: ﬂow meter, check valve, security thermostat.2.4 Materials Selection2.4.1 Comparison of MaterialsThis comparison is done about the most common and suitable materials to be used withthe vending machine according to the following: • Ductility • Machinability • Density(Kg/m3) • Melting Temperature (Celsius) • Resistance to corrosion • Price
CHAPTER 2. PROPOSED MECHANICAL DESIGN 25 Property Carbon Steel Iron Aluminum Copper Stainless Steel Plastics Ductility * ** *** ** *** * Machinability * ** *** ** *** * Density(Kg/m3) 7850 7870 2700 8940 8000 * Melting Temperature (Celsius) 1425 - 1540 1536 660 1084 1510 70-130 Resistance to corrosion ** * *** ** *** *** Price Moderate Price Cheaper than Steel 7 times more expensive than than Steel Expensively high More expensive than carbon Steel low price Table 2.1: A Variety of Metals PropertiesRatings are classiﬁed as follows : Low * / Moderate ** / High ***2.4.2 Outer Casings and TraysFor the outer casings and trays, the most suitable material needed had to be of a reason-able price because a large amount of the materials was needed, corrosion resistant as themachine could be placed in the outdoors in conditions that would result in the rusting ofthe machine. So, Carbon Steel was selected as it ﬁts all of the previous criteria.2.4.3 Hot Water Injection MechanismThe hot water injections system consists of two parts, the scotch yoke body and the T-shaped member in which the hot water is injected to noodles cup from the boiler. For thebody, a material that was needed had to be light to reduce the torque exerted by the servomotor driving the mechanism.2.4.4 BoilerAs the boiler had to be subjected to high temperature , up to 100 Celsius, with water insideit so a material with a high melting point and high resistance to corrosion was need ad themost suitable material for job according to table 2.1 was Stainless Steel.2.4.5 Water TankFor the water tank, a material was corrosion resistant and as cheap as possible was needed,in addition to that the tank will be placed in room temperature is it was not subjected tohead. So the most suitable option was to use a plastic water tank similar to the one usedin commercial water bottles.
CHAPTER 2. PROPOSED MECHANICAL DESIGN 262.4.6 Cup StacksThe Cup stacks was design to be of length 90 cm and outer cross-sectional diameter of 0.8cm so a strong and heavy material was needed in order not to bend and be deformed whenthe cups are guided through them and it also needed to be as cheap as possible because20 bars was manufactured. From table 2.1, it is clear the material that ﬁts the previouscriteria is Iron and that is why it was selected.2.4.7 ArmThe Arm as mentioned in the design phase had to be of a light weight and can be easilymachinable to meet the required design shape. Therefore according to table 2.1 the Armmaterial has been selected to be Aluminium.
Chapter 3Sequence of Operation andMicrocontroller3.1 Sequence of Operation:3.1.1 IntroductionA narrative description of how the building system components shall automatically andoptimally operate. The sequence of operation illustrates the steps of operation of themachine and conditions required for each step to occur. It also includes the function ofsensors, motors, solenoid, pump, and heater.Firstly, the machine checks that the machine is in normal conditions of working (no cupat the serving position, water level in both the tank and the boiler is enough, and there isat least one cup of any ﬂavor present).Secondly, the machine will be in the ready state after the previous checks it will wait forthe user input through the LCD screen which shows the available list of ﬂavors and thepush buttons which are considered as the input sources to the machine from the user.Thirdly, the motor will move according to the ﬂavors position (which is converted toangles on the micro-controller) this motor is attached to an arm which holds the chosenpack and moves to the position where hot water is added if this packed is ordered as acooked pack, or take it directly to the serving position if the pack is ordered as take andleave pack. 27
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 28 Figure 3.1: Block Diagram
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 293.1.2 Sequence of Operation Diagram Figure 3.2: Sequence of operation diagram part 1
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 30 Figure 3.3: Sequence of operation diagram part 2
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 31 Figure 3.4: Sequence of operation diagram part 3
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 323.2 Micro-controller3.2.1 IntroductionA micro-controller is a small computer on a single integrated circuit containing a proces-sor core, memory, and programmable input/output peripherals. Program memory is in theform of RAM (Random access memory). Micro-controllers are designed for embeddedapplications, in contrast to the microprocessors used in personal computers or other gen-eral purpose applications. Micro-controllers are used in automatically controlled productsand devices, such as automobile engine control systems, implantable medical devices,remote controls, ofﬁce machines, appliances, power tools, toys and other embedded sys-tems. By reducing the size and cost compared to a design that uses a separate micropro-cessor, memory, and input/output devices, micro-controllers make it economical to digi-tally control even more devices and processes. Mixed signal micro-controllers are com-mon, integrating analog components needed to control non-digital electronic systems.3.2.2 Types of Micro-controllers in Market188.8.131.52 PIC micro-controllerPIC is a family of modiﬁed Harvard architecture micro-controllers made by MicrochipTechnology. The name PIC initially referred to "Peripheral Interface Controller". Pics arepopular with both industrial developers and hobbyists alike due to their low cost, wideavailability, large user base, extensive collection of application notes, availability of lowcost or free development tools, and serial programming (and re-programming with ﬂashmemory) capability.184.108.40.206.1 The PIC32 architecture Pros • The highest execution speed • The large ﬂash memory: 512 k Byte • One instruction per clock cycle execution • The ﬁrst cached processor • Allows execution from RAM220.127.116.11.2 The PIC32 architecture Cons • Possibility of damaging the PIC during code burning is high.
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 33 • Number of input/output pins available is limited. • The max current the PIC can withstand is relatively low compared to PLC and Arduino micro-controllers.18.104.22.168 PLC22.214.171.124.1 Deﬁnition A programmable logic controller (PLC) or programmable con-troller is a digital computer used for automation of electromechanical processes, such ascontrol of machinery on factory assembly lines. PLCs are used in many industries andmachines. Unlike general-purpose computers, the PLC is designed for multiple inputsand output arrangements, extended temperature ranges, immunity to electrical noise, andresistance to vibration and impact. Programs to control machine operation are typicallystored in battery-backed-up or non-volatile memory. A PLC is an example of a hard realtime system since output results must be produced in response to input conditions withina limited time, otherwise unintended operation will result. Modular PLCs have a chassis(also called a rack) into which are placed modules with different functions. The processorand selection of I/O modules are customized for the particular application. Several rackscan be administered by a single processor, and may have thousands of inputs and outputs.A special high speed serial I/O link is used so that racks can be distributed away from theprocessor, reducing the wiring costs for large plants.126.96.36.199.2 Advantages of the PLC 188.8.131.52.2.1 Simpliﬁed changes When a control is created, it does not work promptsuccessfully. Most of the controls are perfectioned step by step until the desired result isachieved. With a hard-wired control constant changes of the wiring is neccessary. In con-trast, with a PLC simply the program has to be changed. The time required for the changesto make the control work is reduced signiﬁcantly. Program changes can be implementedeasier. 184.108.40.206.2.2 Material and Space Requirements Connections, the analysis of states,times and counting functions are implemented internally in a PLC and can be used. Soyou can save the material that would be needed for the hard-wired control, e.g. relays andtimers. 220.127.116.11.2.3 Duplication of Programs If you have written a control program, youcan copy and use this as often as you like. In contrast, a hard-wired control would have
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 34to be operated for each control separately. For reproducing control tasks a PLC is signiﬁ-cantly more favourable. 18.104.22.168.2.4 Comment and Documentation Possibilities When a PLC program iswritten, it makes sense to write helpful comments on each instruction. If it is necessaryto change the program, it is easier to understand an existing program when comments areincluded. 22.214.171.124.2.5 Saving time Less installation work, less cabling, less material expense.The implementation of projects is less time-consuming. It is also possible, for example,to do parallel processing in groups. Thus, program parts can be combined later to a wholeconcept.126.96.36.199.3 Disadvantages of a PLC the PLC is too expensive for small or less complexsystems. Also, additional equipment and infrastructure such as programming devices,storage, backup devices, etc. are necessary as well as is highly qualiﬁed personell tooperate a control via PLC.188.8.131.52 Arduino Mega 2560An Arduino board consists of an 8-bit Atmel microcontroller with complementary com-ponents to facilitate programming and incorporation into other circuits. An importantaspect of the Arduino is the standard way that connectors are exposed, allowing the CPUboard to be connected to a variety of interchangeable add-on modules known as shields.A handful of other processors have been used by Arduino compatibles. Most boards in-clude a 5 volt linear regulator and a 16 MHz crystal oscillator (or ceramic resonator insome variants), although some designs such as the LilyPad run at 8 MHz and dispensewith the onboard voltage regulator due to speciﬁc form-factor restrictions. An Arduino’smicrocontroller is also pre-programmed with a boot loader that simpliﬁes uploading ofprograms to the on-chip ﬂash memory, compared with other devices that typically needan external programmer.  Arduino Processor Frequency Voltage Flash (KB) EEPROM(KB) SRAM(KB) Digital I/O Pins Mega2560 ATMega2560 16MHZ 5V 256 4 8 54 With PWM Analoug Input Pins USB Interface Types Other I/O Dimensions Inches Dimensions mm 14 16 8U2/16U2 4 in * 2.1 in 101.6 mm * 53.3 mm Table 3.1: Arduino Mega 2560 Speciﬁcations
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 3184.108.40.206.1 Software The Arduino IDE is a cross-platform application written in Java,and is derived from the IDE for the Processing programming language and the Wiringproject. It is designed to introduce programming to artists and other newcomers unfa-miliar with software development. It includes a code editor with features such as syntaxhighlighting, brace matching, and automatic indentation, and is also capable of compilingand uploading programs to the board with a single click. There is typically no need toedit ﬁles or run programs on a command-line interface. Although building on command-line is possible if required with some third-party tools such as Ino. The Arduino IDEcomes with a C/C++ library called "Wiring" (from the project of the same name), whichmakes many common input/output operations much easier. Arduino programs are writtenin C/C++, although users only need deﬁne two functions to make a runnable program: • setup() – a function run once at the start of a program that can initialize settings • loop() – a function called repeatedly until the board powers off. Figure 3.5: Arduino IDE screen shot220.127.116.11.2 Why Arduino? Arduino simpliﬁes the process of working with microcon-trollers, but it offers some advantage for users over other systems: • Inexpensive - Arduino boards are relatively inexpensive compared to other micro- controller platforms. The least expensive version of the Arduino module can be
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 36 assembled by hand, and even the pre-assembled Arduino modules cost less than $50 • Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows. • Simple, clear programming environment - The Arduino programming environment is easy-to-use for beginners, yet ﬂexible enough for advanced users to take advan- tage of as well. For teachers, it’s conveniently based on the Processing program- ming environment, so students learning to program in that environment will be familiar with the look and feel of Arduino • Open source and extensible software- The Arduino software and is published as open source tools, available for extension by experienced programmers. The lan- guage can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from Arduino to theAVR C programming language on which it’s based. Similarly, you can add AVR-C code directly into your Arduino programs if you want to. • Open source and extensible hardware - The Arduino is based on Atmel’s ATMEGA8 and ATMEGA168 microcontrollers. The plans for the modules are published under a Creative Commons license, so experienced circuit designers can make their own version of the module, extending it and improving it. Even relatively inexperienced users can build the breadboard version of the module in order to understand how it works and save money.3.3 Motors Survey3.3.1 DC MotorIs a simple electric motor which uses electricity and a magnetic ﬁeld to produce torquethat results in turning of the motor. Simply, a DC Motor requires an electric coil andtwo of opposite polarity magnets in which attraction and repulsion causes rotation of themotor in a certain direction. DC Motors can be found in applications like electric razors,remote control cars and electric car windows. 18.104.22.168 DC Motor pros • Provide variable speeds • Low initial cost
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 37 • High reliability • Simple control of motor speed22.214.171.124 DC Motor cons • High maintenance • Low life-span for high intensity uses3.3.2 Stepper MotorIs a special type of synchronous motors that rotates a number of degrees with each electricpulse and can vary depending on the application. Speed of stepper motor is determinedby the time delay between each incremental movement. Typical increments are 0.9 or 1.8degrees, with 400 or 200 increments thus representing a full circle. Stepper Motors canbe found in applications like robotic devices, antenna rotators and computer hard driveswhere devices can be moved and positioned precisely. 126.96.36.199 Stepper Motor Pros • No maintenance often required • Low cost solution • Reliable and mechanically simple • Stable at standstill • Not easily demagnetized by excessive current • High continuous torque188.8.131.52 Stepper Motor Cons • Noisy at high speeds • Ringing, Resonance and poor low speed smoothness • Uses full current at standstill • Excessive Iron losses at high speeds
CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 383.3.3 Servo MotorA Servo is a small device that has an output shaft. This shaft can be positioned to speciﬁcangular positions by sending the servo a coded signal. As long as the coded signal existson the input line, the servo will maintain the angular position of the shaft. As the codedsignal changes, the angular position of the shaft changes. In practice, servos are used inradio controlled airplanes to position control surfaces like the elevators and rudders. Theyare also used in radio controlled cars, puppets, and of course robots.184.108.40.206 Servo Pros • Low cost • No power used at standstill • Smooth rotation at low speeds • High peak torque • High speed attainable • Flat speed-torque curve220.127.116.11 Servo Cons • Brush maintenance • Poor thermal performance • Can be demagnetized as a result of excessive current • Increased installed cost • Limited top speed • Limited angle of rotation “Maximum of 180 degrees”
Chapter 4Mechanical And ElectricalImplementation4.1 Mechanical Implementation Process4.1.1 Machine ChassisThe chassis is made of steel and acts as the back bone of the whole machine. It consistsof four vertical pilars, which are ﬁxed from the bottom and the top with two 70 cm x70cm square holders. The chassis is implemented with bolts openings along the pillarsand holders, to allow for various components ﬁxing locations like Trays , Boiler andElectrical Boards. It has the dimensions of 2 meters high , 70 cm width and 70 cm depth.This chassis is implemented to maintain the designed internal dimensions. 1. Getting ﬂat patterns of Steel for the vertical pillars, top and base. 2. Drilling the holes for internal ﬁxations between holders and external ﬁxations for trays and outer casings. 3. Electrostatic Painting for the vertical pillars, top and base. 4. Assembling the chassis as a whole frame, the size of bolts used were 8 mm. 39
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 40 Figure 4.1: Chassis with Trays Fixed
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 414.1.2 TraysAs mentioned in the design category, there are three different trays in design but they allgone through the same implementation process, the difference is in drilling step wheredifferent holes with different dimensions were needed. 1. Cutting ﬂat Steel sheet into a square tray of 60 cm x 60 cm with a thickness of 1.5 mm. 2. Drilling the required holes with changing the diameter and speed of cutting. 3. Electrostatic Painting for the three trays. 4. Fixing the trays to the machine with two side holders that are ﬁtted to machine chassis and trays with four 8 mm bolts on each tray. Figure 4.2: Finished trays after being ﬁtted to the chassis
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 424.1.3 ArmThe Arm consists of three complementary parts “Vertical part , Horizontal part and CupHolder”. This allows for repositioning availability and ease of maintanence if required. 1. Getting 4 cm x 4 cm “Ready Made” Aluminum tubes with thickness of 1.5 mm and cutting them to the required length. 2. Drilling the tubes for bolts openings and Arm’s Motor ﬁxations. 3. Electrostatic Painting for the three parts. 4. Assembling the three parts using bolts of 6 mm to the vertical & horizontal parts and Cup holder. 5. Fixing the Arm to the Servo Motor with 3 mm & 4 mm Bolts. Figure 4.3: Finished Arm
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 434.1.4 Cup StacksCup Stack consists of Hollow Steel Bars and Steel circular Ring. 1. Cutting twenty four steel bars 8 mm diameter with a length of 90 cm as each stack has four bars and there are six different stacks. 2. Cutting six circular rings from ﬂat steel sheet with an external diameter of 13 cm and internal diameter of 11 cm. 3. Drilling six holes in each ring with diameter of 6 mm. 4. Painting both the bars and rings with Electrostatic coating painting. 5. Threading the bars from upper and lower ends to be ﬁtted with bolts of 6 mm diameter for vertical ﬁxations on the upper tray, with the ring at the upper end and with the tray at the lower end. 6. Fixing the rings with threaded 8 mm bolts to be ﬁxed with the top part of the ma- chine. (a) Vertical bars (b) Rings after being ﬁtted with the vertical bars Figure 4.4: Finished cup stacks
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 444.1.5 Fork Dispenser 1. Getting ﬂat sheet of steel and cutting it to the required dimension which is 50 cm x 24 cm. 2. Bending the steel sheet 8 cm from both sides 90 degrees. 3. Welding two “L” steel parts to the bended steel sheet. 4. Painting the assembled part. 5. Fixing the fork dispenser with the lower tray by two linear bearings that slides outwards & inwards which allows easy packing for forks. Figure 4.5: Fork dispenser mounted on the lower tray
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 454.1.6 Machine Door 1. Cutting a ﬂat sheet of steel into the dimensions of 2 m x 70 cm. 2. Introducing the cutted part into the punch and drilling the required openings with changing the parameters of cutting like diameter, feed rate and speed. 3. Electrostatic Painting to the ﬁnished part after drilling. 4. Fixing the transparent plastic window and covering edges with rubber frame. 5. Door lock ﬁxation that has two lock points at the top and bottom of the door. 6. Assembling the door to the machine with three hinges ﬁxed at the right side of the machine chassis. Figure 4.6: Finished machine door
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 464.1.7 Forks Box 1. The forks box was manifactured using 4 carbon steel plates, two with initial dimen- sions of 20 cm x 15 cm and the other two with dimensions 15 cm x 15 cm 2. The four plates were joined together by means of MIG welding to form the shape shawn in ﬁgure 4.2 3. A ﬁfth plate, the swinging door, with dimensions 20 cm x 10 cm ,was ﬁxed on the product of the previous step by means of two hinges in order to let the door swing freely. 4. The part was then painted brown using electrostatic painting. 5. Then the box was mounted on the machine door by means of two supporting rods which were welded on the inner side of the door. The ﬁxations were done by means of four 4mm bolts and nuts with the holes drilled manually. Figure 4.7: Final shape of the forks box
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 474.1.8 Outer Casings 1. The outer casings are simply made from 5 carbon steel sheets cut to certain dimen- sions, three (two lateral and one back) with dimensions 194 cm x 64 cm and the other two (top and bottom) with dimensions 64 cm x 64 cm. 2. Four holes were drilled manually in the four corners of each sheet. 3. The sheets were painted using electrostatic paint. 4. Then the painted lateral and back casings were ﬁtted on the chassis by means of six 6 mm bolts and nuts for each one. 5. The top and bottom casings were ﬁtted on te chassis by means of four 6 mm bolts and nuts for each one. Figure 4.8: Final shape of one lateral side
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 484.1.9 Water Injection System 1. First, two aluminium bars, one with dimensions 30 cm x 4 cm x 4 cm and the other with dimensions 10 cm x 4 cm x 4cm, were welded together by means of MIG welding. 2. Then two copper tubes with inner and outer diameters of 0.4 cm and 0.5 cm respec- tively and cut to lengths of 40 cm and 25 cm respectively. 3. The two tubes were welded together using MIG welding technique to form the “T” shape. 4. An Aluminuim slider, with inner and outer dimensions of 0.5 cm and 0.6 cm re- spectively, was ﬁtted horizontally to the output member of the servo motor driving the mechanism and then attached to the T-shaped copper part. 5. All of the members of the mechanism was then painted using electrostatic painting techniques. 6. Then the T-shaped member was ﬁtted into the vertical slider mentioned in step one. 7. The whole mechanism is ﬁnally ﬁxed on the upper tray using four 4 mm bolts and nuts. Figure 4.9: Final shape of the Scotch Yoke
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 494.1.10 List of Bolts, Nuts and Washers 2mm 3mm 4mm 6mm 8mm Bolts 1 1 20 78 68 Nuts - - 20 78 68 Washers - - 40 156 136 Table 4.1: List of Bolts, Nuts and Washers4.2 Electrical Implementation4.2.1 IntroductionThe Electrical implementation is the part discussing the electrical and control design forthe product starting from the components used their function and how they are controlledto reach the desired output. It also includes the code used for controlling the variousoutputs and the electrical simulations done before manufacturing the real PCB board.4.2.2 Electrical Components18.104.22.168 MotorsAs mentioned in beneﬁts and drawbacks of each type of motors in the survey done (3.3),three motors were selected according to the points discussed as follows:22.214.171.124.1 One Digital Metal Gear Servo for rotating the Arm responsible for car-rying the Noodles Cup to different angles that corresponds to a different location. Thismotor has been selected since servo motor is used whenever fast control of angle is re-quired in addition to the ease of controlling the servo motor with the micro controller usedwhich is "Arduino Mega" and the considerable load of the Arm carried by the motor havemade the choice of using this speciﬁc motor with the rating of 20 Kg.cm. Voltage 6 - 7.2 V Speed 0.16 sec/60 degree (6V), 0.14 sec/60 degree (7.2V) Torque 18 Kg.cm (6V), 20 Kg.cm (7.2V), Stall Torque Dimension 59.5x29.2x51.3 mm Weight 164g Table 4.2: Digital Metal Gear Servo Speciﬁcations
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 504.2.2.1.2 One Mini Servo Motor for the water injection mechanism as the operationgoes by rotating 180 degrees counter clockwise then moving back the 180 degrees clock-wise and reaching the initial position. As the water injection mechanism is of a lightweight “Made of Aluminum” so this speciﬁc rating of the motor has been agreed upon. Voltage 4.2 - 6 V Speed 0.12 sec/60 degree (4.8V), 0.10 sec/60 degree (6V) Torque 12.2 Kg.cm (4.8V), 2.5 Kg.cm (6V) Dimension 22.8x12.3x29.7 mm Weight 16g Table 4.3: Mini Servo Motor Speciﬁcations126.96.36.199.3 One DC Motor with Encoder and Gear for the fork dispenser mechanismthat dispenses a fork to the customer being served. This DC Motor is selected on the basisof simple On/Off operation during a certain period of delay time. The Motor shaft is ﬁttedto an extension which carries a Spring ﬁlled with forks ready to be served such that eachcomplete rotation translates linearly a fork and dispenses it to the customer. Voltage 12 VDC Output Power 1.1 W Rated Speed 58 RPM Rated Torque 25.4 N.cm Rated Current 0.41 A Gear Ratio 1.6 Length 37 mm Weight 160 g Table 4.4: DC Motor Speciﬁcations188.8.131.52 Fifteen Relays5 volts relays for outputs 12 volts relays for some input sensors. The relays are used asswitch in which they separate the required voltage for the devices used and the controlsignal voltage of the micro-controller.184.108.40.206 Arduino Mega2560 (micro-controller)It’s the brain of the whole machine, as it’s used to control the machine input to out thedesired output, it also handles the different situation that may show up during operation.
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 5220.127.116.11 Six Push ButtonsUsed as the input peripheral for the machine.18.104.22.168 One Power SupplySupplies voltages of 12V and 5V, and a maximum current of 10A to the circuit.22.214.171.124 Five Proximity SensorsUsed to detect packs at serving position and to detect existence of every ﬂavor.126.96.36.199 Heat Sensor (1SEN11301P)To detect the temperature of the water in the boiler and stick it in the range between 60 Cto 90 C.188.8.131.52 One 220 VAC Solenoid valveUsed to controlling water ﬂow from the boiler to the water injection mechanism.184.108.40.206 One Character LCD Module 40 Char. x 2 Lines (4002A)Used as the interface between the user and the machine
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 524.2.3 Stages of electrical manufacturing:220.127.116.11 Electrical Simulation Using ProteusAt the very early stages of the project, an electrical simulation was created including allthe required connections and voltages for the micro-controller model to operate on thesimulation (as the micro controller real model used in this project it’s a shield while onthe simulation it’s just a set of connection pins that needs even the voltage required to turnthe micro-controller on).The electrical simulation also included the relays before the output motors, the relaysbefore the input sensors, motors, sensors, push buttons and the LCD.The main element in the simulation is the micro-controller code, as by uploading the codeto the simulation it should work if the connection pins, voltages and the code are correct.
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 53 Figure 4.10: Electronic circuit drawn using Proteus
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 518.104.22.168 List of Arduino Connections Pin Number In Arduino Connected to Input/Output Digital/Analogue Pin # 02 Pin 14 in LCD Output Digital Pin # 03 Pin 13 in LCD Output Digital Pin # 04 Pin 12 in LCD Output Digital Pin # 05 Pin 11 in LCD Output Digital Pin # 10 Pin 06 in LCD Output Digital Pin # 11 Pin 05 in LCD Output Digital Pin # 12 Pin 04 in LCD Output Digital Pin # 13 Pin 15 in LCD Output Digital Pin # 22 Push button 1 Input Digital Pin # 23 Push button 2 Input Digital Pin # 24 Push button 3 Input Digital Pin # 25 Push button 4 Input Digital Pin # 26 Push button 5 Input Digital Pin # 28 Arm Servo Motor Output Digital Pin # 29 Scotch Yoke Servo Output Digital Pin # 30 Temperature Sensor Input Analog Pin # 32 Magnet for ﬂavor 1 Output Digital Pin # 33 Magnet for ﬂavor 2 Output Digital Pin # 34 Magnet for ﬂavor 3 Output Digital Pin # 35 Magnet for ﬂavor 4 Output Digital Pin # 36 Sensor at Serving Position Input Digital Pin # 37 Flavor 1 packs sensor Input Digital Pin # 38 Flavor 2 packs sensor Input Digital Pin # 39 Flavor 3 packs sensor Input Digital Pin # 40 Flavor 4 packs sensor Input Digital Pin # 41 Counter reset button Input Digital Pin # 42 Solenoid Valve Output Digital Pin # 43 Serving Position Error LED Output Digital Pin # 44 Fork LED Output Digital Pin # 45 Fork DC Motor Output Digital Pin # 46 Pump Output Digital Pin # 47 Heater Output Digital Pin # 48 Intermediate Connection Output Digital Table 4.5: Arduino connections
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 522.214.171.124 Experimental Implementation On Wooden BoardAfter the simulation is ﬁnished and the motors and outputs are working ﬁne, an experi-mental wooden board was created which include all the real elements of project as a realtesting stage. The wooden board as illustrated contains the power supply, the motors, themicro controller, the LCD and the senors were substituted by push-buttons. The elementswere connected through a bread-board to link between all the elements together. Figure 4.11: Experimental Circuit
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 5126.96.36.199 PCB Wiring on ARESAfter the success of the experimental wooden board test, a PCB wiring simulation wascreated in order to manufacture the PCB main board that shall hold all the componentsand be responsible for all the connectionsThe PCB wiring on ARES was done using models on the library of the project whichresembles the real models used in the project.A manually made connection pins was made that also resembles the Arduino board(micro-controller) in order to directly connect the board on the PCB board insisted ofusing a number of wires. Figure 4.12: PCB Wiring on ARES
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 5188.8.131.52 Implemented The real PCB Board UsedThe PCB board in the beginning is double sided board one side is copper where the tracksare to be designed and the other side is plastic where components are welded.Firstly, the photo paper of the ARES wiring is ironed over the copper part of the PCB inorder to print the tracks over the copper on the PCB.Secondly, the board is submerged in a chemical ﬂuid that removes all the copper from theboard except the one with the tracks printed over. Figure 4.13: Subemerging the board
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 58Thirdly, the board is manufactured and the tracks are done the same as the simulated oneson the ARES.Finally, the PCB board is to be drilled using 0.8 or 1 mm manual driller in order to putthe components on the board and weld them on the copper plated side. Figure 4.14: Final shape of the PCB
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 594.2.4 The Face Plan of The Implemented PCBThe following Face Plan shows how Relays and wires connectors are implemented on thePrinted Circuit Board. Figure 4.15: Face plan of the implemented PCB184.108.40.206 Relays 1. Heater Relay 2. Forks DC Motor Relay 3. LED 1 Relay 4. Pack 3 Sensor Relay 5. Magnetic Lock 4 Relay 6. Pack 1 Sensor Relay 7. Magnetic Lock 2 Relay 8. Servo 2 Relay 9. Servo 1 Relay
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 60 10. Magnetic Lock 1 Relay 11. Magnetic Lock 2 Relay 12. Serving Position Sensor Relay 13. Pack 2 Sensor Relay 14. Pack 4 Sensor Relay 15. Water Solenoid Valve Relay 16. LED 2 Relay 17. Pump Relay220.127.116.11 ConnectorsRos1: 220 V ACRos2: Temperature SensorRos3: HeaterRos4: Forks DC MotorRos5: LED1Ros6: Reset CounterRos7: Pack 3 SensorRos8: Pack 1 SensorRos9: Magnetic Lock 4Ros10: Magnetic Lock 3Ros11: Servo 2Ros12: 5V DC terminalsRos13: 12V DC terminalsRos14: Servo 1Ros15: Magnetic Lock 1
CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 61Ros16: Push Button 1Ros17: Push Button 4Ros18: Push Button 2Ros19: Push Button 3Ros20: Push Button 5Ros21: Magnetic Lock 3Ros22: Serving Position SensorRos23: Pack 2 SensorRos24: Pack 4 SensorRos25: Water Solenoid ValveRos26: LED 2Ros27: Pump
Chapter 5Conclusion And FutureRecommendations5.1 ConclusionFrom a lot of types of vending machines, this project aims to introduce a new vend-ing machine that provides up to six ﬂavors of noodles and serves them either cooked orpacked. The machine is a real dimensional one, not a prototype. It has a simple electricalcontrol mechanism that ensures accuracy and functionality of the machine. The machineuses higher technology than other vending machines, cheaper components and developedsystem.5.2 Future RecommendationA lot of future work can be done to increase the functionality of this machine, as re-searching decreasing serving time and decreasing the size of the machine itself. Addingnew ﬂavors to the machine is also a proposed addition, as well as introducing a moreuser friendly interaction between user and machine. A lot of research is to be done onways of starting the machine. There are a lot of proposed solutions as reading tokens,banknotes, visa cards, special made cards. Finally, Security and communication systemscan be developed as well. A proposed research is communication between machine andtrader through modems and Internet connections 62