The document outlines the components and methodology for a project on a vending machine controlled by sensors and Arduino. It includes chapters on the circuit diagram, components like Arduino, motors, sensors. It describes the coding and flowchart for the procedure to sense the line and select options. The objectives are to create an automated, cost efficient vending machine that can make different coffee decoctions using sensors and artificial intelligence.
2. 1 2
LIST OF FIGURES
1 Connection Circuit Diagram of This Project
. . . . . . . . . . . 1 10
2 Proposed Model Diagram of This Project
. . . . . . . . . . . . 1 11
3 Circuit Diagram of Arduino UNO
. . . . . . . . . . . . . . 1 13
4 Basic Diagram of DC Gear Motor
. . . . . . . . . . . . . . 1 14
5 Basic Diagram of Servo Motor
. . . . . . . . . . . . . . . 1 15
6 Basic Diagram of Motor Driver
. . . . . . . . . . . . . . . 1 16
7 Basic Diagram of US Sensor
. . . . . . . . . . . . . . . 1 17
8 Basic Diagram of IR Sensor
. . . . . . . . . . . . . . . . 1 19
9 Flowchart Diagram of This Project
. . . . . . . . . . . . . . 1 29
3. 1 3
ABBREVIATIONS AND SYMBOLS
Abbreviations Full Form
MCU Micro controller unit
IC Integrated circuit
ICSP In – circuit serial programming
PWM Pulse width modulation
DC Direct current
LED Light emitting diode
IDE Integrated development environment
USB Universal serial bus
AC Alternating current
CNC Computer numerical control
LDR Light Dependent Resistor
IR Infrared
Rx Receiver
TX Transmitter
OP Amp Operational amplifier
4. 1 4
ABSTRACT
In this modern era users can operate these smart devices just
by passing voice instructions .In recent years, vending machines
have grown popularity ,and consumers are gradually accepting
them. These machines are more dependable, accessible and
convenient than traditional methods . The goal of this project is
to create a vending machine for Coffee decoction that can be
controlled using sensors and Arduino. This project’s
contribution aims to create a portable vending machine that
works automatically and delivers it.
5. 1 5
Under the supervision of
DEPARTMENT OF ELECTRICAL ENGINEERING
COLLEGE OF ENGINEERING ROORKEE
ROORKEE –247667 (UTTARAKHAND) INDIA
2023-2024
ACKNOWLDGEMENT
On this great occasion of accomplishment of our project on “Vending Machine”
we would like to express our gratitude to Mrs. Kavita Jaiswal, who has been
supported through the completion of this project.
We would also be thankful to our HOD Mr. Mukul Dixit of COLLEGE OF
ENGEERING ROORKEE for providing all the required facilities in completion of
this project. Finally, as one of the team members, I would like to appreciate all my
group members for their support and coordination, I hope we will achieve more in our
future endeavors.
NAME OF CANDITATE(S) UTU ROLL NO.(S)
EKANSH VERMA 200060108004
ABDUL BASIT 200060108001
SAGAR SAINI 200060108013
SHRESTH TONK 200060108014
TANJEEM ALI 710060108008
6. 1 6
CANDIDATE’S DECLARATION
We hereby declare that the work presented in the project report entitled, “Vending
Machine ” being submitted to the Department of Electrical and Electronics
Engineering of College of Engineering Roorkee, Roorkee affiliated to Veer Madho
Singh Technological University, Dehradun in the partial fulfillment of the
requirement for the award of the degree of Bachelor of Technology (B.Tech.), in
Electrical and Electronics Engineering is an authentic record of our project work
carried out under the guidance of (Mrs. Kavita Jaiswal).
NAME OF CANDITATE(S) UTU ROLL NO.(S)
EKANSH VERMA 200060108004
ABDUL BASIT 200060108001
SAGAR SAINI 200060108013
SHRESTH TONK 200060108014
TANJEEM ALI 710060108008
Date
Place: Roorkee
7. 1 7
GUIDE’S DECLARATION
It is to certify that the Project entitled “Vending Machine” being submitted by us to
the Department of Electrical and Electronics Engineering of College of
Engineering Roorkee, affiliated to Veer Madho Singh Technological University,
Dehradun in the partial fulfillment of the requirement for the award of the degree of
Bachelor of Technology (B.Tech.), in Electrical and Electronics Engineering is a
record of Bonafide project work carried out by him/her under my/ our guidance and
supervision. The matter presented in this project report has not been submitted either in
part or full to any University or Institute for award of any degree.
Project Guide HOD
Mrs. Kavita Jaiswal Mr. Mukul Dixit
8. 1 8
1. INTRODUCTION
In this modern era users can operate these smart devices just by passing voice
instructions .In recent years, vending machines have grown popularity ,and consumers
are gradually accepting them. These machines are more dependable, accessible and
convenient than traditional methods . The goal of this project is to create a vending
machine for Coffee decoction that can be controlled using sensors and Arduino. This
project’s contribution aims to create a portable vending machine that works
automatically and delivers it.
1.1 BACKGROUND
As technology becomes increasingly important in today's world, it is invaluable to not
only learn how to use technology, but also to understand how to create it. Since being
the engineer, one should have sound knowledge of the other discipline. Most of the
projects have limited scope to only specific discipline. This would limit one's
innovation and creativity. This project inspires to make connections across several
disciplines rather than learning topics in isolation as it combines mechanical,
electronic, electrical, and programming skills.
It gives visual grasp of math and science.
It builds logical thinking.
It brings out innovation and creativity.
It enhances problem solving skills.
9. 1 9
1.2 OBJECTIVES
The objectives of the project are:
The Vending Machine is cost efficient.
It is sensor based.
This machine can make a variety of decoction easily
This machine is very much time saving.
Due to Arduino this machine can use artificial intelligence.
1.3 METHODOLOGY
• The logic is derived for the intelligence of the robot. It is programmed and
burn it to the Arduino by using the software Arduino IDE 2.0.0.
• The accuracy and viability of the program and electronic components is tested
in the simulation software (TinkerCad).
• After the successful simulation result it will be implemented in the hardware.
• After the finishing the programming, electrical and electronics part, the stable,
reliable, and flexible mechanical design and fabrication is completed.
• Finally, system is tested and encountered error is omitted.
• A 12v supply is given to Arduino through laptop and for connecting the
further components to Arduino, a 7805 IC is used as a voltage regulator to
step-down 12v supply to 5v supply. As the user selects the type of Decoction
the corresponding relays to make either a mixture or a single ingredient to
make the Decoction
• Whether the Decoction mixture is selected or the Single ingredient is selected,
the water pump starts in every condition as it is necessary to prepare a
Decoction, so it is put outside the loop.
10. 1 10
2. Literature Review
• Vending Machines are automated machines that dispense selling
products such as snacks, beverages, lottery tickets, and etc. It is vital
to save time and reduce human energy. These vending machines are
developed in the way of Non IoT-based and IoT based methods.
These Non IoT based machines are not smart and are not operated
in real-time data, which are functioned when giving cash or card and
inputs (vending things) of the machine. It is controlled by a
microcontroller and distributed the given inputs.
• IoT-based machines are computerized, which have cashless
payment facilities, order facility before going to the vending
machine to order things, and can be identified the location of
machines by the customer. These IoT-based machines are assisted
by suppliers to identify the availability of the stocks. Simulation
software and prototype are used to validate the machines.
• In this review, it is found that most of the vending machines
developed are capable of operating without IoT technology, and
nowadays, vending machine systems are required to implement
using IoT with machine learning, and artificial technologies to
satisfy customer preferences.
11. 1 11
2.1 CIRCUIT DIAGRAM
Fig 2: Connection Circuit Diagram of This Project
12. 1 12
3. COMPONENTS
3.1 ARDUINO UNO
Arduino Uno is a popular microcontroller development board based on 8-bit
ATmega328P microcontroller. Along with ATmega328P MCU IC, it consists other
components such as crystal oscillator, serial communication, voltage regulator, etc. to
support the microcontroller.
Arduino Uno has 14 digital input/output pins (out of which 6 can be used as PWM
outputs), 6 analog input pins, a USB connection, A Power barrel jack, an ICSP header
and a reset button.
Arduino is an open-source electronics Platforms based on easy-to-use hardware and
software boards are able to read inputs light on a sensor a finger on a button and turn
it into an output activating a motor turning on an LED etc. you can tell you're bored
what to do by sending a set of instructions to the microcontroller on the board to do
so. You can use the Arduino programming language based on writing and the Arduino
software IDE based on processing Arduino you know is one type of Arduino board
which is being used for this project.
13. 1 13
The Arduino platform has become quite popular with people just starting out with
electronics and for good reason unlike most previous programmable circuit boards the
Arduino does not need separate piece of hardware called a programmer in order to
load new code onto the board we can simply use a USB cable additionally the
Arduino IDE uses a simplified version of C++ making it easier to learn to program.
Finally, Arduino provides a standard form factor that breaks out the functions of that
microcontroller into a more accessible package.
Fig 3.1: Circuit Diagram of Arduino UNO
14. 1 14
3.2 DC GEAR MOTOR
A gear motor is a specific type of electrical motor that is designed to produce
high torque while maintaining a low horsepower, or low speed, motor output. Gear
motors can be found in many different applications, and are probably used in many
devices in your home. Simply put, a gear motor is any electric motor coupled with a
gear train. Gear motors use either AC or DC power. In most cases, the addition of a
gear box is intended to limit the speed of the motor's shaft, and increase the motor's
ability to output torque.
Basically, Gear is a rotating machine part having cut teeth, which mesh with another
toothed part to transmit torque. Geared devices can change the speed, torque, and
direction of a power source. Types of gears. Short answer: Parallel Axes / Spur Gear,
Helical Gear, Gear Rack, Internal Gear.
Fig 3.2: Basic Diagram of DC Gear Motor
15. 1 15
3.3 SERVO MOTOR
A servo motor is a rotary actuator or linear actuator that allows for precise control of
angular or linear position, velocity, and acceleration. lt consists of a suitable motor
coupled to a sensor for position feedback.
It also requires a sophisticated controller, often a dedicated module designed
specifically for use with servomotors, Servomotors are not a specific class of motor
although the term servomotor is often used to refer to a motor suitable for use in a
closed-loop control system. Servomotors are used in applications such as robotics,
CNC machinery or automated manufacturing.
We have used one servo motor for the robot. The motor is used for the rotating the
ultra-sonic sensor attached with it. For our robot we have used the SG90 model of
servo motor,
Fig 3.3: Basic Diagram of Servo Motor
16. 1 16
3.4 L298 MOTOR DRIVER
The L298N Motor Driver module consists of an L298 Motor Driver IC, 78M05
Voltage Regulator, resistors, capacitor, Power LED, 5V jumper in an integrated
circuit.
78M05 Voltage regulator will be enabled only when the jumper is placed. When the
power supply is less than or equal to 12V, then the internal circuitry will be powered
by the voltage regulator and the 5V pin can be used as an output pin to power the
microcontroller. The jumper should not be placed when the power supply is greater
than 12V and separate 5V should be given through 5V terminal to power the internal
circuitry.
ENA & ENB pins are speed control pins for Motor A and Motor B while IN1& IN2
and IN3 & IN4 are direction control pins for Motor A and Motor B.
L298 Module Features & Specifications
Driver Model: L298N 2A
Driver Chip: Double H Bridge L298N
Motor Supply Voltage (Maximum): 46V
Motor Supply Current (Maximum): 2A
Driver Voltage: 5-35V
Driver Current:2A
Fig 3.4: Basic Diagram of Motor Driver
17. 1 17
3.5 ULTRA SONIC SENSOR
HC-SR04 distance sensor is commonly used with both microcontroller and
microprocessor platforms like Arduino, ARM, PIC, Raspberry Pie etc. The following
guide is universally since it must be followed irrespective of the type of
computational device used.
Power the Sensor using a regulated +5V through the Vcc ad Ground pins of the
sensor. The current consumed by the sensor is less than 15mA and hence can be
directly powered by the on board 5V pins (If available). The Trigger and the Echo
pins are both I/O pins and hence they can be connected to I/O pins of the
microcontroller. To start the measurement, the trigger pin must be made high for 10uS
and then turned off. This action will trigger an ultrasonic wave at frequency of 40Hz
from the transmitter and the receiver will wait for the wave to return. Once the wave
is returned after it getting reflected by any object the Echo pin goes high for a
particular amount of time which will be equal to the time taken for the wave to return
to the sensor.
HC-SR04 Sensor Features
Operating voltage: +5V
Accuracy: 3mm
Measuring angle covered: <15°
Operating Current: <15mA0
Operating Frequency: 40Hz
Fig 3.5: Basic Diagram of US Sensor
18. 1 18
3.6 IR SENSOR
The IR sensor module consists mainly of the IR Transmitter and Receiver, Op-amp,
Variable Resistor (Trimmer pot), output LED along with few resistors.
IR LED Transmitter
IR LED emits light, in the range of Infrared frequency. IR light is invisible to us as its
wavelength (700nm – 1mm) is much higher than the visible light range. IR LEDs
have light emitting angle of approx. 20-60 degree and range of approx. few
centimeters to several feet's, it depends upon the type of IR transmitter and the
manufacturer. Some transmitters have the range in kilometers. IR LED white or
transparent in color, so it can give out amount of maximum light.
Photodiode Receiver
Photodiode acts as the IR receiver as its conducts when light falls on it. Photodiode is
a semiconductor which has a P-N junction, operated in Reverse Bias, means it start
conducting the current in reverse direction when Light falls on it, and the amount of
current flow is proportional to the amount of Light. This property makes it useful for
IR detection. Photodiode looks like a LED, with a black color coating on its outer
side, Black colour absorbs the highest amount of light.
LM358 Op Amp
LM358 is an Operational Amplifier (Op-Amp) is used as voltage comparator in the IR
sensor. the comparator will compare the threshold voltage set using the preset (pin2)
and the photodiode’s series resistor voltage (pin3).
Photodiode’s series resistor voltage drop > Threshold voltage = Op Amp output is
High
Photodiode’s series resistor voltage drop < Threshold voltage = Op Amp output is
Low
When Op Amp's output is high the LED at the Op Amp output terminal turns ON
(Indicating the detection of Object).
19. 1 19
Variable Resistor
The variable resistor used here is a preset. It is used to calibrate the distance range at
which object should be detected.
IR Sensor Module Features
5VDC Operating voltage
I/O pins are 5V and 3.3V compliant
Range: Up to 20cm
Adjustable Sensing range
Built-in Ambient Light Sensor
20mA supply current
Mounting hole
Fig 3.6: Basic Diagram of IR Sensor
20. 1 20
4. PROCEDURE OF SENSING THE LINE
Here the machine follows the two cases:
Case1: Decoction mixture
The water filled cup will be carried under the first ingredient tank with
the help of the Conveyer belt(using two motors). The ultrasonic sensor
goes to HIGH state by detecting the cup within the range of 50 cm
which gives command to the servo motor to open the gate to pour
down the powder as per the delay instructed, after as soon as delay
over the conveyer starts and the cup goes under the next tank by using
same operation as per first ultrasonic sensor done. Completion of this
process till here, this process will be further forwarded to the another
Arduino which handles the mixability of the decoction by going through
delay. By the ending of the delay the decoction further carried to the
exit stage and here the decoction is fully ready to drink.
Case2: Single ingredient decoction
• As like the before process, the boil water comes under the chosen
ingredient’s tank, by the use of ultrasonic sensor the cup is detected
and the conveyer stops and the servo goes to high state for opening
the gate to pour the ingredient into the cup as per the instructed delay,
as soon as the delay gets over the conveyer starts again and then the
cup goes to the next stage for the mixability of the decoction which is
decided by the delay. At the end of delay the conveyer carries the cup
to the exit stage and here decoction is fully ready to drink.
21. 1 21
• 4.1 CODING
#include<Servo.h>
int pump=13;
int pos1=0;
int pos2=0;
Servo myservo1;
Servo myservo2;
int echopin1=3;
int trigpin1=5;
int echopin2=6;
int trigpin2=9;
int echopin3=10;
int trigpin3=11;
long duration1,distance_cm1;
long duration2,distance_cm2;
long duration3,distance_cm3;
int conveyer=2;
bool didMyOneTimeAction=false;
void setup() {
Serial.begin(9600);
pinMode(pump,OUTPUT);
pinMode(trigpin1,OUTPUT);
pinMode(echopin1,INPUT);
pinMode(trigpin2,OUTPUT);
pinMode(echopin2,INPUT);
pinMode(trigpin3,OUTPUT);
26. 1 26
5. CONCLUSION
This Decoction Machine has achieved its aim and objective successfully.
This unit developed to serve the decoction as per requirement(mixture or
single ingredient). It has advantageous features such as cheap price and it’s
small size makes it portable too. This Decoction preparing machine can
make decoction in few seconds. This machine will decrease human efforts
to negligible and even a single person can afford this machine because of
it’s sustainable pricing. A negligible maintenance is required. This unit can
conserve resources by its own through the detection sensors. It can be used
in any organization too as the whole nation suffered from
corona recently.
Criterion Others Our Model
Size Bigger Smaller
Cost 25K-30K 5K-8K
Main Component PLC Arduino
Manufacturing Processed with Chemical Natural and fresh