You are on page 1of 35

VENDING MACHINE

CHAPTER 1: INTRODUCTION
1.1 Background
Vending machine, machine that sales food, drinks etc when coin is inserted, simple
vending machines require that the exact amount of money for a particular item.
The word vending means selling, this word comes from Greek.
Vending machines mainly supply food and are found in hotels, transportation
terminals, and instaurations. An important component of vending machine is the
mechanism that accepts and determines the value of inserted coin. When coins or
tokens are inserted a series of tests determines the dimensions, weight, electric
properties, and magnetic properties of the money, a coin or token that fails any test
is rejected. If the coin or token is accepted, its value is determined from the data
acquired
Through the tests. This is the project on microcontroller based vending machine,
basically the project is divided into three parts, the first part is mechanical part
(coin unit) i.e. used to sense coin. Another part consists of EPROM programming
which is implemented through microcontroller. The display unit display
information, according to that information, microcontroller gives input signal to
the drink output unit. In this project we have tried to design a low cost, accurate
and portable vending machine that cam sale cold drinks automatically. This project
is based on the embedded system also called the smart system. An embedded
system is a special purpose computer system built a large device. It is the hardware
and software that form a component of large system. An expected to function
without human intervention an embedded system is required to meet different
requirement than a general purpose personal computer. Embedded system often
used a slow processor and small memory to minimize the cost.
1.2 Problem Statement

1.3 Objectives
With regards to the popularity of vending machine in global market, the concept of
project is evolved. As per the business trend of our Nepalese Society, Vending
machine is totally a new concept. It is not widely used here. So for enhancement of
technology in our society and for its further application, the project idea has been
designed. Our project can be simply viewed as the machine that vends cold drinks
in cup. Here we have facility of vending two different types of liquids. Generally in
market it is found that products are vend as per the pet bottle but with regard to the
customer desire, this machine helps to dispense as per necessary. It is user friendly
and very simple in operation. Its simplicity within the complexity is its main
feature. Commercially over viewing, the main objective of our project is to launch
new technologys application in the society. The project has vision that this may be
the milestone product of technology in the Nepalese Market.
1.4 Methodology
Project development is not an easy task. It requires thorough study of the various
component and their outcomes. The project is effective only if it can fulfill the
objective that it aim to provide
The project is implemented using various that are organized in a specific way so
that the device is small and portable. Each component has a specific function to
perform. Our project is basically divided into three parts: mechanical, electronics
and display unit. This part consists of various components, which are as follows.
Photo-Diode
Voltage regulator (7805)
Microcontroller (AT89s52)
Oscillator
LED
Capacitor
Resistor
LCD
Water-pump
Power MOSFETs
Switch
Connecting wires
The circuit diagram using these components is shown below.

1.4.1 Coin unit


Coin unit consist of coin box, lever, spring and coin slider. Coin slider and spring
holds coin until the lever is pulled. When lever is pulled then coin falls down in a
coin box. Coin unit is constructed in such a way that when coin is entered in a coin
slider, it blocks the light which comes from light source and then photo diode
become high resistance. When lever is pulled, light falls on photo diode which
cause the resistivity of photo diode decreases to low resistance.
1.4.2 Microcontroller
The digital signal and switches are interpreted by the program burn in
microcontroller and is converted to the form understood by LCD. The program is
written based on C-compiler.

1.4.3 Flowchart

1.4.4 LCD (Liquid Crystal Display)


LCD consists of three control lines, resistor select (RS), read/write (R/W) and
enable (E). When RS is low, LCD is in command mode otherwise in data mode.
Similarly, when the R/W is high to low transition, LCD is in write mode otherwise
in read mode. The control bit enable (E) is set high to display the data. Here, RS
(pin4), R/W(pin5) and E(9pin6) are connected to pin number 10,11, and 12 of port
3 of the microcontroller respectively. To implement this logic following algorithm
is considered.
1.4.4.1 For Command Mode
1: Set port for command mode
P3_0 0
2: Set port
P2 val
P3_21
Delay( )
P3_20
3: [Finished]
1.4.4.2 For Data mode
1: Set port for data mode
P3_01
2: Set port
P2 val
P3_2 1
Delay ( )
P3_20
3: [Finished]
1.5 Power Supply
Since microcontroller (AT89S52), LCD operate on 5v dc supply, we have used
7805 regulator and 0.01 microfarad capacitor that generate constant output voltage
+5 volts, output current capability of 100mA. Similarly motor driver required
higher voltage, which is supplied by 12v dc supply, for the purpose we have used
7812 regulator. The regulator is supplied with 8 to 18 volts from a dc source. The
circuit diagram is shown below.

