1. 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
2. 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
10. Acknowledgment
This project would not have been possible without the support of many people. I wish to
express 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;Moustafa
Emad El-Din, Omar Afify,Mohammed AbdelAlim and Sherif Khaled for sharing the lit-
erature and invaluable assistance. Not forgetting to express gratitude to my best friends
who have always been there; Moustafa Meleigy and Pakinam Ahmed. I would also like
to convey thanks to the Ministry and Faculty for providing the educational means and
laboratory facilities. I wish to express my love and gratitude to my beloved family; for
their understanding & endless love, through the duration of the project.
viii
11. Abstract
Many 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 eating
noodles easily, quickly and in a wider scale. The first stage was brainstorming, visualizing
the 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 comparison
between all available alterative that can be used in the project was held and we decided
which specific components are to be used. A sequence operation was then introduced
to arrange our priorities and set the guidelines in the coding and electric implementation
Mechanical, Electrical and Software Control implementation went all along in parallel.
The control system and electrical work were integrated together and tested on simulation
programs and on board many times to insure accuracy and precision. Mechanical Imple-
mentation was also integrated with components and wires for the facility of rebuilding
and maintenance. It was also simulated a lot of times on Solid works®. Finally came
the stage of integrating all components together and testing them for the machine to be
ready 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 machine
functions well, however future work research is being done on increasing the number of
flavors, decreasing serving time, decreasing the size of the machine and more security
systems
ix
12. List of Abbreviations
AVR Alf and Vegard’s Risc
cm Centimeters
CPU Central Processing Unit
DC Direct Current
DVD Digital Versatile Disc
EEPROM Electrically Erasable Programmable Read-Only Memory
I/O Input/Output
IDE Integrated Development Environment
KB Kilo Bytes
Kg Kilograms
LCD Liquid Crystal Display
MHz Mega Hertz
MIG Metal Inert Gas
mm Millimeters
PCB Printed Circuit Board
PIC Peripheral Interface Controller
PLC Programmable Logic Controller
PWM Pulse Width Modulation
RAM Random access memory
x
13. LIST OF TABLES xi
SRAM Static Random-Access Memory
USB Universal Serial Bus
14. Chapter 1
Introduction
As people continue to seek for convenience, more and more technologies are invented.
One of these technologies is the vending machine. Vending machines come in different
types as they are made for different purposes. Vending Machines are rarely found in
the market of Egypt and its industry hasn’t been made yet in addition to the increasing
consumption 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 new
virgin field with the knowhow of mechatronics can help in making this project a successful
and a practical realistic one. Before starting with details of the proposed project, we will
first talk about some facts and history about variety of vending machines.
1
15. CHAPTER 1. INTRODUCTION 2
1.1 Cold and Frozen Vending Machines:
This type is for ice cream, pies and other frozen foods. Typically, its features include
triple pane heated glass that eliminates condensation or frost. There is also an adjustable
self-defrosting cycles for a fast cool down and recovery. This machine is a great advantage
especially to those who crave for desserts. Like most vending machines, they can accept
both coins and bills.
Figure 1.1: Cold & Frozen Vending Machine
16. CHAPTER 1. INTRODUCTION 3
1.2 Bulk Vending Machines
These 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 vend
candies, 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
17. CHAPTER 1. INTRODUCTION 4
1.3 Coffee or Tea Vending Machines
This vending machine has a state-of-the-art brewing system and precise ingredient control
to satisfy every customer’s preference. In addition, it has instant or fresh brew configura-
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
18. CHAPTER 1. INTRODUCTION 5
1.4 Office Supplies Vending Machines
If one forgets to bring a pen or pencil in a very important appointment, there’s no need to
panic. These office supplies vending machines can be found in public libraries, campuses,
airports, and other locations where office workers and students are likely to go. They
display stamps, pens, pencils, paper, USB flash drives and other important office and
school supplies. These machines are easy to load and dispense but the items are usually a
little more expensive than those in bookstores and convenience stores.
Figure 1.4: Office Supplies Vending Machines
19. CHAPTER 1. INTRODUCTION 6
1.5 Drink and Snack Vending Machine
Snacks and beverage vending machines are among the most common vending machines.
They are usually found in schools, offices, hospitals, airports and gasoline stations. This
combo machine features adjustable 8 trays allowing configuration for the top selling prod-
ucts. People can buy varieties of snacks and drinks, from Potato Chips, to cookies and
candy. The soda drink side of the machine vends both cans and bottles. Most of these
machines can accept both coins and bills.
Figure 1.5: Drink and Snacks Vending Machine
20. CHAPTER 1. INTRODUCTION 7
1.6 Entertainment Vending Machine
Customers 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 of
department stores and convenience stores. These machines typically hold more than 500
DVDs. They become popular because they offer quick and cheaper entertainment. This
self-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 or
debit card and returns the DVD on the next day. Additional charges are applied if DVDs
are not returned on their due dates.
Figure 1.6: Entertainment Vending Machine
21. CHAPTER 1. INTRODUCTION 8
1.7 Change Machines
These 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 credit
cards or do bill-to-bill change. Operating the machine is quiet simple. You just need to
insert your bill and make the necessary selections as possible; then your change is already
right there in front of you. Some machines just dispense quarters and are easier to operate.
Figure 1.7: Change Machines
22. Chapter 2
Proposed Mechanical Design
2.1 Introduction
2.1.1 Theory of Operation
Instant Noodles Vending Machine which offers both a “Take & Leave” or “Cook” option
for different flavors, 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 flow 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
23. CHAPTER 2. PROPOSED MECHANICAL DESIGN 10
2.2 3D Proposal
The designs of all of the parts of the proposed mechanical design is implemented using
Solidworks software and all the dimensions are measured in cm.
Figure 2.1: Isometric 3D View
Figure 2.2: 3D Design using Solidworks
25. CHAPTER 2. PROPOSED MECHANICAL DESIGN 12
Upper Tray is a 60x60 square tray with a thickness of 1.5 mm. It is considered the main
tray 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 Tray
The middle tray is a 60 cm x 60 cm square tray with 1.5 mm thickness on which the servo
motor attached to the rotating arm and allows the arm with the cup inside to move by
stages (Cup dispensing into the arm, Water Injection & Cup delivery).
26. CHAPTER 2. PROPOSED MECHANICAL DESIGN 13
2.2.3 Lower Tray
Figure 2.5: Lower Tray
The Lower tray is a 60 cm x 60 cm square tray with 1.5 mm thickness which holds the fork
dispenser mechanism which dispenses an external fork for the user at the Fork window.
27. CHAPTER 2. PROPOSED MECHANICAL DESIGN 14
2.2.4 Cup Stacks
Figure 2.6: Cup Stacks
The Cups Stack can hold inside up to 8 noodles cups and it consists of Steel Bars and
Circular 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.
28. CHAPTER 2. PROPOSED MECHANICAL DESIGN 15
2.2.5 Machine Door
Figure 2.7: Machine Door
Machine Door (Thickness 1.5 mm) contains openings for “LCD”, “Push Buttons”, “Cup
Window” and “Fork Window” as well as a transparent plastic window.
The dimensions of the openings is shown in figure 2.6
29. CHAPTER 2. PROPOSED MECHANICAL DESIGN 16
2.2.6 Machine Outer Casings
2.2.6.1 Top and Bottom both with same dimensions
Figure 2.8: Top / Bottom Design
2.2.6.2 Left and Right both with same dimensions
Figure 2.9: Left / Right casing
30. CHAPTER 2. PROPOSED MECHANICAL DESIGN 17
2.2.6.3 Back Part
Figure 2.10: Back casing
2.2.7 Hot Water Injection Mechanism
It is basically a Scotch Yoke mechanism which converts the rotational motion of a servo
motor into linear motion. This part is responsible for puncturing a hole in the nodules
cup; 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
31. CHAPTER 2. PROPOSED MECHANICAL DESIGN 18
2.2.8 Fork Dispenser Mechanism
Fork Dispenser Mechanism which holds a spring that rotates via DC Motor translating
one fork in each rotation in the Fork Dispenser Box. The spring has a diameter of 25 mm
and a 50 cm length with a cross sectional diameter of 1 mm. .
Figure 2.12: Fork Dispenser Mechanism
32. CHAPTER 2. PROPOSED MECHANICAL DESIGN 19
2.2.9 Rotating Arm
The 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 cup
at the cup window for the user to be ready to have it at once. The Arm is controlled by a
servo motor and moves with the help of a moving wheel which carries the weight of the
Arm and smooths the rotation.
(a) Front view
(b) Top view
Figure 2.13: Rotating arm design
33. CHAPTER 2. PROPOSED MECHANICAL DESIGN 20
2.2.10 Forks Output Box
Figure 2.14: Forks Output Box
Forks 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 back
to close.
Forks Door is a swing door which is opened manually by the user then closes automati-
cally to its rest position.
34. CHAPTER 2. PROPOSED MECHANICAL DESIGN 21
2.2.11 Water Tank
Water tank holds about 19 liters of water to cover all products in the machine; one cup of
noodle takes about 125 cm3 of water. Water is pumped from the tank to the boiler then
to the hot water injection mechanism and finally to the noodles cup. Water tank is to be
rested on the base of the machine next to the pump and below the boiler.
Figure 2.15: Water Tank
35. CHAPTER 2. PROPOSED MECHANICAL DESIGN 22
2.2.12 Boiler Casing
Boiler has dimensions of 6 cm x 6 cm x 20 cm, which stores hot water up to 90c, the
boiler can store a volume of two cups to be filled with hot water. As the density of hot
fluids is less than that of cold fluids; hot water is taken from approximately the center of
the boiler and cold water is injected into boiler at the bottom which comes from the pump
then the exhaust vapor is get rid of from the top of the boiler. Therefore, the boiler has
four openings: top opening for exhaust, center for hot water out, bottom for cold water
in and finally the heater opening which the heater fits into at the bottom of the boiler. All
dimensions are shown on figure 2.16
Figure 2.16: Boiler casing
36. CHAPTER 2. PROPOSED MECHANICAL DESIGN 23
2.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 flow system
37. CHAPTER 2. PROPOSED MECHANICAL DESIGN 24
Cold Water is sucked by the pump from the water tank and goes through flow meter which
detects if there is water inside the tank or not, then goes into the boiler to be heated till
reaching a certain set up temperature of approximately 85 degrees by the means of a heater
fixed into the boiler which keeps on heating water till the temperature sensor reaches a
predefined temperature then heater stops. Hot water is then now ready and flows to water
injection 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 of
three cups of Noodles and in each transaction pump is automatically started to compensate
for the water left and automatically water is again heated. Security temperature sensor is
used for safety that will cut power to the heater incase of overheating and then power will
be restarted again when temperature goes down. In case of overheating pressure increases
and steam will be exhausted through exhaust exit back to the tank. Note: This water flow
system is the optimal system to be implemented, however there are some components
that weren’t implemented in this project but have been set up into consideration for future
expansion phase which are: flow meter, check valve, security thermostat.
2.4 Materials Selection
2.4.1 Comparison of Materials
This comparison is done about the most common and suitable materials to be used with
the vending machine according to the following:
• Ductility
• Machinability
• Density(Kg/m3)
• Melting Temperature (Celsius)
• Resistance to corrosion
• Price
38. 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 Properties
Ratings are classified as follows : Low * / Moderate ** / High ***
2.4.2 Outer Casings and Trays
For 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 the
machine could be placed in the outdoors in conditions that would result in the rusting of
the machine. So, Carbon Steel was selected as it fits all of the previous criteria.
2.4.3 Hot Water Injection Mechanism
The 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 the
body, a material that was needed had to be light to reduce the torque exerted by the servo
motor driving the mechanism.
2.4.4 Boiler
As the boiler had to be subjected to high temperature , up to 100 Celsius, with water inside
it so a material with a high melting point and high resistance to corrosion was need ad the
most suitable material for job according to table 2.1 was Stainless Steel.
2.4.5 Water Tank
For 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 to
head. So the most suitable option was to use a plastic water tank similar to the one used
in commercial water bottles.
39. CHAPTER 2. PROPOSED MECHANICAL DESIGN 26
2.4.6 Cup Stacks
The Cup stacks was design to be of length 90 cm and outer cross-sectional diameter of 0.8
cm so a strong and heavy material was needed in order not to bend and be deformed when
the cups are guided through them and it also needed to be as cheap as possible because
20 bars was manufactured. From table 2.1, it is clear the material that fits the previous
criteria is Iron and that is why it was selected.
2.4.7 Arm
The Arm as mentioned in the design phase had to be of a light weight and can be easily
machinable to meet the required design shape. Therefore according to table 2.1 the Arm
material has been selected to be Aluminium.
40. Chapter 3
Sequence of Operation and
Microcontroller
3.1 Sequence of Operation:
3.1.1 Introduction
A narrative description of how the building system components shall automatically and
optimally operate. The sequence of operation illustrates the steps of operation of the
machine and conditions required for each step to occur. It also includes the function of
sensors, motors, solenoid, pump, and heater.
Firstly, the machine checks that the machine is in normal conditions of working (no cup
at the serving position, water level in both the tank and the boiler is enough, and there is
at least one cup of any flavor present).
Secondly, the machine will be in the ready state after the previous checks it will wait for
the user input through the LCD screen which shows the available list of flavors and the
push buttons which are considered as the input sources to the machine from the user.
Thirdly, the motor will move according to the flavors position (which is converted to
angles on the micro-controller) this motor is attached to an arm which holds the chosen
pack and moves to the position where hot water is added if this packed is ordered as a
cooked pack, or take it directly to the serving position if the pack is ordered as take and
leave pack.
27
41. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 28
Figure 3.1: Block Diagram
42. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 29
3.1.2 Sequence of Operation Diagram
Figure 3.2: Sequence of operation diagram part 1
43. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 30
Figure 3.3: Sequence of operation diagram part 2
44. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 31
Figure 3.4: Sequence of operation diagram part 3
45. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 32
3.2 Micro-controller
3.2.1 Introduction
A 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 the
form of RAM (Random access memory). Micro-controllers are designed for embedded
applications, in contrast to the microprocessors used in personal computers or other gen-
eral purpose applications. Micro-controllers are used in automatically controlled products
and devices, such as automobile engine control systems, implantable medical devices,
remote controls, office 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.[1]
3.2.2 Types of Micro-controllers in Market
3.2.2.1 PIC micro-controller
PIC is a family of modified Harvard architecture micro-controllers made by Microchip
Technology. The name PIC initially referred to "Peripheral Interface Controller". Pics are
popular with both industrial developers and hobbyists alike due to their low cost, wide
availability, large user base, extensive collection of application notes, availability of low
cost or free development tools, and serial programming (and re-programming with flash
memory) capability.
3.2.2.1.1 The PIC32 architecture Pros
• The highest execution speed
• The large flash memory: 512 k Byte
• One instruction per clock cycle execution
• The first cached processor
• Allows execution from RAM
3.2.2.1.2 The PIC32 architecture Cons
• Possibility of damaging the PIC during code burning is high.
46. 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.
3.2.2.2 PLC
3.2.2.2.1 Definition A programmable logic controller (PLC) or programmable con-
troller is a digital computer used for automation of electromechanical processes, such as
control of machinery on factory assembly lines. PLCs are used in many industries and
machines. Unlike general-purpose computers, the PLC is designed for multiple inputs
and output arrangements, extended temperature ranges, immunity to electrical noise, and
resistance to vibration and impact. Programs to control machine operation are typically
stored in battery-backed-up or non-volatile memory. A PLC is an example of a hard real
time system since output results must be produced in response to input conditions within
a 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 processor
and selection of I/O modules are customized for the particular application. Several racks
can 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 the
processor, reducing the wiring costs for large plants.
3.2.2.2.2 Advantages of the PLC
3.2.2.2.2.1 Simplified changes When a control is created, it does not work prompt
successfully. Most of the controls are perfectioned step by step until the desired result is
achieved. 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 changes
to make the control work is reduced significantly. Program changes can be implemented
easier.
3.2.2.2.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. So
you can save the material that would be needed for the hard-wired control, e.g. relays and
timers.
3.2.2.2.2.3 Duplication of Programs If you have written a control program, you
can copy and use this as often as you like. In contrast, a hard-wired control would have
47. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 34
to be operated for each control separately. For reproducing control tasks a PLC is signifi-
cantly more favourable.
3.2.2.2.2.4 Comment and Documentation Possibilities When a PLC program is
written, it makes sense to write helpful comments on each instruction. If it is necessary
to change the program, it is easier to understand an existing program when comments are
included.
3.2.2.2.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 whole
concept.
3.2.2.2.3 Disadvantages of a PLC the PLC is too expensive for small or less complex
systems. Also, additional equipment and infrastructure such as programming devices,
storage, backup devices, etc. are necessary as well as is highly qualified personell to
operate a control via PLC.
3.2.2.3 Arduino Mega 2560
An Arduino board consists of an 8-bit Atmel microcontroller with complementary com-
ponents to facilitate programming and incorporation into other circuits. An important
aspect of the Arduino is the standard way that connectors are exposed, allowing the CPU
board 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 in
some variants), although some designs such as the LilyPad run at 8 MHz and dispense
with the onboard voltage regulator due to specific form-factor restrictions. An Arduino’s
microcontroller is also pre-programmed with a boot loader that simplifies uploading of
programs to the on-chip flash memory, compared with other devices that typically need
an external programmer. [2]
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 Specifications
48. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 35
3.2.2.3.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 Wiring
project. 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 syntax
highlighting, brace matching, and automatic indentation, and is also capable of compiling
and uploading programs to the board with a single click. There is typically no need to
edit files 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 IDE
comes with a C/C++ library called "Wiring" (from the project of the same name), which
makes many common input/output operations much easier. Arduino programs are written
in C/C++, although users only need define 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 shot
3.2.2.3.2 Why Arduino? Arduino simplifies 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
49. 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 flexible 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 Survey
3.3.1 DC Motor
Is a simple electric motor which uses electricity and a magnetic field to produce torque
that results in turning of the motor. Simply, a DC Motor requires an electric coil and
two of opposite polarity magnets in which attraction and repulsion causes rotation of the
motor in a certain direction. DC Motors can be found in applications like electric razors,
remote control cars and electric car windows. [3]
3.3.1.1 DC Motor pros
• Provide variable speeds
• Low initial cost
50. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 37
• High reliability
• Simple control of motor speed
3.3.1.2 DC Motor cons
• High maintenance
• Low life-span for high intensity uses
3.3.2 Stepper Motor
Is a special type of synchronous motors that rotates a number of degrees with each electric
pulse and can vary depending on the application. Speed of stepper motor is determined
by the time delay between each incremental movement. Typical increments are 0.9 or 1.8
degrees, with 400 or 200 increments thus representing a full circle. Stepper Motors can
be found in applications like robotic devices, antenna rotators and computer hard drives
where devices can be moved and positioned precisely. [4]
3.3.2.1 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 torque
3.3.2.2 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
51. CHAPTER 3. SEQUENCE OF OPERATION AND MICROCONTROLLER 38
3.3.3 Servo Motor
A Servo is a small device that has an output shaft. This shaft can be positioned to specific
angular positions by sending the servo a coded signal. As long as the coded signal exists
on the input line, the servo will maintain the angular position of the shaft. As the coded
signal changes, the angular position of the shaft changes. In practice, servos are used in
radio controlled airplanes to position control surfaces like the elevators and rudders. They
are also used in radio controlled cars, puppets, and of course robots.
3.3.3.1 Servo Pros
• Low cost
• No power used at standstill
• Smooth rotation at low speeds
• High peak torque
• High speed attainable
• Flat speed-torque curve
3.3.3.2 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”
52. Chapter 4
Mechanical And Electrical
Implementation
4.1 Mechanical Implementation Process
4.1.1 Machine Chassis
The chassis is made of steel and acts as the back bone of the whole machine. It consists
of four vertical pilars, which are fixed from the bottom and the top with two 70 cm x
70cm square holders. The chassis is implemented with bolts openings along the pillars
and holders, to allow for various components fixing locations like Trays , Boiler and
Electrical 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 flat patterns of Steel for the vertical pillars, top and base.
2. Drilling the holes for internal fixations between holders and external fixations 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
53. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 40
Figure 4.1: Chassis with Trays Fixed
54. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 41
4.1.2 Trays
As mentioned in the design category, there are three different trays in design but they all
gone through the same implementation process, the difference is in drilling step where
different holes with different dimensions were needed.
1. Cutting flat 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 fitted to machine
chassis and trays with four 8 mm bolts on each tray.
Figure 4.2: Finished trays after being fitted to the chassis
55. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 42
4.1.3 Arm
The Arm consists of three complementary parts “Vertical part , Horizontal part and Cup
Holder”. 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 fixations.
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
56. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 43
4.1.4 Cup Stacks
Cup 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 flat 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 fitted with bolts of 6 mm
diameter for vertical fixations 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 fixed with the top part of the ma-
chine.
(a) Vertical bars (b) Rings after being fitted with the
vertical bars
Figure 4.4: Finished cup stacks
57. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 44
4.1.5 Fork Dispenser
1. Getting flat 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
58. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 45
4.1.6 Machine Door
1. Cutting a flat 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 finished part after drilling.
4. Fixing the transparent plastic window and covering edges with rubber frame.
5. Door lock fixation that has two lock points at the top and bottom of the door.
6. Assembling the door to the machine with three hinges fixed at the right side of the
machine chassis.
Figure 4.6: Finished machine door
59. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 46
4.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 figure 4.2
3. A fifth plate, the swinging door, with dimensions 20 cm x 10 cm ,was fixed 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 fixations were done by means
of four 4mm bolts and nuts with the holes drilled manually.
Figure 4.7: Final shape of the forks box
60. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 47
4.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 fitted on the chassis by means of six
6 mm bolts and nuts for each one.
5. The top and bottom casings were fitted on te chassis by means of four 6 mm bolts
and nuts for each one.
Figure 4.8: Final shape of one lateral side
61. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 48
4.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 fitted 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 fitted into the vertical slider mentioned in step one.
7. The whole mechanism is finally fixed on the upper tray using four 4 mm bolts and
nuts.
Figure 4.9: Final shape of the Scotch Yoke
62. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 49
4.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 Washers
4.2 Electrical Implementation
4.2.1 Introduction
The Electrical implementation is the part discussing the electrical and control design for
the product starting from the components used their function and how they are controlled
to reach the desired output. It also includes the code used for controlling the various
outputs and the electrical simulations done before manufacturing the real PCB board.
4.2.2 Electrical Components
4.2.2.1 Motors
As mentioned in benefits and drawbacks of each type of motors in the survey done (3.3),
three motors were selected according to the points discussed as follows:
4.2.2.1.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. This
motor 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 used
which is "Arduino Mega" and the considerable load of the Arm carried by the motor have
made the choice of using this specific 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 Specifications
63. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 50
4.2.2.1.2 One Mini Servo Motor for the water injection mechanism as the operation
goes 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 light
weight “Made of Aluminum” so this specific 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 Specifications
4.2.2.1.3 One DC Motor with Encoder and Gear for the fork dispenser mechanism
that dispenses a fork to the customer being served. This DC Motor is selected on the basis
of simple On/Off operation during a certain period of delay time. The Motor shaft is fitted
to an extension which carries a Spring filled with forks ready to be served such that each
complete 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 Specifications
4.2.2.2 Fifteen Relays
5 volts relays for outputs 12 volts relays for some input sensors. The relays are used as
switch in which they separate the required voltage for the devices used and the control
signal voltage of the micro-controller.
4.2.2.3 Arduino Mega2560 (micro-controller)
It’s the brain of the whole machine, as it’s used to control the machine input to out the
desired output, it also handles the different situation that may show up during operation.
64. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 51
4.2.2.4 Six Push Buttons
Used as the input peripheral for the machine.
4.2.2.5 One Power Supply
Supplies voltages of 12V and 5V, and a maximum current of 10A to the circuit.
4.2.2.6 Five Proximity Sensors
Used to detect packs at serving position and to detect existence of every flavor.
4.2.2.7 Heat Sensor (1SEN11301P)
To detect the temperature of the water in the boiler and stick it in the range between 60 C
to 90 C.
4.2.2.8 One 220 VAC Solenoid valve
Used to controlling water flow from the boiler to the water injection mechanism.
4.2.2.9 One Character LCD Module 40 Char. x 2 Lines (4002A)
Used as the interface between the user and the machine
65. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 52
4.2.3 Stages of electrical manufacturing:
4.2.3.1 Electrical Simulation Using Proteus
At the very early stages of the project, an electrical simulation was created including all
the required connections and voltages for the micro-controller model to operate on the
simulation (as the micro controller real model used in this project it’s a shield while on
the simulation it’s just a set of connection pins that needs even the voltage required to turn
the micro-controller on).
The electrical simulation also included the relays before the output motors, the relays
before 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 code
to the simulation it should work if the connection pins, voltages and the code are correct.
66. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 53
Figure 4.10: Electronic circuit drawn using Proteus
67. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 54
4.2.3.2 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 flavor 1 Output Digital
Pin # 33 Magnet for flavor 2 Output Digital
Pin # 34 Magnet for flavor 3 Output Digital
Pin # 35 Magnet for flavor 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
68. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 55
4.2.3.3 Experimental Implementation On Wooden Board
After the simulation is finished and the motors and outputs are working fine, an experi-
mental wooden board was created which include all the real elements of project as a real
testing stage. The wooden board as illustrated contains the power supply, the motors, the
micro controller, the LCD and the senors were substituted by push-buttons. The elements
were connected through a bread-board to link between all the elements together.
Figure 4.11: Experimental Circuit
69. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 56
4.2.3.4 PCB Wiring on ARES
After the success of the experimental wooden board test, a PCB wiring simulation was
created in order to manufacture the PCB main board that shall hold all the components
and be responsible for all the connections
The PCB wiring on ARES was done using models on the library of the project which
resembles 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 of
using a number of wires.
Figure 4.12: PCB Wiring on ARES
70. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 57
4.2.3.5 Implemented The real PCB Board Used
The PCB board in the beginning is double sided board one side is copper where the tracks
are 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 in
order to print the tracks over the copper on the PCB.
Secondly, the board is submerged in a chemical fluid that removes all the copper from the
board except the one with the tracks printed over.
Figure 4.13: Subemerging the board
71. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 58
Thirdly, the board is manufactured and the tracks are done the same as the simulated ones
on the ARES.
Finally, the PCB board is to be drilled using 0.8 or 1 mm manual driller in order to put
the components on the board and weld them on the copper plated side.
Figure 4.14: Final shape of the PCB
72. CHAPTER 4. MECHANICAL AND ELECTRICAL IMPLEMENTATION 59
4.2.4 The Face Plan of The Implemented PCB
The following Face Plan shows how Relays and wires connectors are implemented on the
Printed Circuit Board.
Figure 4.15: Face plan of the implemented PCB
4.2.4.1 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
73. 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 Relay
4.2.4.2 Connectors
Ros1: 220 V AC
Ros2: Temperature Sensor
Ros3: Heater
Ros4: Forks DC Motor
Ros5: LED1
Ros6: Reset Counter
Ros7: Pack 3 Sensor
Ros8: Pack 1 Sensor
Ros9: Magnetic Lock 4
Ros10: Magnetic Lock 3
Ros11: Servo 2
Ros12: 5V DC terminals
Ros13: 12V DC terminals
Ros14: Servo 1
Ros15: Magnetic Lock 1
75. Chapter 5
Conclusion And Future
Recommendations
5.1 Conclusion
From a lot of types of vending machines, this project aims to introduce a new vend-
ing machine that provides up to six flavors of noodles and serves them either cooked or
packed. The machine is a real dimensional one, not a prototype. It has a simple electrical
control mechanism that ensures accuracy and functionality of the machine. The machine
uses higher technology than other vending machines, cheaper components and developed
system.
5.2 Future Recommendation
A 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. Adding
new flavors to the machine is also a proposed addition, as well as introducing a more
user friendly interaction between user and machine. A lot of research is to be done on
ways of starting the machine. There are a lot of proposed solutions as reading tokens,
banknotes, visa cards, special made cards. Finally, Security and communication systems
can be developed as well. A proposed research is communication between machine and
trader through modems and Internet connections
62