23N503 – EMBEDDED SYSTEMS
BACHELOR OF ENGINEERING
Branch: COMPUTER SCIENCE AND ENGINEERING
(ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING)
Applied Case Study on Smart Beverage Vending Machine
Academic Year: 2025 – 2026
………………….. ……..…………………
Dr. S. Sivaranjani Dr. G. Sudha Sadasivam
F Faculty In-charge Head of the Department
PSG COLLEGE OF TECHNOLOGY
(Autonomous Institution)
COIMBATORE - 641 004
23N503 – EMBEDDED SYSTEMS
TOPIC: Smart Beverage Vending Machine
Team Members:
[Link] ROLL NO NAME
1 23N206 Adhish Krishna S
2 23N218 Udhayakanth G
3 23N228 Mohana Kumar P
4 23N244 Sanjay J
5 23N247 Sanjeev M
6 23N252 Siva Selvan S
7 23N256 Surya Narayanaa N T
8 23N257 Surya Prakash B
9 23N266 Yeshwanth
10 24N433 Niranjan C
11 24N435 Saran M
Abstract
This project presents the design and implementation of a Smart Beverage Vending Machine
using an Arduino UNO microcontroller. The system automates the process of displaying available
drinks, accepting user selections through a 4x4 keypad, simulating payment via a PIR sensor, and
dispensing beverages using servo motors. A 16x2 LCD provides real-time user feedback, while
an LED indicator signals active dispensing. The system’s operation is managed through a Finite
State Machine (FSM), ensuring smooth transitions between states such as idle, payment,
confirmation, dispensing, and reset. Developed and tested using Arduino IDE and Tinkercad,
the project demonstrates how embedded systems can integrate sensors, actuators, and user
interfaces to create an efficient, reliable, and user-friendly automated vending solution.
Introduction
In today’s world, automation plays a vital role in improving convenience, efficiency, and accuracy
in everyday tasks. One such application is the Smart Beverage Vending Machine, an embedded
system designed to automate the process of selecting and dispensing beverages without human
supervision. This system integrates sensors, actuators, and a microcontroller to deliver an
intelligent, interactive, and reliable service.
The project demonstrates how an Arduino UNO microcontroller can coordinate multiple
components — including a 4x4 matrix keypad for user input, a 16x2 LCD for visual feedback, a
PIR sensor for payment simulation, and servo motors for dispensing beverages. A Finite State
Machine (FSM) controls the logical flow of operations, ensuring that each step — from item
selection to payment and dispensing — occurs in the correct sequence.
By simulating a real-world vending machine, this project highlights the fundamental principles of
embedded system design, such as real-time control, sensor interfacing, and user interaction. It also
shows how low-cost hardware and open-source software can be combined to create practical
automation solutions for learning and real-world applications.
Objectives of the Case Study:
● To design and develop an embedded control system for an autonomous beverage vending
machine using Arduino UNO.
● To implement a Finite State Machine (FSM) for managing operational states such as Idle,
Payment, Confirmation, Dispensing, and Reset.
● To simulate real-world vending functions like payment detection and item dispensing
using sensors and servo motors.
● To create a user-friendly interface through the integration of a 16x2 LCD and a 4x4
matrix keypad.
● To test and validate the system through simulation (Tinkercad) and hardware
implementation, ensuring reliable and accurate performance
System Overview
Block diagram of the proposed/actual system
Description of each functional block
1. Central Control Unit (CCU)
● Components: U1: Arduino UNO
● Function: This is the brain of the entire vending machine. It is a microcontroller that runs
the complete software logic (your Arduino code). Its primary role is to coordinate all other
blocks by continuously reading data from the Input Blocks (Keypad, PIR Sensor) and
sending commands to the Output Blocks (LCD, Servos, LED) based on the program's
current state
2. User Input Block
● Components: KEYPAD1: 4x4 Matrix Keypad
● Function: This block is the primary user interface for control. It allows the user to send
commands to the Central Control Unit. In your project, it's used to select a beverage (keys
'1'-'6'), confirm a purchase (key '0'), cancel a transaction (key '*'), and run the diagnostic
servo test (key '0' in the idle state).
3. Visual Feedback Block
● Components: U2: 16x2 LCD, RPOT1: Potentiometer, R1: Resistor
● Function: This output block is the main channel of communication to the user. The
LCD (U2) displays all necessary information, such as the scrolling menu, item prices, coin
count, and status messages (e.g., "DISPENSING..."). The potentiometer (RPOT1) and
resistor (R1) are support components: RPOT1 adjusts the screen's contrast for readability,
and R1 protects the LCD's backlight.
4. Payment Simulation Block
● Components: PIR1: PIR Sensor
● Function: This input block's purpose is to simulate a coin acceptor. Instead of a complex
coin validator, this prototype cleverly uses a PIR (Passive Infrared) sensor. When the user
waves their hand, the sensor sends a HIGH signal to the Arduino, which the code interprets
as a "Coin Detected" event.
5. Dispensing Mechanism Block
● Components: SERVOITEM1, SERVOITEM2 (Servo Motors)
● Function: This is the mechanical output block that performs the physical action of
vending an item. These are the "muscles" of the machine. When a purchase is confirmed,
the Control Unit sends a specific pulse-width signal (PWM) to the correct servo,
commanding it to rotate 90 degrees to dispense the product and then return to 0 degrees.
6. Status Indicator Block
● Components: D2: Green LED, R2: Resistor
● Function: This is a simple visual status indicator. Its sole purpose is to provide a clear,
secondary signal to the user. The Control Unit is programmed to turn this LED ON only
during the dispensing state, giving the user a clear visual confirmation that the machine is
actively working on their request. The resistor (R2) protects the LED from overcurrent
Explanation of Signal/Data Flow
The flow can be understood by following a single transaction:
1. Idle State (System Ready)
● Flow: CCU -> HMI (LCD)
● Signal: The CCU is in STATE_IDLE. It continuously sends text data (e.g., "1-COLA", "2-
JUICE") over its digital pins (A0-A5) to the HMI/Display Module. The LCD simply
displays whatever text it receives.
2. Item Selection
● Flow: User Interface (Keypad) -> CCU
● Signal: A user presses a key (e.g., '2'). The Keypad Module's internal matrix completes a
circuit. The CCU, which is actively "scanning" the keypad's rows and columns (via pins
D2-D9), detects this keypress. The [Link]() function returns the character '2' to the
CCU's software.
● Response Flow: CCU -> HMI (LCD)
● Signal: The CCU's FSM (Finite State Machine) logic receives the '2', identifies it as
"JUICE", and transitions to STATE_WAITING_FOR_COINS. It then sends new text data
(e.g., "JUICE Price: 3") to the LCD.
3. Payment (Simulation)
● Flow: Payment Module (PIR Sensor) -> CCU
● Signal: The user waves their hand, triggering the PIR sensor. The sensor's 'OUT' pin sends
a digital HIGH (5V) signal to the CCU's pin D13.
● Response Flow: CCU -> HMI (LCD)
● Signal: The CCU's code detects this signal, increments the coinsInserted variable, and
sends updated text data ("Coin Detected! 1 of 3") to the LCD. This flow repeats for each
"coin" (hand wave).
4. Purchase Confirmation
● Flow: CCU -> HMI (LCD)
● Signal: Once the coin count is met, the CCU's FSM transitions to
STATE_WAITING_FOR_CONFIRMATION and sends the text data "Press 0 to buy" to
the LCD.
● Flow: User Interface (Keypad) -> CCU
● Signal: The user presses '0'. The keypad sends this '0' character to the CCU. The CCU's
logic validates this as the "confirm" command and transitions to STATE_DISPENSING.
5. Dispensing
● Flow (Simultaneous):
1. CCU -> HMI (LCD): Sends text data ("TRANSACTION COMPLETED", then
"DISPENSING...").
2. CCU -> Status Indicator (LED): Sends a digital HIGH (5V) signal to pin D12,
turning the green LED on.
3. CCU -> Dispensing Module (Servo): This is the most complex signal. The CCU
sends a series of Pulse Width Modulation (PWM) signals to the correct servo
(e.g., servo_2 on pin D11). The width of these pulses precisely commands the servo
to rotate from 0 to 90 degrees, pause, and then rotate back to 0.
6. Return to Idle
● Flow (Simultaneous):
1. CCU -> Status Indicator (LED): Sends a digital LOW (0V) signal to pin D12,
turning the LED off.
2. CCU -> HMI (LCD): Sends text data ("THANK YOU..."), waits, and then clears
the screen.
● Final Flow: The CCU's FSM transitions back to STATE_IDLE, and the flow restarts from
Step 1, with the CCU sending the scrolling menu data to the LCD.
Hardware Description
List and describe all major hardware components:
U1: Arduino UNO (Microcontroller)
● Component Type: Microcontroller Unit (MCU) / Central Processor.
● Purpose in Project: This is the brain and central nervous system of the entire vending
machine. It runs the C++ (Arduino) code that contains all the logic. Its sole purpose is to
read data from all input devices (Keypad, PIR), make decisions based on that data (using
the Finite State Machine), and then coordinate all output devices (LCD, Servos, LED) to
create a seamless user experience.
● Hardware Interaction: The Arduino is the central hub. All other electronic components
are wired to its Input/Output (I/O) pins. It also provides the 5V and GND power rails that
supply electricity to all the other modules on the breadboard.
● Software Interaction: The setup() function in your code runs once on the Arduino to
initialize all the pins and libraries. After that, the loop() function runs continuously, acting
as the "heartbeat" of the FSM. It checks the currentState variable and executes the
corresponding function (e.g., runIdleState()) to manage all operations.
U2: LCD 16x2 (Liquid Crystal Display)
● Component Type: Visual Output Module.
● Purpose in Project: This is the primary Human-Machine Interface (HMI). It is crucial
for communicating with the user. In your project, it guides the user through every step of
the transaction, displaying the scrolling menu of 6 drinks, the price of the selected item,
the number of coins inserted, and all status messages (e.g., "Press 0 to buy,"
"DISPENSING...").
● Hardware Interaction: It is a 16-character by 2-row display. In your diagram, it is wired
in 4-bit mode (using data pins DB4-DB7) to save I/O pins on the Arduino. These data and
control pins (RS, E) are all connected to the Arduino's analog pins A0 through A5, which
are being used as digital I/O pins.
● Software Interaction: The LiquidCrystal.h library (initialized with LiquidCrystal lcd(A0,
A1, A2, A3, A4, A5);) handles the complex communication. Your code uses simple
commands like [Link]() and [Link]() to display information at different stages of the
FSM.
KEYPAD1: 4x4 Matrix Keypad
● Component Type: User Input Module.
● Purpose in Project: This is the user's main control panel. It allows them to input
commands and make selections. Your code uses it for multiple functions:
1. Item Selection: Keys '1' - '6' select a beverage.
2. Test/Bypass: Key '0' is used to run the servo test, bypass payment, or confirm a
purchase.
3. Cancel: Key '*' is used to cancel a transaction.
● Hardware Interaction: This module saves a huge number of pins. Instead of 16 wires
(one for each key), it uses a 4x4 matrix, requiring only 8 pins (4 for rows, 4 for columns).
Your diagram shows these 8 pins connected to Arduino's digital pins D2 through D9.
● Software Interaction: The Keypad.h library performs matrix scanning—it sends a signal
down one row and "listens" on the four column pins to see which key is pressed. Your code
reads this with [Link]() once per loop, ensuring no keypresses are missed.
SERVOITEM1 & SERVOITEM2: Servo Motors
● Component Type: Mechanical Actuator (Output).
● Purpose in Project: These are the "muscles" of the machine that perform the physical
action of dispensing a product. When a purchase is confirmed, the correct servo rotates 90
degrees to push an item, and then rotates back to 0 degrees to wait for the next sale.
● Hardware Interaction: These are 3-wire motors. They receive 5V power and Ground
from the main power rails. The third "Signal" wire is connected to a PWM (Pulse Width
Modulation) pin on the Arduino (D10 for Servo 1, D11 for Servo 2). The Arduino sends
a specific pulse width on this signal wire to tell the servo exactly what angle to turn to.
● Software Interaction: The Servo.h library is used. The code (V12) correctly creates two
servo objects (servo_1, servo_2) and attaches them in setup(). The MenuItem struct
cleverly assigns which servo to use for each item. The runDispensingState() function calls
[Link](pos) to sweep the motor.
PIR1: PIR Sensor
Component Type: Input Sensor.
● Purpose in Project: In a final product, this would be a coin acceptor. For this prototype,
you have cleverly used a PIR (Passive Infrared) Sensor as a test substitute. Its purpose
is to simulate a coin being inserted.
● Hardware Interaction: The PIR sensor is a 3-pin device. It's connected to 5V and Ground,
and its "OUT" (signal) pin is connected to digital pin D13. When it detects motion (like a
hand wave), this OUT pin goes HIGH (5V).
● Software Interaction: The code defines PIR_PIN 13. The checkCoinNonBlocking()
function performs a digitalRead(PIR_PIN). This function is specifically written to detect a
rising edge (the moment the pin first goes from LOW to HIGH), which ensures that one
continuous hand wave only counts as a single "coin," making it a very effective simulation.
Peripheral Components (Resistors & LED)
● RPOT1 (250k Potentiometer): This 3-pin variable resistor is connected to the LCD's V0
pin (pin 3). Its sole purpose is to act as a contrast control knob. By turning it, you change
the voltage going to the V0 pin, which makes the text on the LCD darker or lighter,
ensuring it's clearly visible.
● R1 (220 Ohm Resistor): This is the LCD backlight resistor. The LCD's backlight is just
an LED, and this resistor is connected to its Anode (A or LED+) pin. It limits the current
from the 5V supply, preventing the backlight from burning out while keeping it brightly
lit.
● D2 (Green LED) & R2 (500 Ohm Resistor): This is a simple status indicator. The LED
(D2) is connected to pin D12, and the resistor (R2) protects it from drawing too much
current. The code only turns this LED on during the runDispensingState(), giving the user
a clear visual confirmation that the transaction is complete and the item is being vended.
Software Description
● Programming environment:
The system's firmware is developed in C++ using the Arduino platform. The code is
written and compiled using the Arduino IDE (Integrated Development Environment),
which provides the necessary libraries (Keypad.h, LiquidCrystal.h, Servo.h) for
interfacing with the hardware. Autodesk Tinkercad is used as the primary simulation and
testing environment, allowing for rapid prototyping, virtual wiring, and debugging of the
complete system (hardware and software) before deployment to a physical device.
● Flowchart or Algorithm of the system:
The core algorithm of the system is a Finite State Machine (FSM). The machine is always
in one of five defined states. It transitions from one state to another based on specific
inputs (like a keypress or sensor trigger). This model ensures the machine operates in a
stable, predictable, and logical sequence.
Logical Flow:
1. START -> Initialize all hardware (setup()).
2. Enter STATE_IDLE:
• Display the scrolling menu of drinks.
• Listen for a keypress.
• If key '1'-'6' is pressed -> Go to STATE_WAITING_FOR_COINS.
• If key '0' is pressed -> Run the Servo Test, then return to STATE_IDLE.
3. STATE_WAITING_FOR_COINS:
• Wait for PIR sensor trigger or keypress.
• If PIR triggers -> Increment coin count.
• If coins_inserted == price -> Go to
STATE_WAITING_FOR_CONFIRMATION.
• If key '0' (Bypass) is pressed -> Go to STATE_DISPENSING.
• If key '*' (Cancel) is pressed -> Go to STATE_IDLE.
4. STATE_WAITING_FOR_CONFIRMATION:
• Display "Press 0 to buy."
• If key '0' (Confirm) is pressed -> Go to STATE_DISPENSING.
• If key '*' (Cancel) is pressed -> Go to STATE_IDLE.
5. STATE_DISPENSING:
• Show "DISPENSING..." message.
• Turn ON the LED.
• Rotate the correct servo 90 degrees and back.
• Turn OFF the LED.
• Go to STATE_THANK_YOU.
6. STATE_THANK_YOU:
• Show "THANK YOU..." message.
• Go to STATE_IDLE.
● Pseudocode or brief explanation of main program logic:
The main logic is managed by a switch statement inside the loop() function, which acts as
the FSM's "engine." A global variable, currentState, tracks the machine's current state. The
loop() first reads the keypad once to get a global key variable. Then, the switch statement
checks currentState and executes only the function corresponding to that state (e.g.,
runIdleState()). This prevents logic from different states from interfering and ensures new
inputs are only handled by the currently active state.
● Communication or control protocol used:
No single communication bus is used. Instead, the system uses several different protocols
to control its peripherals:
1. 4-bit Parallel Communication: Used to send data and commands to the LCD
screen. This involves using 6 pins (4 data pins, RS, and E) to write text and control
the display.
2. Keypad Matrix Scanning: The software uses this protocol to read the 4x4 keypad.
It sends a signal down one row pin and "listens" on the four column pins to detect
a keypress, minimizing the number of I/O pins required.
3. Pulse Width Modulation (PWM): This is the control protocol used for the servo
motors. The Arduino sends a digital pulse of a specific width (e.g., 1ms to 2ms) to
the servo's signal pin, which the servo interprets as a specific angle (e.g., 0 to 90
degrees).
4. Digital I/O: This is the simplest protocol, used for the PIR sensor (for input) and
the LED (for output). The code simply reads a HIGH (5V) or LOW (0V) signal
from the sensor and writes a HIGH or LOW signal to the LED.
Working Principle
Step-by-Step Explanation of How the System Operates
The system operates based on a Finite State Machine (FSM), which is a software model that
ensures the machine is always in one of five distinct states: IDLE, WAITING_FOR_COINS,
WAITING_FOR_CONFIRMATION, DISPENSING, or THANK_YOU.
1. Power On & Idle State (STATE_IDLE)
When the Arduino is powered on, the setup() function runs once. It initializes the LCD,
attaches the servo motors to their pins (10 and 11), and sets their position to 0 degrees.
The system then enters the main loop() and defaults to STATE_IDLE. In this state, the
LCD displays a scrolling menu of the 6 available drinks, and the software continuously
scans the keypad for an input.
2. Item Selection
When a user presses a valid item key (e.g., '1' for "COLA"), the software detects this
keypress. It immediately stops the scrolling menu, stores the "COLA" item's data (price
and servo) in a global variable, and transitions to the STATE_WAITING_FOR_COINS.
3. Payment Process (STATE_WAITING_FOR_COINS)
The LCD now displays the item's price (e.g., "Price: 2 coins"). The system waits for two
types of input: a "coin" (from the PIR sensor) or a "key" (from the keypad).
1. Coin Input: When the user waves their hand, the PIR sensor sends a signal. The
software detects this, increments a coinsInserted counter, and updates the LCD
(e.g., "Coin Detected! 1 of 2").
2. Bypass (Test): If the user presses '0' during this state, the software interprets it as
a test bypass, skips the payment, and jumps directly to STATE_DISPENSING.
3. Cancel: If the user presses '*', the transaction is canceled, and the system returns to
STATE_IDLE.
4. Purchase Confirmation (STATE_WAITING_FOR_CONFIRMATION)
Once the coinsInserted count equals the item's price, the system transitions to this state.
The LCD displays "Press 0 to buy." The machine now waits for the user to either confirm
the purchase with '0' or cancel with '*'.
5. Dispensing Item (STATE_DISPENSING)
Upon receiving the '0' confirmation, the system enters the dispensing state. This state
executes a sequence of hardware actions:
1. The LCD displays "TRANSACTION COMPLETED" briefly, followed by
"DISPENSING..."
2. The green LED on pin 12 is turned ON.
3. The software commands the correct servo (e.g., servo_1 for COLA) to rotate 90
degrees, pausing briefly to allow the item to drop.
4. The servo is commanded to return to 0 degrees.
5. The green LED is turned OFF.
The system then automatically transitions to STATE_THANK_YOU.
6. Transaction End (STATE_THANK_YOU)
The LCD displays "THANK YOU FOR PURCHASING!" for 1.5 seconds. After the
delay, the system automatically transitions back to STATE_IDLE, restarting the entire
process by showing the scrolling menu for the next customer.
How Data is Collected, Processed, and Output Generated:
This system follows a classic Input -> Process -> Output (IPO) model, all managed by the
Central Control Unit (Arduino).
● Data Collection (Input):
Data is collected from two hardware sources. First, the Keypad Module is continuously
"scanned" by the Keypad.h library. When a key is pressed, a character (e.g., '1' or '0') is
collected and stored in a global key variable. Second, the PIR Sensor Module's signal pin
(D13) is continuously monitored using digitalRead(). The software collects "coin" data
by watching for this pin's voltage to change from LOW to HIGH (a rising edge).
● Data Processing:
Processing occurs within the Arduino's main loop. The Finite State Machine (FSM) is the
core processor.
1. When a key is collected, the FSM checks it. If in STATE_IDLE, it compares the
key to the MenuItem list to find a match. If in STATE_WAITING_FOR_COINS,
it checks if the key is '0' (bypass) or '*' (cancel).
2. When a "coin" signal is collected, the FSM increments the coinsInserted integer
variable.
3. The FSM's main processing job is comparison. It constantly compares
coinsInserted to the selected item's price.
4. The result of all this processing is a change to the currentState variable, which
dictates the next machine action.
● Output Generation:
Outputs are generated as a direct result of processing.
1. LCD Output: When the state changes, the software generates text output by calling
[Link](). This sends a 4-bit parallel signal to the LCD to display the appropriate
message.
2. Servo Output: In the DISPENSING state, the software generates a Pulse Width
Modulation (PWM) signal via the [Link]() command. This precise electrical
pulse is the "data" that tells the servo motor the exact angle to rotate.
3. LED Output: The software generates a simple digital output by calling
digitalWrite(LED_PIN, HIGH). This sends a 5V signal to the LED, causing it to
light up.
Interaction Between Hardware and Software
The hardware (the physical components) and the software (the Arduino sketch) are completely
codependent and interact in a continuous loop.
● The software acts as the "director," and the hardware acts as the "actor." The hardware
does nothing without a command from the software.
● Software libraries are the translators. The software sketch uses high-level, simple
commands like [Link]("COLA"). The LiquidCrystal.h library (software) translates this
into the complex sequence of 4-bit parallel electrical signals that the LCD hardware
understands. Similarly, the Servo.h library translates the simple command [Link](90)
into the precise PWM pulse the servo motor hardware requires.
● The Finite State Machine (FSM) in the software is what enforces the correct sequence of
hardware interactions. It ensures hardware inputs are read before hardware outputs are
triggered. For example, the software prevents the [Link]() command (a hardware
action) from ever being called until the digitalRead() from the PIR sensor (a hardware
input) has been processed the correct number of times. This hardware-software link is what
makes the system "smart" and ensures a user cannot get an item without first providing the
correct (simulated) payment.
Error and Its Handling:
In the vending machine system, various errors may occur during operation due to hardware faults,
sensor malfunctions, or incorrect user inputs. To ensure safe and reliable functioning, the system
is designed to automatically detect these errors and handle them appropriately without causing
damage or confusion.
1. Input Error:
Occurs when the user presses a wrong or multiple buttons simultaneously.
Handling:
The system ignores invalid inputs using software debouncing and prompts the user to re-enter
the input. No action is taken until valid data is received.
2. Sensor Error:
Occurs when the PIR sensor fails to detect motion or provides false triggers.
Handling:
The controller validates sensor readings through time-based checks. If an error is found, a
“Sensor Error” message is displayed on the LCD until the sensor operates correctly.
3. Motor / Actuator Error:
Occurs when the servo motor fails to rotate or gets jammed during the dispensing process.
Handling:
The controller retries the operation a few times. If the error persists, it stops the dispensing
process, displays a “Motor Error” message, and enters a safe mode.
4. Display Error:
Occurs when the LCD module fails to display messages or becomes unresponsive.
Handling:
The system automatically re-initializes the LCD. If the issue continues, it logs the error and
continues operation in a safe state.
5. Power Error:
Occurs due to sudden power cuts or voltage fluctuations.
Handling:
The system halts all operations safely and returns to the idle state after stable power is restored,
preventing data loss or hardware damage.
Results and Observations
Applications:
The developed embedded vending machine system has a wide range of practical applications in
various domains. Its automation and reliability make it suitable for both academic and commercial
purposes. The following are some of its major applications:
1. Educational Institutions:
Can be installed in schools and colleges to automatically dispense stationery items,
snacks, or beverages to students and staff.
2. Offices and Workplaces:
Used to provide employees with quick access to refreshments or essential items without
human assistance.
3. Hospitals and Health Centers:
Enables contactless and hygienic distribution of medicines, masks, gloves, or sanitizers.
4. Public Places:
Suitable for installation in railway stations, airports, and bus terminals to offer 24×7
service to the public.
5. Industrial Environments:
Can manage the controlled distribution of tools, spare parts, or safety equipment for
workers.
6. Hostels and Canteens:
Automates the process of providing snacks or packaged food to residents efficiently.
7. Retail and Commercial Spaces:
Adaptable for product vending in malls and supermarkets, reducing manpower and
operational cost.
Conclusion
The Smart Beverage Vending Machine successfully demonstrates how embedded systems can be used to
automate everyday tasks through efficient integration of hardware and software components. The system
performed reliably during testing, accurately handling user input via the keypad, simulating coin detection
through the PIR sensor, and dispensing beverages using servo motors. The use of a 16x2 LCD for real-
time display and an LED indicator for dispensing status enhanced the overall user experience. The Finite
State Machine (FSM) architecture ensured smooth and predictable transitions between operational states
— from idle to payment, confirmation, dispensing, and reset — thereby maintaining logical flow and
system stability.
From this project, significant learning outcomes were achieved in areas such as microcontroller
programming, interfacing of sensors and actuators, and the design of state-based control systems. The
practical implementation reinforced theoretical concepts of embedded systems, user interaction design,
and real-time automation.
For future improvements, the system could be enhanced by integrating actual coin or RFID-based
payment modules for real-world operation, expanding the number of beverage options, and including
features such as temperature control or stock monitoring. Additionally, incorporating IoT connectivity
could enable remote monitoring, data analytics, and predictive maintenance, further transforming this
prototype into a fully functional, smart, and scalable vending solution.
References
Books
Banzi, M., & Shiloh, M. (2022). Getting Started with Arduino (4th ed.). Make Community, LLC.
Michaelis, M. (2016). Arduino Cookbook: Recipes to Begin, Expand, and Enhance Your Projects
(3rd ed.). O'Reilly Media, Inc.
Simon, D. E. (1999). An Embedded Software Primer. Addison-Wesley Professional.
Software, Platforms, and Libraries
Arduino. (n.d.-a). Arduino IDE 2.0. Retrieved October 26, 2025, from
[Link]
Arduino. (n.d.-b). Arduino Language Reference. Retrieved October 26, 2025, from
[Link]
Arduino. (n.d.-c). Keypad Library. Arduino Reference. Retrieved October 26, 2025, from
[Link]
Arduino. (n.d.-d). LiquidCrystal Library. Arduino Reference. Retrieved October 26, 2025, from
[Link]
Arduino. (n.d.-e). Servo Library. Arduino Reference. Retrieved October 26, 2025, from
[Link]
Autodesk. (n.d.). Tinkercad. Retrieved October 26, 2025, from [Link]
Hardware Datasheets and Technical Documentation
Arduino. (n.d.-f). Arduino UNO R3. Arduino Store. Retrieved October 26, 2025, from
[Link]
Hitachi. (1998). HD44780U (LCD-II) Dot Matrix Liquid Crystal Display Controller/Driver.
(Datasheet).
Last Minute Engineers. (2023, September 18). Interfacing HC-SR501 PIR Sensor with Arduino.
Retrieved October 26, 2025, from [Link]
tutorial/