Fig: 1.1 circuit diagram of power supply

5.6 Software Tools Used


To write the program , we have used C compiler. After writing the program it is
tested in a simulator. If the output of the simulator is correct, it is burn on
microcontroller using programmer. The software tools used are:
Compiler: KEIL
Simulator: Proteus
Programmer: ISP
CHAPTER 2: LITERATURE REVIEW
In Todays world of technology only one can move forward if you go with the flow
otherwise you will lag behind. The technical studies in its term has tried and still
trying to make human life more convenient and feasible. In this course, many more
discoveries has been done and many more challenges has been faced and even
more to come. On the contrary, in this race of technology with machineries, we still
doubt that we are using them or they are using us? We have to take in consider this
factor too. Though the world is enhancing in the level of automation, even human
seems to be robots. We, by nature like good results, easy way out, and luxury
though but we just accept it but our issue is whether we have analyzed the product
of technology. In the crowd of mechanization and automation vending machine
also has created a small niche.
The concept has been developed from the 1st century engineer. Hero if Alexandria.
The main objective at that time was to dispense fixed amount of holy water and
then continued its modification journey mostly commercially.
Vending machine is used mostly for food and beverages and applied mostly in
public places. Some if the literature related to it is discussed here by. Many more
articles related to the machine are being published. As per the article published in
wikipedia dated 2/7/2009; various aspects of the commercial issues have been
discussed. How simple concept to the highly commercial innovation can be done?
Doug M.Sanford of Vending times notes that many vendors today do not
remember the urgency with which industry leaders called on their peers to install
coin mechanisms that held the patrons money in escrow until the vend was made;
to post a telephone number that a customer could call to report a failure and request
a refund; to make sure their drivers were cleaning the machine adequately and
replacing burnt-out lamps; and so on and on. More recent innovations include
improved coin and bill validation and the rapid adoption of sense-and-feedback
system to verify that the vend was made.
One of the newest vending innovations is telemetry. According to Michael
Kasavana, National Automatic Merchandising Association Endowed Professor at
The School for Hospitality Business Michigan State University, the advent of
reliable, affordable wireless technology has made telemetry practical and provided
the medium through which cashless payments can be authenticated. This is
important because research shows that 50% of consumers will not make a purchase
from a vending machine if its use exact change only light is on. Machines
equipped with telemetry can transmit sales and inventory data to a route truck in
the parking lot so that the driver knows exactly what products to bring in for
restocking. Or the data can be transmitted to a remote headquarters for use in
scheduling a route stop, detecting component failure or verifying collection
information. Telemetry could be one of the most significant developers in vending
technology since the invention of the bill changer.
Most modern vending machine have been extensively tested and designed to
inhibit theft. Many of these machines are designed essentially as large safes. Every
year, a few people are killed when machines topple over on them, either while
trying to steal from them, or venting frustration on them, especially when a
malfunction causes the machine to fail to dispense the purchased item or the proper
change. An article in the journal of the American Medical Association (11
November 1988, p.2697) documents 15 cases in which men trying to get a can out
of the machine were crushed. Three died the other 12 required hospitalizations for
injuries such as fractures of the skull, toe, ankle, and tibia and pelvis intracerebral
bleeding, knee contusion; and one punctured bladder. The articles states that
because the soft drinks are located in the upper half of the machine (so that they
can fall into the dispensing slot), the center of gravity of the machine is abnormally
high, and the machine will fall after it has been tipped only 20 degrees, a
deceptively small angle. A large, fully loaded soft drink machine can weigh over
400 kg.
In Japan, with a high population density, limited space, a preference for shopping
on foot or by bicycle and low rates of vandalism and petty cry, there seems to be
no limit to what is sold by vending machines. While the majority of machines in
Japan are stocked with drinks, snacks, and cigarettes, one occasionally finds
vending machine selling items such as bottles of liquor, cans of beer, fried food,
underwear, ipods, magazines per capita, with about one machine for every 23
people. So this machine plays vital role in its implementation. As per the
interpretive article published in jreast.co.jp by Kazuhiro Nakamura, research and
development center of JR East Group entitled, Transition ion railway ticket
vending machine. Greater convenience to the passengers. With direct to his words
they have 5000 ticket vending machines installed at present. Since the advent of
the first ticket vending machine in about 1925,they have reached the current genre
of ticket vending machine after a great deal of modifications and improvements.
Looking back on the engineering history, this paper introduces various changes
from the viewpoint of passengers and discusses what ticket vending machines
should be like in the future.
On reviewing these short listed literatures published, we being a technical student
made an Endeavour to make a vending machine as our final year project. The
project seemed to us a complete package of electronically, mechanical and
electrical fields. This is not only a project requirement but also an approach to
build a mile stone in technology in our Nepalese Society.
2.1 Component description:
2.1.1 Microcontroller:
Microcontroller is a programmable single chip that controls the process or a
system. Microcontroller is often referred to as single chip device or single chip
computer that incorporates all the basic components of a personal computer in
much smaller scale. Microcontroller is typically used as embedded controller
where it controllers a part of a larger system such as an appliance, automobile,
scientific instruments or a computer peripheral.
Physically a microcontroller is an integrated circuit with pins along each side. The
pins presented by a microcontroller are used for power, ground, oscillator, input
output ports, interrupted request signals, reset and control. In contrast the pins
exposed by a microprocessor are most often memory bus signals (rather than input
output ports). A microcontroller is not same as a microprocessor. A microprocessor
is a single chip cpu and within other computer systems. A microcontroller is itself
is a single chip computer system.
2.1.1.1 Microcontroller in a system:
Microcontrollers are designed to control other devices. Microcontrollers do not
function in isolation. It can accept input from some devices and provided to other
devices within any given system. For example microcontroller may accept input
from switch and may send output to LED. The microcontroller is often a part of a
larger system for example the switch and led may be part of a compact disc player
in a car stereo system. When a microcontroller becomes a part of larger system, it
is often referred to as an embedded controller because it is embedded within the
larger system.
2.1.1.2 Microcontroller programming:
Any microcontroller system consists of two primary components hardware and
software. The hardware is the actual physical components of the system. The
software is list of instruction that resides inside the hardware. First the hardware is
designed and the software program is written to "control it".
The major consideration in circuit design is how to store program. Instead of using
disc storage, most microcontroller circuit store their program on chip. For small
volume production, EPROM has become the most popular method of program
storage for long period, beside EPROM, other options include EEPROM, ROM,
non volatile or battery backed, RAM, flash EPROM the program memory may be
in the microcontroller chop, or in a separate component to save a program in
EPROM, we must set the EPROMs data and address pins to the appropriate logic
level for each address and apply special programming process sometimes called
burning the EPROM. Exposing the chips quartz window and the circuits beneath it
to ultraviolet energy erases the contents. Some microcontroller contain a one time
programmable, or field programmable, EPROM. This type has no window, so its
contents can not be erased, but of its low cost than a windowed IC, it will be a
good choice when a program is finished and the device is ready for quantity
production. Several techniques are available for programming EPROMs and other
memory chips. With a manual programmer, flip switches can be used to toggle
each bit and program the EPROM byte by byte. This is acceptable for short
programs, but quickly becomes tedious with a program of any length. Computer
control simplifies the job greatly. With an EPROM programmer that connects to a
personnel computer, programs can e written using keyboard, save it to disc if
necessary, and store the program in EPROM with few easy steps. Data sheets for
EPROMs rarely specify the number of erasing and re programming cycles that a
device is guaranteed for, but a typical EPRM should endure 100 erase/ program
cycle and usually many more.
For this project, we have used Atmel's 89S52 flash EPROM. The AT89S52 is a
low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-
system programmable Flash memory. The device is manufactured using Atmels
high-density nonvolatile memory technology and is compatible with the industry-
standard 80C51 instruction set and pin out. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional nonvolatile memory
programmer. By combining a versatile 8-bit CPU with in-system programmable
Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller
which provides a highly-flexible and cost-effective solution to many embedded
control applications. The AT89S52 provides the following standard features: 8K
bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers,
three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full
duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52
is designed with static logic for operation down to zero frequency and supports two
software selectable power saving modes. The Idle Mode stops the CPU while
allowing the RAM, timer/counters, serial port, and interrupt system to continue
functioning. The Power-down mode saves the RAM contents but freezes the
oscillator, disabling all other chip functions until the next interrupt or hardware
reset.
2.1.1.3 Pin Configuration:
Fig: 2.1) AT98s52

