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

  Characterization technology for nanomaterials

Calculate the reciprocal lattice of the body-centred cubic and Show that the reciprocal of the face-centred cubic (fcc) structure is itself a bcc structure.

  Calculate the gasoline savings

How much gasoline do vehicles with the following fuel efficiencies consume in one year? Calculate the gasoline savings, in gallons per year, created by the following two options. Show all your work, and draw boxes around your answers.

  Design and modelling of adsorption chromatography

Design and modelling of adsorption chromatography based on isotherm data

  Application of mechatronics engineering

Write an essay on Application of Mechatronics Engineering

  Growth chracteristics of the organism

To examine the relationship between fermenter design and operating conditions, oxygen transfer capability and microbial growth.

  Block diagram, system performance and responses

Questions based on Block Diagram, System Performance and Responses.

  Explain the difference in a technical performance measure

good understanding of Mil-Std-499 and Mil-Std-499A

  Electrode impedances

How did this procedure affect the signal observed from the electrode and the electrode impedances?

  Write a report on environmental companies

Write a report on environmental companies

  Scanning electron microscopy

Prepare a schematic diagram below of the major parts of the SEM

  Design a pumping and piping system

creating the pumping and piping system to supply cool water to the condenser

  A repulsive potential energy should be a positive one

Using the data provided on the webvista site in the file marked vdw.txt, try to develop a mathematical equation for the vdW potential we discussed in class, U(x), that best fits the data

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