Tuesday, 29 November 2011

VOTING MACHINE - Basic Version



Stepper Motor
Parts Needed:
  • Switch
  • 16x2 lcd
  • 8051 microcontroller
  • Buzzer
1.Switch:
Switch@ www.eprlabs.com
2.16*2 LCD:
LCD Display @t www.eprlabs.com
3.8051 microcontoller:
4.Buzzer:
buzzer @ www.eprlabs.com
HOW ITS WORKS:
  This machine records the number of times a each key is pressed.  It can count upto 100 digits.  Once the button Total is pressed, this machine will display the results through LCD.
CIRCUIT DIAGRAM:
Voting machine @ www.eprlabs.com
CODE:
org 0x00

mov r7,#38h
call command
mov r7,#0eh
call command
mov r7,#06h
call command
jmp loop


start:
mov a,#00h
mov 50h,a
mov 52h,a
mov r0,#3h
mov r7,#01h
call command
mov r7,#'W'
call data
mov r7,#'E'
call data
mov r7,#'L'
call data
mov r7,#'C'
call data
mov r7,#'O'
call data
mov r7,#'M'
call data
mov r7,#'E'
call data
jmp loop
loop:

jnb p1.0,start
jnb p1.1,poll1
jnb p1.2,poll2
jnb p1.3,total
jmp loop


poll1:
inc 50h
clr p0.0
call delay
call delay
call delay
call delay
setb p0.0
mov r7,#01h
call command
mov r7,#'N'
call data
mov r7,#'E'
call data
mov r7,#'X'
call data
mov r7,#'T'
call data

call delay
jmp loop
poll2:
inc 52h
clr p0.0
call delay
call delay
call delay
setb p0.0
mov r7,#01h
call command
mov r7,#'N'
call data
mov r7,#'E'
call data
mov r7,#'X'
call data
mov r7,#'T'
call data
call delay
jmp loop
total:
mov a,50h
mov b,#10
div ab
orl a,#30h
mov r4,a
mov a,b
orl a,#30h
mov r3,a
mov r7,#01h
call command
mov r7,#'c'
call data
mov r7,#'1'
call data
mov r7,#':'
call data
mov a,r3
mov r7,a
call data
mov r7,#' '
call data
mov r7,#' '
call data
mov r7,#'c'
call data
mov r7,#'2'
call data
mov r7,#':'
call data
mov a,52h
mov b,#10
div ab
orl a,#30h
mov r4,a
mov a,b
orl a,#30h
mov r3,a
call delay
call delay
call delay
call delay
djnz r0,total
jmp loop
command:clr p3.6
mov p2,r7
setb p3.7
call delay
clr p3.7
ret
data:setb p3.6
mov p2,r7
setb p3.7
call delay
clr p3.7
ret
delay:mov r1,#255
loop2:mov r5,#255
loop1:djnz r5,loop1
djnz r1,loop2
ret

end


HEX CODE:

:100000007F381201127F0E1201127F0612011202B6
:020010000045A9
:100012007400F550F55278037F011201127F5712D6
:02002200011EBD
:100024007F4512011E7F4C12011E7F4312011E7F69
:010034004F7C
:1000350012011E7F4D12011E7F4512011E02004551
:100045003090CA30910930923730936202004505ED
:01005500505A
:10005600C28012012A12012A12012A12012AD28012
:100066007F011201127F4E12011E7F4512011E7F73
:010076005831
:1000770012011E7F5412011E12012A020045055269
:10008700C28012012A12012A12012AD2807F01128C
:02009700011254
:100099007F4E12011E7F4512011E7F5812011E7FDD
:0100A9005402
:1000AA0012011E12012A020045E55075F00A844425
:0100BA003015
:1000BB00FCE5F04430FB7F011201127F6312011E3D
:1000CB007F3112011E7F3A12011EEBFF12011E7FC0
:0100DB002004
:1000DC0012011E7F2012011E7F6312011E7F32123D
:0200EC00011EF3
:1000EE007F3A12011EE55275F00A844430FCE5F0A9
:1000FE004430FB12012A12012A12012A12012AD8B7
:01010E00A44C
:10010F00020045C2B68FA0D2B712012AC2B722D2BF
:01011F00B629
:100120008FA0D2B712012AC2B72279FF7DFFDDFE70
:03013000D9FA22D7
:00000001FF
 Output Image:
voting Machine





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: