Professional Documents
Culture Documents
CEP Report
By
ABDULLAH FA20-EPE-002
1|Page
Department of Electrical & Computer Engineering
COMSATS University Islamabad – Abbottabad Campus
DECLARATION
Date: 12/01/2023
Asim khan
(FA19-EPE-035)
(FA19-EPE-009)
Abdullah
(FA20-EPE-002)
2|Page
ABSTRACT
A microcontroller also called MCUs or Microcontroller Unit is a single integrated circuit (IC)
that is used for a specific application and designed to implement certain tasks. Products and
devices that have been automatically controlled in certain situations, like appliances, power
tools, automobile engine control systems, medical equipment, high-end consumer electronics,
rugged industrial devices, and computers are great examples, but microcontrollers reach
much higher than these applications. Essentially, a microcontroller works to gather input,
process the information, and output a particular action based on the information gathered.
Microcontrollers or MCUs can operate at lower speeds, for example, it can operate at around
in 1MHz to 200 MHz of range, and is designed to consume less power because they’re
embedded inside the other devices, which have greater power consumptions in other areas.
But our project is coffee making machine in which we will be using MPLAB for coding and
for simulation we use PROTEUS. In our project we have some basic requirements of powder
and water. If these requirements are enough then the sensor will detect it and coffee making
process will start and green led will glow if requirements are not enough then it will return to
basic requirements portion and red led will glow.
3|Page
TABLE OF CONTENTS
1. Introduction……………………………………………………………………………………...5
1.1 Explanation.…………………………………………………………………………………5
1.2 Objective …………………………………………………………………………………….6
2. Literature Survey……………………………………………………………………………….6
3. Proposed Methodology……………………………………………………………………..6
3.1 Block diagram………………………………………………………………………………8
4. Code……………………………………………………………………………………..…………..9
4.1 Software Simulation Results………………………………………………….……19
4.2 Simulation parameter…………………………………………………………..…….19
5. Conclusion………………………………………………………………………………………..20
6. References…………….………………………………………………………………………...20
LIST OF FIGURES
4|Page
1.I NTRODUCTION:
1.1 Explanation:
But our project is coffee making machine in which we have some basic requirements of
powder and water. If these requirements are enough then the sensor will detect it and coffee
making process will start and green led will glow if requirements are not enough then it will
return to basic requirements portion and red led will glow.
Diagram:
Figure 1.1
5|Page
1.2 Objective:
We are using microcontroller in its practical implementation by making the coffee machine
where its input and output are controlled by the programmable logic of microcontroller.
2. Literature Survey:
Shepard, T., & Choi, J., & Holmes, T. D., & Carlin, B. W. (2015, June), The Effect of Project
Constraints and Choice on First-year Microcontroller Projects Paper presented at 2015
ASEE Annual Conference & Exposition, Seattle, Washington.
Choi, C. (2008, June), A Microcontroller Applications Course And The Free scale’s
Microcontroller Student Learning Kit Paper presented at 2008 Annual Conference &
Exposition, Pittsburgh, Pennsylvania.
3. Proposed Methodology:
We are using the previous knowledge of our course how to make input and output how to do
Lcd interfacing how to generate delay how to apply loop and sub loop how to apply branch in
programming logic. In our project we have some basic requirements of powder and water. If
these requirements are enough then the sensor will detect it and coffee making process will
start and green led will glow if requirements are not enough then it will return to basic
requirements portion and red led will glow. For this purpose we are using MPLAB for
6|Page
software coding and PROTEUS simulation. After software implementation, we implemented
7|Page
3.1 BLOCK DIAGRAM:
8|Page
4.Code:
LIST P=PIC18F452,F=INHX32,N=0,ST=OFF,R=HEX
#include<p18f452.inc>
config
OSC=HS,OSCS=OFF,WDT=OFF,BORV=45,PWRT=ON,BOR=ON,DEBUG=OFF,LVP=O
FF,STVR=OFF
org 0x2A
CLRF TRISD
CALL LCD_CONFIGURATION
QWE
9|Page
BTFSS PORTB,0 ;WATER LEVEL
BRA ABD
BTFSS PORTB,1 ;COFFEE POWDER
BRA ABD
ABD
BSF PORTC,1
BCF PORTC,0
BRA QWE
QWER
BTFSS PORTB,2 ;PRESENCE OF GLASS
BRA QWE
BSF PORTB,7 ;HEATING COIL
CALL DELAY5 ;5 SEC DELAY
BCF PORTB,7
10 | P a g e
BCF PORTB,2
CALL LCD_CODE
BRA QWE
11 | P a g e
ABC1
BTFSS INTCON,TMR0IF
BRA ABC1
RETURN
CALL DELAY
MOVLW A'Y'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'O'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'U'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'R'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW 014H
12 | P a g e
CALL COMNWRT
CALL DELAY
MOVLW A'C'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'O'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'F'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'F'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'E'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'E'
MOVWF PORTD
CALL DATAWRT
13 | P a g e
CALL DELAY
MOVLW 0C3H
CALL COMNWRT
CALL DELAY
MOVLW A'I'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'S'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW 014H
CALL COMNWRT
MOVLW 0C6H
CALL COMNWRT
CALL DELAY
MOVLW A'P'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'R'
MOVWF PORTD
CALL DATAWRT
14 | P a g e
CALL DELAY
MOVLW A'E'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'P'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'A'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'R'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'E'
MOVWF PORTD
CALL DATAWRT
CALL DELAY
MOVLW A'D'
MOVWF PORTD
CALL DATAWRT
15 | P a g e
RETURN
LCD_CONFIGURATION
CALL LDELAY
MOVLW 38H
CALL COMNWRT
CALL LDELAY
MOVLW 0EH
CALL COMNWRT
CALL DELAY
MOVLW 01H
CALL COMNWRT
CALL DELAY
MOVLW 06H
CALL COMNWRT
CALL DELAY
MOVLW 84H
CALL COMNWRT
RETURN
MOVWF PORTD
BCF PORTC,5
BCF PORTC ,6
BSF PORTC ,7
16 | P a g e
CALL SDELAY
BCF PORTC,7
RETURN
BSF PORTC,5
BCF PORTC,6
BSF PORTC,7
CALL SDELAY
BCF PORTC,7
RETURN
MOVLW 48H
MOVWF T0CON
MOVLW 0C1H
MOVWF TMR0L
BCF INTCON, TMR0IF
BSF T0CON,7
XYZ
BTFSS INTCON, TMR0IF
BRA XYZ
BCF T0CON,7
RETURN
MOVLW 04H
17 | P a g e
MOVWF T0CON
MOVLW 67H
MOVWF TMR0H
MOVLW 69H
MOVWF TMR0L
BCF INTCON, TMR0IF
BSF T0CON,7
XYZ1
BTFSS INTCON, TMR0IF
BRA XYZ1
BCF T0CON,7
RETURN
MOVLW 0F6H
MOVWF TMR0H
MOVLW 3CH
MOVWF TMR0L
BCF INTCON, TMR0IF
BSF T0CON,7
XYZ2
BTFSS INTCON,TMR0IF
BRA XYZ2
BCF T0CON,7
RETURN
END
18 | P a g e
4.1 SOFTWARE SIMULATION RESULTS:
Figure 4.1
Figure 4.2
19 | P a g e
4.2 SIMULATION PARAMETERS:
Resistor
LED
LCD (16x2)
Ground
Power source
Switch
5.CONCLUSION:
Due to this project we should be able how to use microcontroller in real time application and
also understand its programming logic which are very helpful in defining its input, output.
Due to this project we know how we should do LCD interfacing how we can generate delays
how we can use different loops and branches.
6.REFERENCE:
Following are some references of the sites and papers which were studied during this CEP.
1. https://www.datasheetarchive.com/coffee%20machine%20pic-
datasheet.html
2. https://labprojectsbd.com/2021/02/24/make-your-own-coffee-vending-
machine-control-circuit/
3. https://www.ijesrt.com/issues%20pdf%20file/TECHNOPHILIA-
2016%20-%20Jaihind%20Polytechhnic,%20Kuran,%20February,
%202016/3_COFFEE%20VENDING%20MACHINE%20USING
%20MICROCONTROLLER.pdf
20 | P a g e
21 | P a g e