Project Title Tea & Coffee Vending Machine
DEPARTMENT ELECTRICAL ENGINEERING
SUBMITTED TO MAM SEEMA TAHIR
GROUP MEMBERS
MARYAM RAZZAQUE 220644
MUHAMMAD HAMZA 220666
ABDULLAH 220665
Project Title
COFFEE AND TEA VENDING MACHINE
Objectives:
The aim of this intricate engineering challenge is to explore and engineer a tangible real-world
application characterized by the following attributes:
Abstract Problem Solving: Tackle a problem that lacks an evident solution, demanding abstract
thinking and original analysis to formulate innovative models. Apply creative problem-solving
skills to devise solutions that address the unique challenges associated with the design of a coin-
operated vending machine.
Interdependence and High-Level Complexity: Engage with a high-level problem that exhibits
interdependence, encompassing numerous component parts and sub-problems. Design and
simulate a coin-operated vending machine that integrates seamlessly with its environment,
considering the intricate relationships between various subsystems. Through addressing these
challenges, the project seeks to demonstrate a capacity for abstract reasoning, original problem-
solving, and the ability to navigate the complexities inherent in the development and simulation
of a sophisticated coin-operated vending machine.
Method:
Our problem was to invent an coffee and tea vending machine that has the ability to take the
input from user as a money and then them option to select the tea or coffee.Our problem was to
to take the money and give the required product to the user and return back the remaining money
We have design the logical circuit with the help of and,or,not gates and xor gates.Then we use
some decoders and subtractors to change the amount of money. Then we have to make some
logic to implement the selection of items. Logical gates, including AND, OR, and XOR gates,
are instrumental in processing user inputs.Specifically, two AND gates are strategically utilized
to discern the presence of a coin and the selection of a product (either tea or coffee).An XOR
gate serves the purpose of ensuring an exclusive product selection, preventing simultaneous
choices of both tea and coffee. To manage payments and balances, a subtractor is brought into
play.The subtractor takes the coin value as the minuend and the product cost as the
subtrahend.The result of this subtraction signifies the remaining balance, a critical parameter that
is then communicated to the user. Based on the outputs from the logical gates, the machine
activates the necessary components for preparing the selected beverage.
For instance, if tea is chosen, the tea preparation mechanism is set into motion, and the subtractor
adjusts the balance accordingly.
Design and Simulation
Our aim was to try and make a vending machine which would provide user different
items with extremely simple operation. It is not like the conventional vending machine
which ask the user to provide exact change. Even if the user provides excess money, the
machine returns the money back on 7-segment display. The block diagram of the vending
machine explain our concept.
Block diagram
The block diagram for vending machine has following parts.
Input
Selection
Output
Balance remaining
Initially the user is required to provide the initial amount of money using combination
of switches. Assuming that vending machine can only have 1, 2, 5 and 10 rupee coins
available (according to pre-condition specified by instructor). The different type of coins
can be denoted by four different switches. From the left corner vertically down, the four
switches representing 1, 2, 5 and 10 rupee coins respectively. If you press switch No. 1,
you enter one rupee coin, if you press switch No.2, you enter 2 rupee coin if you press
switch No.3, you enter 5 rupee coin if you press switch No.4, you enter 10 rupee coin.
And if you press both switch 2 and 3, your net amount is sum of both coins i.e. 7 rupee.
These input of these switches is added using full adders and then displayed on two seven
segment displays, showing your input amount. There are total of 8 LEDs acting as eight
different products whose prices are fixed. The customer can choose one LED at a time
using combination of three switches. Here we use a 3x8 decoder, the output of decoder is
going to each LED and input is connected to each of three switches. These three switches
act as three bit binary number. If user entered 000 then product 1 will be issued and the
price of that product will also be shown next to it and change will also be shown next to
the price of the product. Similarly if user press 001 then product 2 will issued to the
customer following the same procedure that is price will shown next to the product 2 and
change of the price next to the price of the product. If user press 010 then product 3 will
be issued following the same procedure, if user press 011 then product 4 will be issued, ,
if user press 100 then product 5 will be issued, , if user press 101 then product 6 will be
issued, if user press 110 then product 7 will be issued and if user press 111 then product 8
will be issued. The prices of LEDs are fixed using different combination of binary adder.
Equipment used:
AND Gate IC
OR Gate IC
NOT Gate IC
Encoder
Bread Board
Wires
XOR Gate IC
7447
7 Segment
Voltage source for display
Decoder
Proteus
Working of Components:
● AND GATE IC:
An AND logic gate IC like 74LS08 includes 4 AND logic gates where each
gate is used separately without changing other gates so it is called
QUADRUPLE two-input AND logic gates. This IC works with a single power
supply but it is available in several packages based on the circuit requirement.
● 74LS08 AND Gate IC
● The series of this IC is 74XXYY IC series where the logic gates within
this IC is designed through Schottky transistors for logic operations with high
speed. The output of this IC comes always in TTL so that it simply works with
other microcontrollers & TTL devices. The size of this 74LS08 IC is smaller &
has very speed performance which makes it consistent in each type of device.
Pin configuration
NOT GATE IC
NOT gate is a digital logic gate, designed for arithmetic and logical operations, every
electronic student must have studied this gate is his/her career. This gate is mainly used in
applications where there is a need for mathematical calculations. So in calculators,
computers and many digital applications use this gate.NOT gates are simply inverters.
They simply invert the input logic for the output. Here we are going to use 74LS04
IC for demonstration. This IC has 6 NOT gates in it. These SIX gate are connected
internally as shown in below figure.
These gates have limitations for working voltage and input logic frequency. When these
limitations are not considered the IC may be damaged permanently, so one should pay
attention while selecting the logic gates.
XOR GATE IC:
The xor gate is a logic gate that outputs high if its two inputs are not equal. so
if one of the inputs (both not both!) is high, the output will be high. OR or EX-
OR gate is a digital logic gate, designed for arithmetic and logical operations, Every
electronic student must have studied this gate is his/her career. This gate is mainly used in
applications where there is a need for mathematical calculations. So in calculators,
computers and many digital applications use this gate.
Here we are going to use 74LS86 IC for demonstration, this chip has 4 EX-OR gates in
it. These four gate are connected internally as shown in below figure
● Bread Board: A Breadboard is simply a board for prototyping or building circuits on. It
allows you to place components and connections on the board to make circuits without
soldering. The holes in the breadboard take care of your connections by physically
holding onto parts or wires where you put them and electrically connecting them inside
the board. The ease of use and speed are great for learning and quick prototyping of
simple circuits. More complex circuits and high frequency circuits are less suited to
breadboarding. Breadboard circuits are also not ideal for long term use like circuits built
on perfboard (protoboard) or PCB (printed circuit board), but they also don’t have the
soldering (protoboard), or design and manufacturing costs (PCBs).
Fig.2 Bread Board
● Jumper wire: jumper wires are indispensable tools for electronics enthusiasts, engineers,
and students engaged in circuit prototyping and experimentation. They offer a convenient
and flexible means of establishing temporary connections within a circuit, facilitating the
development and testing of electronic designs.
Fig.3: JUmper wires
● Full subtractor (IC = 7483 An electronic logic circuit for calculating the difference
between two binary numbers, the minuend and the number to be subtracted, the
subtrahend (see table). A full subtractor performs this calculation with three
inputs: minuend bit, subtrahend bit, and borrow bit. It produces two outputs: the
difference and the borrow. Full subtractors thus allow for the inclusion of borrows
generated by previous stages of subtraction when forming their output signals, and
can be cascaded to form n-bit subtractors. Alternatively the subtract operation can
be performed using two half subtractors, which are simpler since they contain
onlytwo inputs and produce two outputs..
,
●Decoder IC: The combinational circuit that change the binary information into 2 N output
lines is known as Decoders. The binary information is passed in the form of N input lines. The
output lines define the 2N-bit code for the binary information. In simple words,
the Decoder performs the reverse operation of the Encoder. At a time, only one input line is
activated for simplicity. The produced 2N-bit output code is equivalent to the binary information.
●7Segment Dsiplay:
The emission of photons from a 7-segment display occurs when the diode junction of
each segment is forward biased by an external voltage allowing current to flow across
its junction, and in Electronics we call this process electroluminescence.
The actual colour of the visible light emitted by an LED, ranging from blue to red to
orange, is decided by the spectral wavelength of the emitted light which itself is
dependent upon the mixture of the various impurities added to the semiconductor
materials used to produce it.
PERFORMANCE:
The coffee and tea vending machine leverages logical gates, particularly AND gates, OR gates,
and XOR gates, along with a subtractor for managing user balances. The intricate operation of
the machine involves the strategic use of these gates to process user inputs and facilitate the
delivery of the chosen beverage. Below is a detailed breakdown of the machine's functionality:
1. 1. Input Processing: Logical gates, including AND, OR, and XOR gates, are instrumental in
processing user inputs. Specifically, two AND gates are strategically utilized to discern the
presence of a coin and the selection of a product (either tea or coffee). An XOR gate serves the
purpose of ensuring an exclusive product selection, preventing simultaneous choices of both tea
and coffee.
2. Product Selection: Upon the insertion of a coin and the selection of a product, the machine's
output is determined by the configured logical gates. For instance, if the machine identifies the
presence of a coin and the activation of the tea button, it initiates the tea output.
3. Subtraction Process: To manage payments and balances, a subtractor is brought into play.
The subtractor takes the coin value as the minuend and the product cost as the subtrahend. The
result of this subtraction signifies the remaining balance, a critical parameter that is then
communicated to the user.
4. Output Generation: Based on the outputs from the logical gates, the machine activates the
necessary components for preparing the selected beverage. For instance, if tea is chosen, the tea
preparation mechanism is set into motion, and the subtractor adjusts the balance accordingly.
5. User Interaction: The machine ensures user engagement by providing clear feedback on
product selection and displaying the remaining balance. This feedback is typically visual, with
features like LED displays showcasing the selected product and the remaining amount. This
intricate system showcases the synergy of logical gates and subtractors, harmoniously working
together to process inputs, manage balances, and deliver a user-friendly experience in the realm
of coffee and tea vending.
In summary, the Coffee and Tea Machine uses a combination of AND gates, OR gates, and XOR
gates to process user inputs and determine the selected product. A subtractor is employed to
handle the financial transaction, subtracting the product cost from the inserted coin value and
displaying the remaining balance. This logical configuration ensures a streamlined and
responsive operation of the vending machine while effectively managing user interactions and
financial transactions.
Simulation
Block M Finite State
Diagram o Machine
1.
State Table
Present State Input Next State Outpu
t
Q Q N D DA DB C’
A B
0 0 0 0 0 0 0
0 0 0 1 1 0 0
0 0 1 0 0 1 0
0 0 1 1 X X 0
0 1 0 0 0 1 0
0 1 0 1 1 1 0
0 1 1 0 1 0 0
0 1 1 1 X X 0
1 0 0 0 1 0 0
1 0 0 1 1 1 0
1 0 1 0 1 1 0
1 0 1 1 X X 0
1 1 0 0 1 1 1
1 1 0 1 1 1 1
1 1 1 0 1 1 1
LOGIC DIAGRAM:
Fig.gic diagramof coffeeandtea
Fig. Proteus simulation of coffee and tea machine
PROTEUS
SIMULATION
Proteus Simulation:
FUll SUBTRACTOR:
INPUT OUTPUT
A B C Difference Borrow
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
Fig. Truth table of full subtractor
\
Summary
The "Vending Machine Logic Circuit" project aims to design and implement a digital logic
circuit for a vending machine. The primary objective is to create an efficient and reliable system
that accepts user input, processes the selection, and dispenses the requested product while
ensuring proper handling of currency.
Key Components and Features:
User Interface: The vending machine is equipped with a user-friendly interface, allowing
customers to make selections easily. The interface includes input mechanisms, such as buttons or
a keypad, to choose the desired product.
Currency Handling: The logic circuit incorporates a currency validation and processing system.
It accepts various denominations of currency, verifies their authenticity, and calculates the total
amount inserted by the user.
Product Dispensing Mechanism: Upon successful selection and payment, the logic circuit
activates the dispensing mechanism. This mechanism ensures that the correct product is released
to the user while maintaining inventory accuracy.
Change Return System: The vending machine logic circuit is designed to handle situations
where the user inserts more money than required. It calculates the change due and returns it
efficiently, using a combination of coins.
Security Measures: The circuit implements security features to prevent unauthorized access,
tampering, or fraudulent activities. This includes encryption of communication channels and
secure storage of transaction data.
Implementation Approach:
The project utilizes digital logic components such as microcontrollers, sensors, actuators, and
display units. The software aspect involves programming the microcontroller to manage the
overall functionality, including user interaction, currency processing, and inventory
management.
Challenges and Solutions:
During the development of the vending machine logic circuit, challenges were encountered in
ensuring real-time responsiveness, preventing currency counterfeit attempts, and optimizing
power consumption. These challenges were ad