Sunteți pe pagina 1din 6

Vending Machine

Karim I. Chevelwalla#1, Onkar P. Chauhan*2


#
Electronics (T.E), M.H.S.S.C.O.E
8, Saboo Siddik Polytechnic Road, Byculla, Mumbai-400008, India.
1
karim_c@in.com
*
Electronics (T.E), M.H.S.S.C.O.E
8, Saboo Siddik Polytechnic Road, Byculla, Mumbai-400008, India.
2
its_kaaar@yahoo.com

Abstract— The main purpose of designing our project was to


create a vending machine which could provide a number of soft
drinks, juices and water to the people using extremely simple
steps. These steps would not be time consuming at all. The user
would get all the details on the screen which he/she should follow.
We have made an attempt to vend products of different prices in
the same machine. The machine will also provide the balance
money to the user depending on the product selected. We have
tried to implement various combinations so that people can get a
wide range of drinks to choose from. Despite a few difficulties
and a lot of support from our project in charge we were able to
incorporate our program and have a vending machine which
could actually be implemented in actual sense.

Keywords— Put your keywords here, keywords are separated by


comma.

I. INTRODUCTION
Vending machines are coin-operated machines that can
dispense snacks, drinks, sandwiches, coffee, tea and other
products. These are an extremely convenient outlet for the
industry known as automatic retailing. We find vending
machines in public buildings, transportation hubs and subways,
at gas stations, courthouses, hospitals, and the local
automotive repair shop. Any place that people gather, pass by,
or must wait, is a good location for vending machines. In our
vending machine, we have tried to incorporate cold beverages
ranging from a Rs. 20/- to Rs. 40/-. It is possible for the
people to buy drinks of his/her choice from a variety of drinks
available in the machine. Also he/she can buy a combination Fig. 1 Block Diagram of Vending Machine
of drinks depending on the money he/she would like to spend.
The machine will return back the balance amount if he/she The block diagram of the vending machine has the
provides excess money into the machine. following blocks:
• Reset
• Input
II. DESIGN & SIMULATION
• Selection options (Cold drinks)
Our main aim was to try and make a vending machine • Output (Desired Cold drink)
which would provide the user a variety of drinks to choose • Balance money
from but with extremely simple operation. It is not like the Initially the user is required to provide the input in the fom
conventional vending machine which ask the user to provide of coin i.e.Rs.10/-. As soon as the input is provided the user is
exact change. Even if the user provides excess money, the asked provided with a variety of options to choose from. The
machine returns the money back. The block diagram of the user can select the drink of his/her choice and then proceed to
vending machine will explain our concept. towards the output. At the output the desired cold drink is
available. If the user provides extra money in case he does not
have change then along with the cold drink, the machine will
also return back the excess money to the user.
III. IMPLEMENTATION Go : out STD_LOGIC;
Ao : out STD_LOGIC;
Regardless to say this was our first attempt to make such a Q : out STD_LOGIC_VECTOR (4 downto 0));
big project using VHDL. Our knowledge about VHDL was end om_car;
also quite scarce.
As this was our first project using VHDL little did we know architecture Behavioral of om_car is
about the programming and tools available for it. But the TYPE State_type IS (A, B, C, D, E, F, G, H , I , J , K , L , M ,
World Wide Web has helped us a lot with the same. We N , O , P , W , R , S , T , U , V , X , YY , Z ) ;
decided to use Xilinx programming software for our project.
The Model-Sim software helped us to write the program in its SIGNAL y : State_type ;
program window and simulate the program. The software also
pointed out the errors present in the particular line in the begin
program. After simulating, it the waveform depending upon Process
the input provided. Begin