2.2.1.4 Pin Description


VCC: Supply voltage.
GND: Ground
Port 0: Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be
used as high-impedance inputs. Port 0 can also be configured to be the multiplexed
low-order address/data bus during accesses to external program and data memory.
In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during
Flash programming and outputs the code bytes during program verification.

Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 1 pins that are externally being pulled low will source current (IIL) because of
the internal pull-ups.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external
count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX),
respectively, as shown in the following table.
Port Pin Alternate Functions
P1.0 T2 (external count input to Timer/Counter 2), clock-out
P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction
control)
P1.5 MOSI (used for In-System Programming)
P1.6 MISO (used for In-System Programming)
P1.7 SCK (used for In-System Programming)

Table: 2.1 Port 1 alternate functions


Port 1 also receives the low-order address bytes during Flash programming and
verification.
Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 2 pins that are externally being pulled low will source current (IIL) because of
the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program
memory and during accesses to external data memory that uses 16-bit addresses
(MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when
emitting 1s. During accesses to external data memory that uses 8-bit addresses
(MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port
2 also receives the high-order address bits and some control signals during Flash
programming and verification.
Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 3 pins that are externally being pulled low will source current (IIL) because of
the pull-ups. Port 3 receives some control signals for Flash programming and
verification. Port 3 also serves the functions of various special features of the
AT89S52, as shown in the following table.

Port Pin Alternate Functions


P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)

Table: 2.2 Port 3 alternate functions


RST: Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to
disable this feature. In the default state of bit DISRTO, the RESET HIGH out
feature is enabled.
ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the low
byte of the address during accesses to external memory. This pin is also the
program pulse input (PROG) during Flash programming. In normal operation,
ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used
for external timing or clocking purposes. Note, however, that one ALE pulse is
skipped during each access to external data memory. If desired, ALE operation can
be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active
only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled
high. Setting the ALE-disable bit has no effect if the microcontroller is in external
execution mode.
PSEN: Program Store Enable (PSEN) is the read strobe to external program
memory.
When the AT89S52 is executing code from external program memory, PSEN is
activated twice each machine cycle, except that two PSEN activations are skipped
during each access to external data memory.
EA/VPP: External Access Enable. EA must be strapped to GND in order to enable
the device to fetch code from external program memory locations starting at
0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be
internally latched on reset. EA should be strapped to VCC for internal program
executions. This pin also receives the 12-volt programming enable voltage (VPP)
during Flash programming.
XTAL1: Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2: Output from the inverting oscillator amplifier.
Fig: 2.2) Block Diagram of AT89s52
3.1.2: Photodiode:
Photodiodes are semiconductor light sensors that generate a current or voltage
when the P-N junction in the semiconductor is illuminated by light. The term
photodiode can be broadly defined to include even solar batteries, but it usually
refers to sensors used to detect the intensity of light. Photodiodes can be classified
by function and construction as follows:
Features:
Excellent linearity with respect to incident light.\
Low noise
Wide spectral response
Mechanically rugged
Compact and lightweight
Long life

3.1.2.1 Principle of operation:


Figure shows a cross section of a photodiode. The p- layer material at the active
surface and the N material at the active surface and the N material at the substrate
form a PN junction which operate3s as a photoelectric converter. The usual P-layer
for a Si photodiode is formed by selective diffusion of boron, to a thickness of
approximately 1 micrometer or less and the neutral region at the junction between
the P- and N- layers is known as the depletion layer. By controlling the thickness
of the outer P-layer, substrate N- layer and bottom N+-response and frequency
response can be controlled. When light strikes a photodiode, the electron within the
crystal structure becomes stimulated. If the light energy is greater than the band
gap energy Eg, the electrons are pulled up into the conduction band, leaving holes
in their place in valance band. (see figure1.2) These electron hole pairs occur
throughout the P-layer, depletion layer and N-layer materials. In the depletion layer
the electric field accelerates these electrons toward the N-layer and the holes
toward the P-layer. F the electron hole pairs generated in the N-layer, the electrons,
along with electrons that have arrived from the P-layer, are left in the N-layer
conduction band. The holes at this time are being diffused through the N-layer up
to the depletion layer while being. In this manner, electron hole pairs which are
generated in proportion to the amount of incident light are collected in the N- and
P-layers. This results in a positive charge in the P- layer and a negative charge in
the N-layer. If an external circuit is connected between the P- and N-layers,
electrons will flow away from the N-layer, and holes will flow away from the P-
layer toward the opposite respective electrons. These electrons and holes
generation a current flow in a semiconductor are called the carriers.
Fig: 2.3) Photodiode cross section

Fig: 2.4)Photodiode P-N junction state

2.1.3:.Power MOSFETs:
A power MOSFETs is a voltage controller device and requires only a small input
current. The switching speed is very high and the switching times are of the order
of nanoseconds. Power MOSFETs are finding increasing application in low power
high frequency converters. MOSFETs do not have the problem of second
breakdown phenomena, as do BJTS. However, MOSFETs have the problem of
electrostatics discharge and required special care in handling. In addition, it is
relatively difficult to protect them under short circuited fault conditions.
Enhancement mosfets:
An n-channel enhancement type mosfet has no physical channel, as shown in
figure below. If Vgs is positive, an induced voltage will attract the electrons from
the P-substrate and accumulate them at the surface beneath the oxide layer. If Vgs
is greater than or equal to a value known as threshold voltage, Vt, a sufficient
number of electron are accumulates to form virtual n channel and the current flows
from the drain to source. The polarities of Vds, Ids and Vgs are reversed for a P-
channel Enhancement type mosfet.

Fig :2.5) N- Channel Enhancement type MOSFETs


Fig : 2.6) Transfer characteristics of N- Channel Enhancement type Mosfets

2.1.4 Liquid Crystal Display:


This section deals with the character-based LCD modules that use the Hitachi
HD44780 ( or compatible) controller chip. These modules are not quite advance as
the largest generation, full size full color, back-lit types used in today's laptop
computer, but far from being " phased out" character- based LCDS are still used
extensively in commercial and industrial equipment, particularly where display
requirements are reasonably simple

3.1.4.1 Shapes and Sizes:


Even limited to character-based modules, there are still a wide Varity of shapes and
sizes available. Line lengths of 8, 16, 20, 24, 32 and 40 characters are all standard,
in one, two and four line versions. Several different liquid crystal technologies exit.
"Super twist types, for examples, offer improved contrast and viewing angle over
the" twisted nematic" types. Some modules are available with backlighting, so that
they can be viewed in dimly lit conditions. The backlighting may be either
"electro-luminescent" requiring a high voltage inverter circuit, or simpler LED
illumination.(5)

3.1.4.2 Connection:
Most LCD modules conform to a standard interface specification. A 14 pins access
is provided having 8 data lines, control lines and 3 power lines. The connections
are laid in one of two common configuration, either two rows of 7 pins, or a single
row of 14 pins. The pin configurations are displayed in figure show below:

Fig 2.7) Pin Configuration of LCD 16*2


Pin No. Name Description
Pin no. 1 VSS Power supply (GND)
Pin no. 2 VCC Power supply (+5V)
Pin no. 3 VEE Contrast adjust
0 = Instruction input
Pin no. 4 RS
1 = Data input
0 = Write to LCD
module
Pin no. 5 R/W
1 = Read from LCD
module
Pin no. 6 EN Enable signal
Pin no. 7 D0 Data bus line 0 (LSB)
Pin no. 8 D1 Data bus line 1
Pin no. 9 D2 Data bus line 2
Pin no. 10 D3 Data bus line 3
Pin no. 11 D4 Data bus line 4
Pin no. 12 D5 Data bus line 5
Pin no. 13 D6 Data bus line 6
Pin no. 14 D7 Data bus line 7 (MSB)

Table:2.3 Pin description of LCD

2.1.4.3 Pins Descriptions:


Pin 1 and 2: Pins 1 and 2 are the power supply lines, Vss and Vdd. The Vdd pin
should be connected to the positive supply and Vss to the 0v supply or ground.
Although the LCD, module data sheets specify a 5v dc supply (at only a few
miliamps) supplies of 6Vm and 4.5 both work well, and even 3v is sufficient for
some modules. Consequently, batteries can effectively and economically power
these modules.
Pin 3: Pin 3 is control pin; Vee is used to alert the contrast of the display. Ideally,
this pin should be connected to a variable voltage supply. A preset potentiometer
connection between the power supply lines, with its wiper connected to the
contrast pin is suitable in many cases, but be aware that some modules may
required a negative potential; as low as 7v in some cases.
Pin 5: Pin 5 is the read/write (r/w) line. This input is used to initiate the actual
transfer of commands or character data to the module, or pulled high to read
character data or status information from its registers.
Pin 6: Pin 6 is the Enable (E) line. This input is used to initiate the actual transfer
of commands or character data between the modules and the data lines. When
writing to the display, data is transferred only on ht high to low transition of this
signal. However, when reading from the display. Data will become available
shortly after the low to high transition and remain available until the signal falls
low again.
Pin 7-14: Pin 7 to 14 is the eight data bus line (D0 to D7). Data can be transferred
to and from the display, either as a single 8- bit "nibbles". In the latter case, only
the upper four data lines (d4 to D7) are used, this 4-bit mode is beneficial when
suing a microcontroller. As fewer input/output lines are required.
2.1.4.4 Basic command:
When power is on, the display shows a series of dark squares possibly only on the
part of display. The character cells are actually in their off state, so the contrast
control should be adjusted anti clockwise until the squares are only just visible.
The display module resets itself to an initial state when power is applied, which
curiously the display has blanked off, so that even if characters are entered, they
cannot be seen. It is therefore necessary to issue a command at this point, to switch
the display on.
A full list of the command s that can be sent is listed in the datasheet, together with
their binary and hexadecimal values. The initial conditions of the LCD after power
on are marked with an asterisk. Here, emphasis is on the binary value being sent
since this illustrates switch data bits set for each command. After each binary
value, the equivalent hexadecimal value is quoted in brackets, indicated by $
prefix. For the details of these basic commands, refer to the appendix (data sheet of
LCD)
Code HEX Command to LCD Instruction Register
1 Clear display screen
2 Return Home
4 Decrement cursor (shift cursor to left)
5 Increment cursor (shift cursor to right)
6 shift display right
7 shift display left
8 Display off, cursor off
A Display off, cursor on
C Display on, cursor off
E Display on, cursor blinking
F Display on, cursor blinking
10 Shift cursor position to left
14 Shift cursor position to right
18 Shift the entire display to the left
1C Shift the entire display to the right
80 force cursor to the beginning of 1st line
C0 Force cursor to the beginning of 2nd line
38 2 lines and 5 x 7 matrix

Table: 2.4 Command Code

2.1.5 BC547
Features:
Low current (max. 100 mA)
Low voltage (max. 65 V).
Application:
General purpose switching and amplification.

Fig: 2.7 Pin configuration of BC547

CHAPTER 3: PROJECT DESCRIPTION


3.1 Block Diagram:
The main objective of the project is to design a vending machine based on
microcontroller. This system works accurately as other vending machine. The
system consists of mainly three parts: first part is mechanical part (coin part),
second part is hardware part whose block diagram is shown below and third part is
software part.

Fig: 3.1 Block Diagram of the system

In the coin unit, IR LED, photodiode and transistor (BC547) is used as input
sensors for microcontroller. When the coin is inserted as an input, the light in
photodiode gets blocked and the output of the photodiode is zero. Then it reverses
biased transistors, which operate the microcontroller.
In the display unit, the main portion is Liquid Crystal Display (LCD). By
interfacing microcontroller with LCD we will display various options for the users
to interpret the machine. And as per the choice displayed and pressed the product is
supplied to the user.
In microcontroller unit, we have used AT89s52. As per the coding done to it, it
operates. When the timer triggers the microcontroller, it operates as per the
instruction stored and hardware gets controlled. Then the LCD displays the
instruction to be followed and proceeds towards the desired output.
In the drink supply unit, the main part is water pump which is controlled by the
motor which is further control by the microcontroller. With the desired
programmed the pump is controlled and the drinks are made to flow as per via
dispenser.
CHAPTER 5: PROBLEM FACED AND LIMITATION
5.1 Problem Faced
During the course of the making of project, we have faced a lot of problems from
various aspects. The main part of our project, for the flow control mechanism is the
solenoid valve. This part is not easily available in the market. Finally, we used a
water pump instead of solenoid valve which is comparably a low price device.
Another important part is in taking input of the coin and processing. The part being
mechanical we faced very serious problem in interfacing with the electronics.
Another problem is the framework design to cope with the electronic parts. Time
limit is also another serious problem that we have deal with due to which we have
to rush and have to compromise in so many fields. Anyway we have tried to do our
best in our context.

