Вы находитесь на странице: 1из 24

SIDDAGANGA INSTITUTE OF TECHNOLOGY, TUMAKURU-572103

(An Autonomous Institute under Visvesvaraya Technological University, Belagavi)

Major Project Midsem Review


on
“Design of Digital Vending Machine using Verilog
HDL”

submitted in partial fulfillment of the requirement for the completion of VIII semester
of

BACHELOR OF ENGINEERING
in
ELECTRONICS & COMMUNICATION ENGINEERING
Submitted by

Raghav Kashyap K S 1SI15EC047


Rohan S 1SI15EC079
Shireesh G 1SI15EC095

under the guidance of


Vinaya S J
Assistant Professor
Department of E&CE
SIT, Tumakuru-03

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


2018-19
Abstract
To design a logic circuit that can be used in digital vending machine using Verilog HDL
and implementing through Field Programmable Gate Array (FPGA) kit. The digital
vending machine controller accepts three modes of transactions namely coins or through
reloadable prepaid cards or through digital payment using android mobile application.The
controller is designed using Finite State Machine approach.

The controller is implemented with Field Programmable Gate Array and simulated using
Xilinx and ModelSim software. The acceptance of coins or digital currency is simulated
as a digital pulse and then that transaction of item is viewed by using waveforms through
simulation which is later implemented through hardware.
List of Figures
3.1 The block diagram of Vending machine. . . . . . . . . . . . . . . . . . . . . 5
3.2 The flow chart of Vending machine controller . . . . . . . . . . . . . . . . . 6
3.3 The flow chart of Vending machine controller . . . . . . . . . . . . . . . . . 7

4.1 Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Pin diagram of Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3 Arduino Uno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.4 Pin diagram of Arduino Uno . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5 RFID Reader EM18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6 RFID tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.7 Coin Acceptor Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.8 Coin Acceptor Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.9 Pin diagram for Coin Acceptor . . . . . . . . . . . . . . . . . . . . . . . . 14

5.1 Circuit of card mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16


5.2 Circuit of coin mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.3 App cover page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.4 Application window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

ii
List of Tables

iii
Chapter 1
Introduction
The primary and essential component for any human being to survive is food. The avail-
ability of the food is not efficient till date. Therefore Vending machine reduces this barrier.
The main aim is to design and implement digitalized vending machine which is an up-
dated version of a coin operated vending machine and to design a digital vending machine
controller using the Finite State Machine methodology and the FPGA kit which reduces
the timing difference and power.

1.1 Motivation
The Vending machine provides various products such as snacks, beverages, water, tick-
ets, and others products. Vending machine has many benefits such as no need of human
energy, flexible in time, and saving time. The Vending machine does not use any human
energy on it and it is managed by operator. The labor work can be reduced from Vending
machine. It is flexible in time and can operate in 24 hours a day, seven days a week. It
can be operated anytime although that is a holiday or a weekend.
The Vending machine can save time. In a business, an employee does not need to waste
time for lunch. With a Vending machine in the cafeteria, all they have to do is place
some coins and push some buttons to get a drink or a snack. The Vending sector has seen
significant growth over the years and it will continue to do so in the years to come. The
Vending machine now needs to improve to give more contribution and benefits to human
life.

1.2 Objective of the project


The objective of the project is to design and implement digitalized vending machine which
is an updated version of a coin operated vending machine and to design a digital vending
machine controller using the Finite State Machine methodology and the FPGA kit. The
digital vending machine controller accepts three modes of transactions namely coins or

1
Design of Digital Vending Machine using Verilog HDL 2018-19
through reloadable prepaid cards or through digital payment using android mobile appli-
cation.

1.3 Organisation of the report


This project is divided into 4 chapters. Report begins with motivation, objective of the
project and literature survey in Chapter 1. Chapter 2 contains block diagram description
and explains all the components used in the project. Chapter 3 contains for flow chart
Finite State Machine (FSM). Chapter 4 contains for Conclusion and future work.

Dept.of E&CE, S.I.T.,Tumakuru-03 2


Chapter 2
Literature Survey
This chapter includes summary of the different papers that are carried as a ground work
for the project.

[1] Design and Implementation of Vending Machine using Verilog HDL on


FPGA:
The modelling of a Finite State based Vending machine using the mealy machine model
is developed. The proposed machine has been implemented on Spartan3 FPGA devel-
opment board. The whole design has been functionally verified using Xilinx 9.2i and
ModelSim 6.2a simulator.

[2] Finite State Machine based Vending Machine Controller with Auto-Billing
Features:
The designing of multi select machine using Finite State Machine model with AutoBilling
is described. Finite State Machine (FSM) modelling is the most crucial part in devel-
oping proposed model as this reduces the hardware. The process of four states ( User
selection, Waiting for money insertion, product delivery and serving) has been modelled
using MEALY model.

3
Chapter 3
System Overview
This chapter discusses about the block diagram and different components used in Vending
machine using Verilog HDL as shown in Figure.

3.1 Block Diagram Description


Inputs:
1. Select mode (Sm):
This mode selects the mode of input to the Vending machine. It may be either coins or
reloadable prepaid cards or digital payment using android mobile application.
2. Coin input (Cin):
Cin intakes coins as an input to the Vending machine from the user.
3. Card input (Cain):
Cain makes use of reloadable prepaid cards as an input.
4. Select product (Sp):
This input to the Vending machine selects the products in accordance to the user require-
ments. Here the product selection may be product A, B or C.
5. Cancel:
The selected mode or the selected product can be cancelled again according to the user
requirement by Cancel input.
6. Mobile input (Min):
The digital currency is credited to the Vending machine through Mobile input (Min).
7. Reset:
The reset input resets the controller of Vending machine.
8. Clock:
The continous signal given to the Vending machine on which the other inputs rely.

4
Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 3.1: The block diagram of Vending machine.

Outputs:

1. Product A (Pa):
It delivers product A.
2. Product B (Pb):
It delivers product B.
3. Product C (Pc):
It delivers product C.
4. Change 5 (Ch5):
The extra 5 rupees inserted by the user for the product is returned back.
5. Change 10 (Ch10):
The extra 10 rupees inserted by the user for the product is returned back.
6. Change b (Chb):
The entire amount inserted by the user for the product is returned back if the user cancels
it or the provided amount doesnt meet the required cost of the product.

Dept.of E&CE, S.I.T.,Tumakuru-03 5


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 3.2: The flow chart of Vending machine controller

3.2 Flow chart


This Chapter discusses the working of Vending machine controller using Verilog HDL in
terms of Flowchart as shown in Figure.

Dept.of E&CE, S.I.T.,Tumakuru-03 6


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 3.3: The flow chart of Vending machine controller

Dept.of E&CE, S.I.T.,Tumakuru-03 7


Chapter 4
System Hardware
4.1 Raspberry Pi
Raspberry Pi has a chip,a quad-core 64-bit ARM Cortex 853 processor running at 1.2
gigahertz. It has 2.5 Amp micro USB power input. It has full size HDMI output. A 3.5
mm jack is provided for Audio video output. A DSI port and a CSI port is available for
hooking up a PI camera. There are 40 GPIO pins, SD slot for micro SD card, Ethernet
and four USB 2.0 connectors, and a built in antenna which connects to built in Wifi on
the back of the board. The model of Raspberry Pi is shown in the figure 4.1.

The Raspberry Pi may be operated with any generic USB computer keyboard and mouse.
It may also be used with USB storage and virtually any other device or component with
USB capabilities. The pin diagram of Raspberry Pi is shown in figure 4.2.

4.2 Arduino Uno


The microcontroller used is an Arduino Uno as shown in figure 4.3. This is a popular
microcontroller that is easy to wire and program. It has sufficient analog input ports to

Figure 4.1: Raspberry Pi

8
Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 4.2: Pin diagram of Raspberry Pi

Figure 4.3: Arduino Uno

Dept.of E&CE, S.I.T.,Tumakuru-03 9


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 4.4: Pin diagram of Arduino Uno

read from various analog sensors simultaneously, and also features a Serial Data (SDA)
line and a Serial Clock (SCL) line. Both an SDA line and an SCL line are required to
support I2C sensors. With these input ports, the Arduino Uno is able to read from three
different analog sensors and two digital sensors simultaneously. Furthermore, the Arduino
Uno includes Serial Peripheral Interface (SPI) functionality, which allows it to interface
with certain peripheral hardware devices, such as SD card modules. On top of this, the
board also allows digital ports to be configured to act as Serial Receive (RX) or Serial
Transmit (TX) lines. These are necessary to connect with a Bluetooth module correctly.
Finally, because of its popularity, many hardware modules are designed to work specif-
ically with Arduino microcontrollers, including those that the Sensor Interface requires,
like Bluetooth modules and SD card modules. The pin diagram of Arduino Uno is shown
in figure 4.4.

4.3 RFID Reader EM18


The RFID (Radio Frequency IDentification) Reader module used in this project is EM
18. It radiates a 125 KHz signal through its antenna and hence a similar frequency based
RFID Card must be used. RFID is an automatic identification and data collection tech-

Dept.of E&CE, S.I.T.,Tumakuru-03 10


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 4.5: RFID Reader EM18

Figure 4.6: RFID tags

nology which uses the electromagnetic fields in the radio frequency range for non-contact
operation as shown in figure 4.5. RFID Technology is similar to that of bar codes or
magnetic strips i.e. they all provide unique identification system. The data retrieving
operation is also similar to the other two technologies. Bar codes and magnetic strips
must be scanned against their corresponding readers and similarly RFID devices must
also be scanned or swiped against their readers. The advantage of RFID technology over
bar codes or magnetic strips is that RFID doesnt need any physical contact as in case of
magnetic strips (ATM or credit cards) or neednt be placed in a particular position as in
case of bar codes. The RFID tags are shown in figure 4.6.

Dept.of E&CE, S.I.T.,Tumakuru-03 11


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 4.7: Coin Acceptor Module

4.4 Coin Acceptor Module


This coin acceptor will take different kinds of coin. The sensors in this coin acceptor
use the thickness, diameter and fall time of the coins to identify them and its fully pro-
grammable so youre not limited to any particular type of currency. Simply use the buttons
and 7-segment display on the side of the unit to select a coin profile, insert a bunch of
coin samples. After programming the coin profiles, the coin acceptor will recognize them
and report when each type is inserted, rejecting other coins. This module will be able to
tell counterfeits if they have a different thickness, diameter and have a different fall time
to the coins that its programmed for. Its not going to have like a magnetic signature
detector in there that will read the field of the coin or anything. The Coin Acceptor
module is shown in figure 4.7. and figure 4.8.

The pin diagram for Coin Acceptor module is shown in figure 4.9.

Dept.of E&CE, S.I.T.,Tumakuru-03 12


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 4.8: Coin Acceptor Module

Dept.of E&CE, S.I.T.,Tumakuru-03 13


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 4.9: Pin diagram for Coin Acceptor

Dept.of E&CE, S.I.T.,Tumakuru-03 14


Chapter 5
Work done
5.1 Card mode:
The card mode is firstly selected by the user in the mobile through our app designed using
android studio and raspberry-pi gets its pins (19 21) high and the Arduino Uno controller
enters into the card mode by making its digital pin 6 high. Now, the RFID reader reads
the address of the card and its address is serially transmitted to Arduinos receiver pins.
Digital pin 5 in Arduino Uno gets high indicating the Raspberry pi that the address is
received. The amount gets deducted in the database and the transaction through card
mode gets completed. The Card mode circuitry is shown in the figure 5.1.

5.2 Coin mode:


The coin mode is firstly selected by the user in the mobile through our app designed using
android studio. The Coin Acceptor module is calibrated to accept five-rupee coins and
the pulse generated while inserting each coin is given to pin 2 in Arduino Uno controller.
The output is verified by driving LED’s for corresponding coins inserted. The Coin mode
circuitry is shown in the figure 5.2.

5.3 Mobile input:


An application is developed using Android studio for sensing mobile inputs. The users
can login into the app where item names along with price tags is displayed, after which
another window opens displaying Available items and remaining balance. Once the item
is selected, it waits for acknowledgement from the vending machine after which the cor-
responding price may be deducted. The mobile app developed is shown in figure 5.3. and
figure 5.4.

15
Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 5.1: Circuit of card mode

Dept.of E&CE, S.I.T.,Tumakuru-03 16


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 5.2: Circuit of coin mode

Figure 5.3: App cover page

Dept.of E&CE, S.I.T.,Tumakuru-03 17


Design of Digital Vending Machine using Verilog HDL 2018-19

Figure 5.4: Application window

Dept.of E&CE, S.I.T.,Tumakuru-03 18


Chapter 6
Plan of Action
Events 2018 2019
Aug Sept Oct Nov Dec Jan Feb Mar Apr
Literature survey for problem identification X
Problem formulation X
Literature survey for possible methods
to address the problem
OR X X
Contemporary technology to
address the problem
Identification of
X
platforms/tools/devices controllers
Design solution X X
Validate the design, analyze and
X X
interpret the results
Preparation of the report X
Presentation of the work carried
X
on workshop/symposium
Demonstration X

19
Bibliography
[1] Abhishek Luthra, Akshat Jain, Parnika Mishra, Vikas Gupta and Sunil Aggarwal,
“Design and Implementation of Vending Machine using Verilog HDL on FPGA”,Vol.
4, Issue 11, November 2015, IJIRSET.

[2] Ana Monga and Balwinder Singh, “Finite State Machine based Vending Machine Con-
troller with Auto-Billing Features”, International Journal of VLSI design Communi-
cation Systems(VLSICS) Vol.3, No.2, April 2012.

[3] Charles H. Roth, Jr. “DIGITAL SYSTEMS DESIGN USING VHDL”, the University
of Texas at Austin.

20

Вам также может понравиться