Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MICROPROCESSOR LAB
Name
EE091198
EE087721
Title of project
Semester
: Year 3, Sem2
Section
: 03
Table of Content
No.
Title
Page no.
1.
Project specifications
2.
4-7
Testing
4.
5.
Conclusion
3.
10-12
6.
Appendix
Project Specifications
2
Block Diagram
LM35
a/d
converter
PIC18F455
0
Led
Buzzer
Description of operation
LM35 (potentiometer) act as a pressure sensor. The range is set accordingly. When the
pressure is in normal condition the first led (green led) will light up. When the pressure is
above normal level the second led (yellow led) will light up. And when the pressure is high
the third led (red colour) will light up and the buzzer will sound indicating the pressure is
high.
Hardware design
LM35
(POTENTIOMET
ER)
LED1(GREE
N)
PORTA,0
PORTD,0
LED2(YELL
OW)
PORTD,1
LED3(RED)
PORTD,2
PIC18F455O
Flowchart
Buzzer
START
Initialize PICF184550
Set port A as input
Set port D as output
Set port C as output
Check if potentiometer
reading <50
Led 1(green) turn on
indicating normal
pressure
Check if potentiometer
reading in between 50-100
Check if potentiometer
reading in between 50-100
Led 2(green) turn on
indicating above
normal pressure
START
Description of flowchart
As we can see from the flowchart, the first step is to initialize PIC18F4550.
Port A is set as output, whereas port D and port C as output. Then condition is checked, if
potentiometer reading is less than 50 led1 (green) lights up indicating normal pressure. If not
second condition is checked whether the range of potentiometer is in between 50 to 100. If
yes led 2( yellow) lights up indicating above normal pressure level. If not third condition is
checked whether the potentiometer is above 100. If yes led 3 (red) lights up and buzzer
sounds indicating high pressure.
Testing
PROTEUS
1. The coding was typed into the mplab and then it was build. Once its successful, the HEX
File is saved.
2. To simulate the program, PROTEUS was used. The circuit diagram schematic was built
using LM35 temperature sensor, PIC18F4550 microprocessor, three LEDs, and a buzzer.
3. Once the circuit diagram is built, the HEX file is then exported into the PIC18F4550
microprocessor. It is then simulated and the results are observed.
Conclusion
This pressure sensor mainly is designed to sense pressure and indicate the
pressure level of a patient. This is a simple device to ensure pressure to be maintained in daily
life. This project also could be developed to show further accurate reading as this project is
only indicating the pressure level. Thus, people should be more aware of the danger of having
high blood pressure.
Appendix
Schematic diagrams
HEX file
:020000040000FA
:040000000DEF00F010
:020008001000E6
:080018001000946A9268956AD9
:10002000836A826A800EC06E0E0EC16E030EC26EAF
:10003000070EB46EC2B21AEF00F0E86AD00EC360C9
:1000400025EF00F0836A8380ECD7E00EC3602CEFCD
:1000500000F0836A8382E5D7F00EC36011EF00F0F1
:08006000836A83848284DDD7EA
:00000001FF
Source file
10
#include<p18f4550.inc>
org 0x00
goto start
org 0x08
retfie
org 0x18
retfie
start
CLRF TRISC,A
SETF TRISA,A
CLRF TRISD,A
CLRF PORTD,A
AGAIN
CLRF PORTC,A
MOVLW 0X80
MOVWF ADCON2,A
MOVLW 0X0E
MOVWF ADCON1,A
MOVLW 0X03
MOVWF ADCON0,A
MOVLW 0X07
MOVWF CMCON
waitsec
btfsc ADCON0,NOT_DONE
GOTO waitsec
CLRF WREG,A
MOVLW 0XD0
CPFSLT ADRESL,A
GOTO LEVEL2
CLRF PORTD,A
BSF PORTD,0,A
BRA AGAIN
LEVEL2
MOVLW 0XE0
CPFSLT ADRESL,A
GOTO LEVEL3
CLRF PORTD
BSF PORTD,1,A
BRA AGAIN
LEVEL3
MOVLW 0XF0
CPFSLT ADRESL,A
GOTO AGAIN
CLRF PORTD
BSF PORTD,2,A
BSF PORTC,2,A
BRA AGAIN
11
END
12