Monday, 21 November 2011

89s52 based Temperature Sensor using ADC

Process Diagram:

At  Maximum Temperature:

fire.JPG

 

At minimum Temperature:

fire2.JPG

Parts Needed:

1.89s52 microcontroller

2.LM35

3.ADC 0804

4.LCD

 

1.89s52 microcontroller:

It is used to receive digital values from adc and control the lcd

AT89s52.jpg

 

 

 

 

 

 

 

 

2.LM35

It is used to sense Temperature.

arunafire.jpg

 

 

 

 

 

 

 

 


3.ADC 0804:

It is used to convert analog signal into digital signal

ADC0804

 

4.LCD:

It will show the output according to the temperature getting from LM35.

Lcd-Display

 

How it works:

This project is all about using the ADC feature in 89s52 Microcontroller. ADC will get Analog input from LM35 Fire Sensor. LCD Will show the output variation from 0 to 255 based on temperature degree.

 

Circuit Diagram:

fire23.JPG

 

Code:

org 0x00

mov r1,#38H

call command

mov r1,#0EH

call command

mov r1,#06H

call command

mov r1,#01H

call command

start: clr p3.6

nop

setb p3.6

wait:jb p3.2,wait

acall read

acall conversion

call data2

call data1

call epr

call delay

call delay

call delay

call delay

call delay

call delay

mov r1,#01H

call command

call delay

jmp start

read:

clr p3.7

mov a,p0

mov 30h,a

setb p3.7

ret

delay:

mov r1,#255

l2: mov r0,#255

l1: djnz r0,l1

djnz r1,l2

ret

command:

clr p3.4

mov p2,r1

setb p3.5

call delay

clr p3.5

ret

data2:

setb p3.4

mov p2,r4

setb p3.5

call delay

clr p3.5

ret

data1:

setb p3.4

mov p2,r3

setb p3.5

call delay

clr p3.5

ret

epr:

setb p3.4

mov p2,r2

setb p3.5

call delay

clr p3.5

ret

conversion:

mov b,#10

div ab

mov r2,b

mov b,#10

div ab

orl a,#30h

mov r4,a

mov a,b

orl a,#30h

mov r3,a

mov a,r2

orl a,#30h

mov r2,a

ret

end

 

Output Image:

89s52-based-fire-sensor


Video:

No comments:

Post a Comment