You are on page 1of 14

A REPORT On

VENDING MACHINE

Submitted To: Abhjit Karmakar

Submitted By: Amit kumar goyal ASE (PGRPE 2012)

CSIR-CEERI

CEERI

LIST OF FIGURES
FIGURE1: - M ELAY MACHIINE... (3) FIGURE2 :- MOORE MACHINE .(3) FIGURE3: - FINAL SYMBOL OF VENDING MACHINE ... (8) FIGURE 4: - SCHEMATICS DIAGRAM OF VENDING MACHINE... (9) FIGURE 5: - LAYOUT OF VENDING MACHINE. . (9) FIGURE 6: - LVS RESULT OF VENDING MACHINE. . (10) FIGURE 7: - OUTPUT WHEN 2 RUPEES (INPUT B ) COIN IS PROVIDED BY USER (10). FIGURE 8: - OUTPUT WHEN 5 RUPEES (INPUT C ) COIN IS PROVIDED BY USER. .. (11) FIGURE 9: - OUTPUT CANCEL BUTTON IS PRESSED BY USER . .... (12)

TABLE OF CONTENTS
LIST OF FIGURES...... (1) CHAPTER 1: - VENDING MACHINE 1.1 Introduction .......... (2) 1.2 Operation of vending machine.................. (2) 1.3 FSM .......(2) 1.4 Implementation of vending machine............................. (3) CHAPTER 2: - DESIGN METHODOLOGY.... (4) CHAPTER 3: - SIMULATION RESULT.. (7) CHAPTER 4: - CONCLUSION . (12) References.................. (13)

CEERI

CHAPTER-1 VENDING MACHINE


1.1 Introduction: Vending Machines is used to provide desired product by inserting the money. These are used to dispense various products like Coffee, Snacks, and Cold Drink etc. Vending machines are very useful and easily accessible. It can be used to sell drinks, snacks or even train tickets at railway stations without any manpower. There are different methods by which vending machine can be built i.e. using either FPGA or microcontroller. In this project work FSM based vending machine is designed, in which melay state machine is used to build the vending machine. In this machine user will provide choice and money, and according to choice, user will get the product. Extra amount (if present) will be returned to user. The machine also supports a cancel feature means that the person can withdraw the request; and the money will be returned back to the user. This reduces the time and cost. 1.2 Operation of vending machine : When the user puts in money, money counter tells the control unit, the amount of money inserted in the Vending Machine. Here user can only insert 1 Rs, 2 Rs and 5 Rs coin. When the user presses the button to purchase the item that he want, the machine will dispenses the product if correct amount is inserted. If there is any change, machine will return it to the user. If cancel button is pressed user will get his money back. 1.3 FSM (Finite State Machine) In a Finite State Machine the circuits output is defined in a different set of states i.e. each output is a state. A State Register to hold the state of the machine and a next state logic to decode the next state. An output register defines the output of the machine. In FSM based machines the hardware gets reduced as in this the whole algorithm can be explained in one process. Two types of State machines are:

CEERI

MEALY Machine: In this machine model, the output depends on the present state as well as on the input. The MEALY machine model is shown in figure 1.

MOORE Machine: In Moore machine model the output only depends on the present state. The MOORE machine model is shown in figure 2.

1.4 Implementation of Vending machine In this project a state diagram is constructed for the proposed machine which can vend the product of cost four rupees. User has flexibility to insert coin of 1 Rs, 2 Rs and 5 Rs. An internal counter will keep counting the amount and when it becomes equal to 4 Rs, machine will provide the product along with change if present. A cancel input is also used when the user wants to withdraw his request and also the money will be returned through the return output. Product and change are the outputs. Change vector is three bits wide(x, y. z). If the inserted money is more than the total money of products then the change will be returned through the change output signal.

CEERI

Name A B C Ch (x, y, z) 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 P D

Direction Input Input Input Output

Description 1 Rs 2 Rs 5 Rs Change No change 1 Rs change 2 Rs change 3 Rs change 4 Rs change

Output Input

Product Cancel input

CHAPTER 2 DESIGN METHODOLOGY


Initially when the reset button is pressed, the machine will be ready for the users to insert money. This state is the initial state of the design. The machine can accept only three types of coins i.e. rupees 1/- , 2/- and 5/-. As user insert the coin an internal counter will count the money, if it is equal to or greater than four rupees then machine will provide the product and if it Is not equal to four rupees machine will wait for next coin. As user will insert the coin machine will change its state accordingly. Meanwhile if user presses cancel button then machine will give its money back which is inserted prior to pressing of cancel button.

Description of states: Table 1 describes different states which are used in design of vending machine.

CEERI

State S0

Description Reset state Money=0

S1 S2 S3 S4

Money=1 Money=2 Money=3 Money=4

Table 1:- Description of different states Table 2 represents the relationship between different states along with output as input is provided by user. For example if present state is S1 and inserts 1 rupees coin then it will move to next state (S2 as shown below) and corresponding output is shown by x, y, z and P. Similarly at state S1 if user insert 5 rupees coin then it will move to state S4 and corresponding output is shown (product P=1, change =2 rupees).

Present state

Input d C 0 0 1 0 0 1 0 0 0 B 0 1 0 0 1 0 0 0 1 A 1 0 0 1 0 0 0 1 0

Next state

Output x y 0 0 0 0 0 1 0 0 0 z 0 0 1 0 0 0 1 0 0 P 0 0 1 0 0 1 0 0 1

S0 S0 S0 S1 S1 S1 S1 S2 S2

0 0 0 0 0 0 1 0 0

S1 S2 S4 S2 S3 S4 S0 S3 S4

0 0 0 0 0 0 0 0 0