5.2 Limitation
The vending machine is commercially completely automatic and no need of
manpower for its operations. In our final product, certain frauds can be done by
using the replica of token (or coin) of the same physical dimension. As per the
desire of customer, we are not able to provide the varying volume of the drinks.
Also we are not able to show clearly source drinks indication.

5.3 Further Improvements


As per the limitations and due to problems we faced, we are not able to carry out
our project to the utmost. For the further improvements, we can do as follows:
v Extend for more drinks, beverages, cigarette, tickets etc.
v Complete automation. (without human effort)
v Improve for varying volume.
v Enhancement by the use of smart cards (ATM, Credit cards, Debit cards)
v Token detection unit can be genuinely advanced.
v Level indication in the source of the supply unit can be installed.
v Entire framework can be made more attractive, feasible and user friendly.

Chapter 4: COST ESTIMATION


The total cost of our project is basically the sum of mechanical, hardware and
software cost. Hardware is the major cost in our project. It accounts for 80 % of the
cost.
The table and table give an idea about the components used in our project along
with their quantity and cost. The extra expenditure required for the necessary
arrangements for the demonstration of the vending machine is not included in the
table.
S.N. COMPONENT UANTITY RATE(Rs.) AMOUNT
NAME
1 Transistors (BC547) 2 35 70
2 Voltage 3 50 150
Regulator(LM7805/12)
3 Zip Socket(40 pins) 1 250 250
4 Microcontroller-IC 1 200 200
AT89S52
5 IR LED(Light Emitting 5 15 75
Diode)
6 Water pump 2
7 Photodiode 2 15 30

8 IC Socket(8pins) 2 50 100
9 Crystal Oscillator- 1 40 40
11MHz
10 LCD(16*2 matrix) 1 525 525
11 Push Button 3 15 30
12 Transformers(6-0-6) 1 180 180
13 Resistor(1K,10K,8.2K) 6 packets 5 30
14 Capacitors(34pF) 2 15 30
15 Capacitors(100F,100 2 Packets 40 80
F,1000F)

16 Connecting wires 2m 8 16
17 Proto Board(small) 1 65 65
18 S-Con 7 10 70
Connectors(2,12)
19 Reset Switch 1 4 4
20 Diode 4007 12 5 60
21 Ribbon Wire 1 25 25
22 Power Supply Cord 1 22 22
23 Rivets 75 0.8 60
24 Aluminum angel(90 2 240 480
degree)
25 Bolt 50 3 150
26 PVC Transparent Sheet 1 100 100
(4x3)
27 PCB board(Big) 2 70 140
28 PCB Board(Small) 2 10 20
TOTAL COST 8102

Table 4.1 Cost Estimation of the project


Conclusion
In the recent time use of digital is increasing day by day due to their accuracy and
feasibility. Since the system operation mainly depends on high level programming,
we can extend the system as our interest and requirements. This system is time
saving, portable, affordable, consumes less power and can be made easily available
so that the user can use this system whenever and wherever.
In the contests of world people are so much busy. They have no time to bargain for
buying anything. Due to the time saving of our vending machine people can use
this device in busy area like Airport, Bank, and Office etc. We can believe that this
system will replace other selling machine and takes market all over the world.

Recommendation for further work


This project is designed to provide high accuracy and cost effectiveness, but
Photodiode is used as sensor of coin. If a user inserts something having same
physical dimension with coin, the system work. If we use weight sensor together,
magnetic sensor and light sensor, this limitation can be improved.
Drink level indicator has not put in this system. Problem may arise when Coke and
Fanta is finished. Hence drink level indicator must insert in this system.

You might also like