VHDL code of Vending machine: If Reset = '0' then -- to get back to the initial state.
y <= A; CRo <= '0'; Qo <= '0'; Co <= '0'; Bo <= '0'; Wo <= '0';
library IEEE; DQo <= '0'; Eo <= '0';
use IEEE.STD_LOGIC_1164.ALL; Fo <= '0'; So <= '0'; Ao <= '0' ; Mo <= '0'; Go <= '0'; Vo <= '0';
use IEEE.STD_LOGIC_ARITH.ALL; Q <= "00000"; end if;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity om_car is Wait Until falling_edge (Clock); --considering falling edge.
CASE y IS
Port ( Clock : in STD_LOGIC;
Reset : in STD_LOGIC; WHEN A => Q <= "00000";
Cr : in STD_LOGIC; If Qi = '1' then y <= B; end if;-- to enter into the state B.
Qi : in STD_LOGIC; WHEN B => Q <= "00001";
Ci : in STD_LOGIC; If Cr = '1' then y <= C; -- to get back into the initial state.
Bi : in STD_LOGIC; elsif Qi = '1' then y <= D; end if; -- to enter into the state D.
Wi : in STD_LOGIC; WHEN C => Q <= "00010";
Ei : in STD_LOGIC; CRo <= '1' after 0 ns, '0' after 200 ns; y <= A; --to get coin
Fi : in STD_LOGIC; return out.
Si : in STD_LOGIC; WHEN D => Q <= "00011";
Mi : in STD_LOGIC;
Vi : in STD_LOGIC; If Cr = '1' then y <= C; -- to return to the C state.
Gi : in STD_LOGIC; elsif Qi = '1' then y <= G; -- to enter into the state G.
Ai : in STD_LOGIC; elsif Ci = '1' then y <= E; -- to enter into the state E.
DP : in STD_LOGIC; elsif Mi = '1' then y <= F; -- to enter into the state F.
RR : in STD_LOGIC; elsif Wi = '1' then y <= I; -- to enter into the state I.
CW : in STD_LOGIC; elsif DP = '1' then y <= W; end if; -- to enter into the state W.
CB : in STD_LOGIC;
BW : in STD_LOGIC; The above code which is shown is for one state. The program
WW : in STD_LOGIC; will follow the similar pattern for the other states. That is the
CC : in STD_LOGIC; above code is for just one beverage. When the user wishes to
BB : in STD_LOGIC; choose some other cold drink, similar code is followed. The
CRo : out STD_LOGIC; user is allowed to choose from a number of other cold drinks.
Qo : out STD_LOGIC; Also the user is provided an option of choosing cold drinks of
Co : out STD_LOGIC; various prices and at the output the user is given the selected
Bo : out STD_LOGIC; cold drink that he/she has chosen. Also another thing which is
Wo : out STD_LOGIC; provided at the output is balance money. If the user might
DQo : out STD_LOGIC; have given the machine extra money then as per the code, the
Fo : out STD_LOGIC; vending machine will give the user the balance money along
Eo : out STD_LOGIC; with the selected cold drink. The complete code is provided in
So : out STD_LOGIC; the attachments provided with the report which has the entire
Mo : out STD_LOGIC; logic.
Vo : out STD_LOGIC;
The program cannot be explained line by line. Instead it can
be easily explained using the state diagram. The state diagram
helps to understand the entire logic step by step. We have
made an attempt to try and explain the entire program and
logic using the state diagram.
The exact step by step description and explanation of the
program is as stated below:
• The machine takes Rs. 10/- only. The input is
denoted by Qi. As soon as the machine gets Rs. 20/-, Fig. 2.2 State-2
it gets activated and performs the operations as
ƒ State 3:
directed by the user and provides the output.
Again if the user gives Rs. 10/- (i.e.Total of Rs.
• The machine can dispense the following items at the
20/-) the machine goes into state D and waits
output:
for the next instruction.
¾ Coke (Co): Rs. 20/-
¾ Water (Wo): Rs. 20/-
¾ Milk (Bo) : Rs. 20/-
¾ Apple Juice (Ao): Rs. 30/-
¾ Guava Juice (Go): Rs. 30/-
¾ Cocktail Juice (Fo): Rs. 30/-
¾ Fruit Beer (Vo): Rs. 40/-
¾ Mango Shake(Mo): Rs. 40/-
¾ Mosambi juice (So): Rs. 40/-
¾ Energy Drink (Eo): Rs. 40/-
¾ Coin Return out (Cro)
The above mentioned beverages are the output which
the machine will give out after performing following
the user’s instructions. Fig. 2.3 State-3
• The machine has a Coin Return button (Cr)
• Only one input may be active at a time. • State 4:
• A product can be dispensed in one clock cycle. Now the machine is in state D (Rs. 20/-)
• If more than 40/- Rupees is inserted, then along with The user can now:
the required cold drink, the extra money is returned ¾ Do nothing & stay in State D.
back to the user. Similar is the case when 30/- ¾ Hit the Coin Return & Go to state C and take the
Rupees is inserted and the user selects a 20/- Rs. money back. (Cro)
drink, the extra money is returned back. And so on. ¾ Select Coke (Ci) & go to state E, get coke at the
• If no inputs are active, the state machine stays in the output (Co), then go to state A.
current state. ¾ Select Milk (Bi) & go to state F, get Milk bottle
at the output (Bo), then go to state A.
How will this work? ¾ Select Water (Wi) & go to state I, get water bottle at
ƒ State 1: the output (Wo), then go to state A.
If nothing has happened, or if the machine has
been reset, the machine is in state A.

Fig. 2.1 State-1

ƒ State 2:
If the user gives Rs.10/- as input (Qi), the machine
goes to state B.
The user can now:
¾ Do nothing & stay in State B.
¾ Hit the Coin Return & go to state C and take the
money back.(Cro)
Fig. 2.4 State-4
ƒ State 5: ƒ State 7:
Again if the user gives Rs. 10/- (i.e.Total of Rs. If the user feels that he wants to buy only an item of
30/-) the machine goes into state G and waits for Rs.20/- then the machine will provide the item worth
the next instruction. Rs.20/- at the output and he/she will also get back the
balance money.(i.e. Rs.10/- back)

Fig. 2.5 State-5

• State 6:
Now the machine is in state G (Rs. 30/-)
The user can now:
¾ Do nothing & stay in state G. Fig. 2.7 State-7
¾ Select Cocktail juice (Fi) & go to state H,
get Cocktail juice at the output (Fo), then go
to state A. ƒ State 8:
¾ Select Apple Juice (Ai) & go to state O, get Again if the user gives Rs. 10/- (i.e. Total of Rs. 40/-) the
Apple juice at the output (Ao), then go to machine goes into state J and waits for the next
state A. instruction.
¾ Select Guava juice (Gi) & go to state P, get
Guava juice at the output (Go), then go to
state A.

Fig. 2.8 State-8


Fig. 2.6 State-6
ƒ State 9: ƒ State 11:
If the user feels that he wants to buy only an item of Now the machine is in state J (Rs.40/-)
Rs.30/- then the machine will provide the item worth The user can now:
Rs.30/- at the output and he/she will also get back the ¾ Do nothing & stay in State J.
balance money.(i.e. Rs.10/- back) ¾ Take the cash back (Cr).
¾ Select Energy drink (Ei) & go to state K, get
Energy drink at the output (Eo), then go to
state A.
¾ Select Mango Juice (Mi) & go to state M, get
Mango juice at the output (Mo), then go to
state A.
¾ Select Fruit beer (Vi) & go to state P, get Fruit
beer at the output (Vo), then go to state A.
¾ Select Mosumbi juice (Si) & go to state N, get
Mosumbi juice at the output (So), then go to
state A.
¾ The machine will remain in J state if it
receives another 10/- Rs. at the input.

Fig. 2.9 State-9

ƒ State 10:
If the user feels that he/she wants to buy only an item
of Rs.20/- then the machine will provide the item
worth Rs.20/- at the output and he/she will also get
back the balance money.(i.e. Rs.20/- back)

F
Fig. 2.11 State-11

IV. RESULTS
We would gladly say that our first attempt at a project of
this magnitude did pay off well and the program did work. We
synthesized the program using Xilinx 9.1 and got the
successful CPLD report. The test bench which was performed
was also carried out successfully without any errors. We gave
several inputs into the machine keeping the user in mind and
got the waveforms accordingly. The output waveforms
indicated the successful working of the vending machine
when an input is given to it. The waveform is shown below :
Fig. 2.10 State-10
21 GND 71 KPR
Also the synthesis generated the CPLD report along with 22 Clock 72 KPR
the corresponding integrated circuit equivalent to the vending 23 Q<3> 73 NC
machine. The integrated circuit has pins corresponding to the 24 Q<1> 74 KPR
inputs, outputs and reset. The integrated circuit that is 25 NC 75 NC
generated by the software is of 100 pins. The figure below 26 VCC 76 WW
shows the pin diagram: 27 Q<4> 77 Vi
28 Q<0> 78 Si
Device : XC2C64A-5-VQ100 29 Q<2> 79 Wi
30 Bo 80 NC
31 GND 81 Reset
32 Wo 82 NC
33 Co 83 TDO
34 Qo 84 GND
35 KPR 85 NC
36 KPR 86 NC
37 KPR 87 NC
38 VCCIO-1.8 88 VCCIO-1.8
39 KPR 89 Vo
40 KPR 90 So
41 KPR 91 Mo
42 KPR 92 RR
43 KPR 93 NC
44 NC 94 Qi
45 TDI 95 NC
46 NC 96 NC
47 TMS 97 Mi
48 TCK 98 VCCIO-1.8
49 KPR 99 Gi
50 KPR 100 GND

Another advantage of the software was that it performed all


the operations without much prompts. Thus we were able to
successfully synthesize the code and get the desired results.
Fig. 4.2 Equivalent Pin Package

Pin Signal Pin Signal V. CONCLUSION


No. Name No. Name When we realised that we have at last made a code that
1 Fi 51 VCCIO-1.8 could actually work as a user friendly vending machine, we
2 Ei 52 KPR were over-joyed at our achievement. Yes! This code can
3 DP 53 KPR actually provide a variety of options to the user and also return
4 Cr 54 NC him/her the balance money. Thus we would conclude saying
5 VCCAUX 55 KPR that we tried our bit to modify the present day complex
6 Ci 56 KPR vending machine into a user friendly and user specific
7 CW 57 VCC vending machine. We humbly thank our project incharge who
8 CC 58 KPR through his motivative ways helped us in successful
9 CB 59 NC completion of the project.
10 Bi 60 KPR
11 BW 61 KPR REFERENCES
12 BB 62 GND 1. www.images.google.co.in/imgres?imgurl=http://teeeph.net/blog/w
13 Ai 63 NC pcontent/uploads/2009/08/vending_machine.jpg&imgrefurl=http://
14 Ao 64 KPR teeeph.net/blog/&usg=__ub4r6Uwgb7u0JeCapV_XZjyyXBo=&h
15 CRo 65 NC =428&w=300&sz=26&hl=en&start=1&tbnid=iPCk4WIYMKF_q
16 DQo 66 NC M:&tbnh=126&tbnw=88&prev=/images%3Fq%3DVENDING%2
17 Eo 67 KPR BMACHINE%26gbv%3D2%26hl%3Den%26sa%3DG
18 Fo 68 KPR 2. http://www.xilinx.com/prs_rls/2007/software/0715_webpack.htm
19 Go 69 GND 3. http://www.xilinx.com/company/press/kits/planahead/backgrounde
20 NC 70 KPR r.pdf
4. http://www.wikipedia.org/wiki/Vending_machine.htm

S-ar putea să vă placă și