CEERI

S2 S2 S3 S3 S3 S3 S4

0 1 0 0 0 1 0

1 0 0 0 1 0 0

0 0 0 1 0 0 0

0 0 1 0 0 0 0

S4 S0 S4 S4 S4 S0 S0

0 0 0 0 1 0 0

1 1 0 0 0 1 0

1 0 0 1 0 1 0

1 0 1 1 1 0 0

Table 2:- Input output relationship along with states This is designed by using D Flip Flop as shown in table 3. Here d0, d1, d2 represent the input of Flip Flop. Present state q2 q1 Input C 0 0 1 0 0 1 0 0 0 1 0 0 B 0 1 0 0 1 0 0 0 1 0 0 0 A 1 0 0 1 0 0 0 1 0 0 0 1 Next state q2 q1 q0 Output X 0 0 0 0 0 0 0 0 0 0 0 0 y 0 0 0 0 0 1 0 0 0 1 1 0 z 0 0 1 0 0 0 1 0 0 1 0 0 p 0 0 1 0 0 1 0 0 1 1 0 1 d2 0 0 1 0 0 1 0 0 1 1 0 1 d1 0 1 0 1 1 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 d0

q0 d 0 0 0 0 0 0 1 0 0 0 1 0

0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1

0 0 1 0 1 0 1 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 0 0

CEERI

0 1 1 0 1 1 0 1 1 1 0 0

0 0 1 0

0 1 0 0

1 0 0 0

0 0 0 0

1 0 0 1 0 0 0 0 0 0 0 0

0 1 0 0

0 0 1 0

1 0 1 0

1 1 0 0

1 1 0 0

0 0 0 0

0 0 0 0

Table 3:- I/O relationship along with Flip Flop input. This is solved by K-map and desired solution is.

R= a b c d q2 S= a b c d q2 T= a b c d q2 U= a b c d q2 P= R + Tq1 + S q0 q1 Y = R [q0q1+ q0 q1] + U q1 X = R q0 q1 Z = R q0+ U q0 + T q0 q1 d0 = S q1+ T q0 q1 d1= S [q0q1+ q0 q1] + T q1 d2= R + T q1


where R, S, T, U are the internal logic, d0, d1, d2 are input to filp flop, X, Y, Z, P are the outputs and a, b, c, d are the inputs.

CEERI

CHAPTER 3 SIMULATION RESULTS


Above equations are implemented at transistor level using Cadence (Virtuoso) and the results are shown below.

Figure3: - Final symbol of vending machine.

Figure 3 shows final overall look of vending machine where left side all are inputs and the right side pins will provides the outputs. Global inputs (vdd and gnd) will be provided internally.

Figure 4 represents the internal schematic diagram of vending machine.

CEERI

Figure 4: - Schematics diagram of vending machine. Figure 5 represents the layout of vending machine (schematics shown in figure 4).

Figure 5: - Layout of vending machine. Figure 6 shows the match between layout and schematics which represent that the schematic

CEERI

and layout shown in figure 4 and 5 are exactly same.

Figure 6: - LVS result of vending machine. Figure 7 represent the output of vending machine when user provides input b; that is when user provides 2 rupees coin each time.

Figure 7: - Output when 2 rupees (input b) coin is provided by user.

CEERI

10

As shown above internal counter will count money at each clock pulse so at first clock it will be 2 rupees and at second it will become 4 rupees and machine will provide the product (P) with no change. So here P will be high at second pulse and all other outputs are low. Figure 8 represents the output when 5 rupees coin is provided by user.

Figure 8: - Output when 5 rupees (input c) coin is provided by user.

As shown above internal counter will count money at each clock pulse, at first clock it will be 5 rupees so machine will provide product (P) along with change of 1 rupee (z) and at second it will again become 5 rupees so machine will again provide the product (P) with change. So here at each pulse P and z will be high and all other outputs are low.

Figure 9 represents the output when cancel button is pressed in between the process.

CEERI

11

Figure 9: - Output cancel button is pressed by user. As shown above user is providing 2 rupees (b) coin and during process user pressed cancel button (d) so as user press cancel button machine will return his inserted money back, in this case it is 2 rupees. So here as d is high y will become high keeping all other outputs to low level.

CHAPTER 4 CONCLUSION
The present FSM based vending machine is implemented at transistor level with the help of Cadence-Virtuoso. The design is verified by simulating schematics and checking the simulated waveform by providing desired inputs. State machines based vending System enhances productivity; reduce system development cost, and easy to implement. The designed machine can be used for many applications and we can easily enhance the number of selections. The next stage of this vending machine is to convert it into more general way in which user can get multiple products according to his choice.

CEERI

12

REFERENCES [1] Zhang Wen & Zhang Xin Long (2010) Design and Implementation of automatic vending machine Based on the short massage payment International Conference on Information and Communication technology in Electrical Sciences, Neijiang, Sichuan, China.pp.978-981. [2] B. Caulfield & M.O Mahony (2005) Passenger Requirements of a Public Transport Ticketing System Proceedings of the 8th International IEEE Conference on Intelligent Transportation Systems Vienna, Austria, pp-32-37. [3] Biplab Roy & Biswarup Mukherjee (2010) Design of Coffee Vending Machine using Single Electron Devices Proceedings of 2010 International Symposium on Electronic System Design. Pp 38-43. [4] C. J Clement Singh, K Senthil Kumar, Jayanto Gope, Suman Basu & Subir Kumar Sarkar (2007) Single Electron Device based Automatic Tea Vending Machine proceedings of International Conference on Information and Communication Technology in Electrical Sciences (ICTES 2007) , pp 891-896.

CEERI

13

You might also like