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

  Design logic for the control unit

Design Logic for the control unit

  Develop a simple canvas animation of your own design

Develop a simple canvas animation of your own design. For example, you could rotate the four smaller solid circles around the red hollow circle using trigonometry (sin and cos)to locate the x,y coordinates of the circles at different angles.

  Dfi of real sequences with odd harmonics

DFI of real sequences with odd harmonics only Let x(n) be an N-point real sequence with N-point DFT X(k) (N even). In addition, x(n) satisfied the following symmetry property:

  Question 1a pool of newly qualified doctors are not

question 1a pool of newly qualified doctors are not satisfied with their existing revenue and decide to set up an

  Prepare a paper on sms gateway

Prepare a paper on SMS GATEWAY - aim, objective, architecture, information regarding gsm modem, AT commands, sample input out like sending message receiving message, advantages , conclusion

  Triangular membership function

Write the equation for a triangular membership function that is independent of the center point and the width.

  Perfectly fitting pot and its lid often stick

A perfectly fitting pot and its lid often stick after cooking, and it becomes very difficult to open the lid when the pot cools down. Explain why this happens and what you would do to open the lid.

  A significant effect on the dependent variable

Did the independent variable have a significant effect on the dependent variable? How do you know?

  Produce the most all encompassing definition of technology

Produce the most all encompassing definition of technology while discussing Heidegger's article. Having discussed willed ignorance during the critical thinking discussion, now is your chance for some self-reflection.

  Justify a need for digital forensics methodology

Justify a need for digital forensics methodology and consider scope of the case including nature of alleged misconduct leading to consideration of how electronic and digital evidence may support the investigation.

  Describe how security administration works to plan

Describe how security administration works to plan, design, implement, and monitor man organization's security plan.

  Horizontal and vertical components

The airstroke actuator at D is used to apply a force of F = 200 N on the member at B. Determine the horizontal and vertical components of reaction at the pin A and the force of the smooth shaft at C on the member.

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