Program to simulate a drink-dispensing machine

Assignment Help Other Engineering
Reference no: EM13910397

Assignment : 2014 - 2015

Introduction

Microcontrollers are extensively used in household and industrial appliances. Drink dispensing machines are a typical application where a microcontroller interacts with the customer and prepares a drink according to the order placed. Other additional functions such as automatic price updates and a telephone link with the supplier etc can also be implemented to enhance the operation of these machines. A simplified drink-dispensing machine can be simulated in the laboratory. The PIC16F877A provided on the E-Block development system in the Embedded Systems laboratory is interfaced to a LCD via its PORTB and to 8 pushbutton switches and LEDs via its PORTD. These switches provide a means of entering data into the PIC and the LCD can be used as output device for displaying appropriate messages.

Aims

To develop a ‘C' program to simulate a drink-dispensing machine and to evaluate its operation using the development system boards in Embedded Systems laboratory. The inputs to the drink-dispensing machine are simulated by 5 pushbutton switches on PORTD. The LCD is used to display text messages and to provide visual indication of the process.

Objectives

1- To write a structured and annotated ‘C' program using the MikroC cross compiler.
2- To provide evidence of the development of each stage of the program. This will consist of producing a report and a logbook.
3- To demonstrate a functional (fully or partially) program to your tutor at a scheduled laboratory session.

Tasks

1- Display a menu of the type of drinks available on the LCD.
2- Use switches connected to RD0 and RD1 to move up and down the menu.
3- Use the switch connected to RD2 to make a selection.
4- Insert coins by means of RD0 - RD4.
5- Use LED connected to RD7 is simulate the number of coins returned.
6- Display suitable messages to inform the customer as the drink is made.

Evidence

1- Logbook containing your laboratory exercises and a formal report.
2- Demonstration of the project.
3- A disc containing your code files saved as embed1.* and an electronic copy of your formal report.

Operation

A simplified block diagram of the proposed drink-dispensing machine is shown below.

191_Drink-dispensing machine.png

Your program should:

1- Display the following choices on the LCD
- Cold drinks
- Hot drinks

2- If the Cold drink is selected then a second menu should provide the following choices.
- Orange juice
- Fizzy drink
- Water

To show the Water option, the display has to scroll down as RD0 is pressed.

3- If the Hot drink is selected then a second menu should provide the following choices.
- Tea
- Coffee
- Chocolate
- Soup

4- In all the cases, RD0 and RD1 are used to move the cursor up/down to highlight one of the choices. Where necessary the menu must scroll up/down to reveal other options.
RD2 is used to select the highlighted choice.

5- Once a drink has been selected, a message asking the customer to insert coins should be displayed. Coins are inserted by pressing RD0-RD4 so that the total value is equal to or exceeds the price of the drink. If no money or an insufficient amount is inserted then the machine should return to its original mode (first screen) after 5 seconds. All inserted coins should be returned by turning RD7 LED on for 5 seconds.

6- Any excess money (change) should be returned by displaying what change has been given. The LED connected to RD7 should flash once for each 5 pence coin returned. (e.g. flash 4 times for 20 pence).

7- A final message of "Drink dispensed" should be displayed for 3 seconds before returning to the first screen.

The following prices should be used to test your program.

Drink

Price

Orange juice

50 P

Fizzy drink

50 P

Water

75 P

Tea

80 P

Coffee

90 P

Chocolate

65 P

Soup

70 P

 

Reference no: EM13910397

Questions Cloud

Are all derivatives held at fair value on the balance sheet : Following is the link to an article from 2007 related to the use of derivatives by Southwest Airlines at a time when fuel prices were rising significantly. This article discusses how these derivatives's value to their income fell as fuel prices st..
Need to solve the t statistic for the test : Need to solve the T  -statistic for the test below is the the table the Answer is  t= - 7.646 But i need to understand how they obtain this answer in order to do a similar question.
Does texaco have moral obligation to provide additional fund : Given the fact that Texaco operated in partnership with the Ecuadorean government, is Texaco's activity in the Amazon morally justifiable? Explain.
Environmental science final project instructions : Environmental Science Final Project Instructions You are required to do a term paper on an environmental problem of your choosing. This assignment is worth 20% of your grade. It should be creative and interesting
Program to simulate a drink-dispensing machine : Simulate a drink-dispensing machine and to evaluate its operation using the development system boards in Embedded Systems laboratory. The inputs to the drink-dispensing machine are simulated by 5 pushbutton switches on PORTD.
Determine the density of air in grams : Determine the density of air in grams per liter at a temperature of 20.5 deg. C and a pressure of 755 mmHg. Assume that air is approximately 20% O2 and 80% N2 (i.e. the mole fraction of oxygen is 0.20 and the mole fraction of nitrogen is 0.80)
Do you believe that you should listen to your supervisor : The market is not normal. You propose a new, different method. Your model will lead to a higher valuation of the derivative investment. Your supervisor has told you, in no uncertain manner, that to disobey him will lead to future probation.- Do yo..
Explain the role of banks on the money supply : 1)a )Explain the role of banks on the money supply. What is money multiplier? Explain.b) If the Central Bank increases the required reserve ratio what will happen to interest rate? Using appropriate diagram, show equilibrium in the money market.
The class that has had the greatest percentage increase : Identify the class that has had the greatest percentage increase with respect to its initial percentage over the five decades.Identify the utility that decreases as a percentage of the total utility bill from January to June.

Reviews

Write a Review

Other Engineering Questions & Answers

  Result using the solution of part

Derive a formula for p(g/cm3) as a function of P(N/m2). (See Example 2.6-1) Check your result using the solution of part (b).

  Mobile applications require high availability because end

1.assess the effectiveness and efficiency mobile-based applications provide to capture geolocation data and customer

  Find the total fuel flow

Find the Total Fuel Flow to maintain Max endurance speed in Level flight at FL350 - What would the % thrust and % N1 setting be at Max Endurance Speed, FL350?

  Formulate dr. konurs maximum-flow problem as a linear model

Represent Dr. Konur's problem on a network by defining the nodes, node values (if any), arcs, arc costs (if any), arc capacities (if any) and state it as a maximum-flow problem and mathematically formulate Dr. Konur's maximum-flow problem as a lin..

  Use of lead in making plates, forks and knives

Companies or corporations typically offer paid vacation and sick leave; where is this money calculated in your invoices to the clients?

  What was the acceptable use policy in place on the internet

answer the following questions from a. what was the acceptable use policy in place on the internet before 1995? b. why

  Athens medical claims reengineering

Athens Administrators is an open indemnity claims administration services organization. Athens identified a growing trend of future medical claims within their client's population, descriptive statement and one (1) sample of a prescriptive statemen..

  Evaluate the online crm system of your bank what are the

what are the motivations for an organization to have a good supply chain management scm system? define scm in your own

  Neglecting the weight of the rod

A vertical load P is applied at end B of rod BC. The constant of the spring is k, and the spring is unstretched when θ = 90o. (a) Neglecting the weight of the rod, express the angle θ corresponding to equilibrium in terms of P, k, and l.

  Find temperature and pressure in the compressor inlet

The front of a jet engine acts as a diffuser receiving air at 900 km/h, -5°C, 50 kPa, bringing it to 80 m/s relative to the engine before entering the compressor. If the flow area is reduced to 80% of the inlet area find the temperature and pressu..

  Analyse a proposed redesign of dehavilland vampire tail

Your task will be to analyse a proposed redesign of the de Havilland Vampire tail booms (not to be confused with a boom in your hand calculations) in an all metal configuration

  Magnitude of the force

A chain of length l and mass m lies in a pile on the floor. If its end A is raised vertically at a constant speed v, express in terms of the length y of chain which is off the floor at any given instant

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd