Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Vending machines now almost run without any human maintenance. They employ the internet of things (IoT) enabling real-time updates on stock levels, payments, and alerts

Vending machines now almost run without any human maintenance. They employ the "internet of things" (IoT) enabling real-time updates on stock levels, payments, and alerts for machine maintenance. Electronic payments use both swipe and "tap" technology for debit and credit cards and even accept cell phone payments using "near field communications" (NFC). No physical money is stored! Maintenance costs are drastically reduced with these enhancements over the older models as routine inventory and money pickups are eliminated. The only time a service provider needs to physically visit the machine, is for restocking inventory and addressing any general mechanical maintenance (which would be infrequent). But how should this all work?

Applications of vending machines essentially have two major logical components to define: 1. Hardware States (physical interface)

2. Software Logic (main functional logic/controller) States Hardware states are triggered by the software layer that implement the overall system process.

The system has at least 6 main states (or modes): 1. Power-On

2. Power-Off

3. Idle/Ready (stand-by: waiting for customer)

4. Active (customer interaction building an order)

5. Payment (final step in customer transaction)

6. Cancel (cancels the session at any time during states 4&5)

For each of these states, both the hardware and software components will have their own set of defined processes.

Data Structures Use the following data structures in your solution: Product

slotID // Unique location slot ID (physical placement in the machine ex: "D8")

sku // Unique product identifier

quantity // Actual quantity available (physically in machine at the given slotID)

maxQuantity // Maximum machine qty that can be stocked for the slotID

minQuantity // Re-order when this qty is reached (based on: maxQuantity - quantity)

price // Vending machine price to charge customer per unit

description // Product name

Note: The term "Inventory" is simply a collection/array of Product data

Transaction slotID // Unique location slot ID (physical placement in the machine ex: "D8")

quantity // Requested quantity

price // Price per single unit quantity

description // Product name

Note: The term "Session" is simply a collection/array of Transaction data

[Logic 1] Hardware States & Software Idle State

o Hardware components have only two possible states: "enabled" or "disabled"

o As the machine changes from one state to another, the various hardware components need to be initialized to the new state and should be set to complement the initial state of the software logic (example: disable controls that don't apply to the current state and only enable those that should be)

o The software logic will modify/change the hardware components as needed after the initialization of the hardware is set to the new state

o For each vending machine state, create the necessary initial hardware settings ? Define each hardware component's state (enabled or disabled) ? Each hardware component should be described in its own step/process ? You should have 4-sub-processes in total (one for each vending machine state)

Hint: The software logic layer will "call" the hardware processes when initializing to a new state o The software idle state essentially waits until it is activated by a customer (be creative on what the machine can be doing during the idle state!)

Draw flowchart solution to the logic

image text in transcribed
Payment Module Vending Machine LCD Display Screen LED - Screen (NOT touch Be Creative Ar To What Should Be Shown Here! B D E 3 4 5 Enter Buttons Column/ Row 8 9 10 Command Buttons Co Cancel pay erface Payment Module: Physical hardware for reading credit cards, debit, NFC, Tap etc. LCD Colour Screen: 10" wide x 6" high (10 cm X 15 cm) Column/Row buttons: Column-letter buttons (A-E), row-number buttons (1 - 10) "Enter" button: Adds a product selection to the session (transaction), or applies entered quantity "Correct" button: Used to backspace an entry/quantity, NOT remove an already added item Cancel" button; Cancels the entire session and resets "Pay" button: Triggers the payment process and finalizes the session Page

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions