Monday, 5 December 2011

EPRLABS: Presenting SIMPLE LED CUBE

http://www.eprlabs.com/2011/10/presenting-simple-led-cube/

Presenting SIMPLE LED CUBE


BLOCK DIAGRAM:
leddcube
Parts Needed:
1.Led
2.Microcontroller
3.Battery

1.Led:
led is used for indication
 
2.Microcontroller:
AT89s52 is to controlling the led
 
3.Battery:
9v,rechargable battery
How it works:
Connecting led in matrix format in microcontroller ports. Glowing each led will give 3d effect which is used for decorative purpose

Circuit Diagram:
code:
org 0x00
loop:
               ;top to bottom
mov r0,#05
l1:
mov p1,#0f7h
mov p2,#0ffh
mov p3,#0ffh
call delaY
mov p1,#0fbh
mov p2,#0ffh
mov p3,#0ffh
call delay
mov p1,#0fdh
mov p2,#0ffh
mov p3,#0ffh
call delay
mov p1,#0feh
mov p2,#0ffh
mov p3,#0ffh
call delay
mov p1,#0fdh
mov p2,#0ffh
mov p3,#0ffh
call delay
mov p1,#0fbh
mov p2,#0ffh
mov p3,#0ffh
call delay
mov p1,#0f7h
mov p2,#0ffh
mov p3,#0ffh
call delay
djnz r0,l1
;left to right
mov r0,05
l2:
mov p1,#00h
mov p2,#00h
mov p3,#0f0h
call delay
mov p1,#00h
mov p2,#00h
mov p3,#0fh
call delay
mov p1,#00h
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0f0h
mov p2,#0f0h
mov p3,#00h
call delay
mov p1,#00h
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#00h
mov p2,#00h
mov p3,#0fh
call delay
mov p1,#00h
mov p2,#00h
mov p3,#0f0h
call delay
djnz r0,l2
             ; rain flow
mov r0,#07
l4:
mov p1,#0feh
mov p2,#0ffh
mov p3,#0ffh
call delay
  mov p1,#0fdh
mov p2,#06h
mov p3,#00h
  call delay
mov p1,#0fdh
mov p2,#00h
mov p3,#06h
call delay
mov p1,#0fbh
mov p2,#00h
mov p3,#06h
call delay
mov p1,#0fbh
mov p2,#00h
mov p3,#06h
call delay
 mov p1,#0f7h
mov p2,#0ffh
mov p3,#0ffh
call delay
djnz r0,l4
           ;rain flow left to right
mov r0,#07
l6:
mov p1,#00h
mov p2,#00h
mov p3,#0f0h
call delay
  mov p1,#0fdh
mov p2,#06h
mov p3,#00h
  call delay
mov p1,#0fdh
mov p2,#00h
mov p3,#06h
call delay
mov p1,#0f0h
mov p2,#0f0h
mov p3,#00h
call delay
  djnz r0,l6
    ;rocket flying
  mov r0,#5
rocket:
mov r1,#75
loop9: mov r2,#75
loop10:
mov p1,#07h
mov p2,#00h
mov p3,#02h
djnz r2,loop10
djnz r1,loop9
mov r1,#75
loop11: mov r2,#75
loop12:
mov p1,#0bh
mov p2,#00h
mov p3,#02h
djnz r2,loop12
djnz r1,loop11
mov r1,#75
loop13: mov r2,#75
loop14:
mov p1,#0dh
mov p2,#00h
mov p3,#02h
djnz r2,loop14
djnz r1,loop13
mov r1,#75
loop15:
mov r2,#75
loop16:
mov p1,#0eh
mov p2,#00h
mov p3,#02h
djnz r2,loop16
djnz r1,loop15
mov r1,#255
loop6:
mov r2,#255
loop5:
mov p1,#0feh
mov p2,#0ffh
mov p3,#0ffh
djnz r2,loop5
djnz r1,loop6
          ;rocket burst
mov r1,#75
loop17: mov r2,#50
loop18:
mov p1,#0eh
mov p2,#52h
mov p3,#92h
djnz r2,loop18
djnz r1,loop17
mov r1,#75
loop19:
mov r2,#50
loop20:
mov p1,#0eh
mov p2,#0b4h
mov p3,#26h
mov p1,#0dh
mov p2,#52h
mov p3,#0bah
djnz r2,loop20
djnz r1,loop19
call delay
call delay
call delay
djnz r0,led
call led1
led:
call rocket
led1:
 ;snake left to right
mov r4,#5
l02:
mov p1,#0f7h
mov p2,#0f0h
mov p3,#00h
call delay
mov p1,#0fbh
mov p2,#0f0h
mov p3,#00h
call delay
mov p1,#0fdh
mov p2,#0f0h
mov p3,#00h
call delay
mov p1,#0feh
mov p2,#0f0h
mov p3,#00h
call delay
mov p1,#0feh
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0fdh
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0fbh
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0f7h
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0f7h
mov p2,#00h
mov p3,#0fh
call delay
mov p1,#0fbh
mov p2,#0h
mov p3,#0fh
call delay
mov p1,#0fdh
mov p2,#00h
mov p3,#0fh
call delay
mov p1,#0feh
mov p2,#00h
mov p3,#0fh
call delay
mov p1,#0feh
mov p2,#00h
mov p3,#0f0h
call delay
mov p1,#0fdh
mov p2,#00h
mov p3,#0f0h
call delay
mov p1,#0fbh
mov p2,#00h
mov p3,#0f0h
call delay
mov p1,#07h
mov p2,#00h
mov p3,#0f0h
call delay
djnz r4,l03
call led2
l03:call l02
 ;snake right to left
led2:
mov r5,#5
l04:
mov p1,#07h
mov p2,#00h
mov p3,#0f0h
call delay
mov p1,#0fbh
mov p2,#00h
mov p3,#0f0h
call delay
mov p1,#0fdh
mov p2,#00h
mov p3,#0f0h
call delay
mov p1,#0feh
mov p2,#00h
mov p3,#0f0h
call delay
mov p1,#0feh
mov p2,#00h
mov p3,#0fh
call delay
mov p1,#0fdh
mov p2,#00h
mov p3,#0fh
call delay
mov p1,#0fbh
mov p2,#0h
mov p3,#0fh
call delay
mov p1,#0f7h
mov p2,#00h
mov p3,#0fh
call delay
mov p1,#0f7h
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0fbh
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0fdh
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0feh
mov p2,#0fh
mov p3,#00h
call delay
mov p1,#0feh
mov p2,#0f0h
mov p3,#00h
call delay
mov p1,#0fdh
mov p2,#0f0h
mov p3,#00h
call delay
mov p1,#0fbh
mov p2,#0f0h
mov p3,#00h
call delay
mov p1,#0f7h
mov p2,#0f0h
mov p3,#00h
call delay
djnz r5,l05
jmp loop
l05:
call l04
delay:
mov r1,#200
loop1:
mov r2,#150
loop2:
djnz r2,loop2
djnz r1,loop1
ret
end

4 Way Traffic Light Controller using Microcontroller


BLOCK DIAGRAM:
4way traffic light
PARTS Needed:
1.MICROCONTROLLER
2.RESISTOR
3.LED
4.BATTERY
1.MICROCONTROLLER:
AT89S52 IS A CONTROLLER WHICH IS USED TO CONTROLL THE LED
AT89s52
2.RESISTOR:
330OHM RESISTOR IS USED TO RESIST THE SUPPLY WHICH WE HAVE GIVEN
resistor
3.LED:
led is to visit the output
led
4.BATTERY:
9v, RECHARGABLE BATTERY
battery
HOW  IT  WORKS:
Microcontroller turns the port on and off with which we connect the LEDs.
Key thing is how the expected time delay is achieved.
CIRCUITDIAGRAM:
CODE:
 org 0x00
 loop:
   mov p2,#0f1h
   clr p1.0
   call delay
   setb p1.0
   call delay
   mov p2,#0e1h
   call delay

   mov p2,#0f2h
   clr p1.1
   call delay
   setb p1.1
   call delay
   mov p2,#0d2h
   call delay
   mov p2,#0f4h
   clr p1.2
   call delay
   setb p1.2
   call delay
   mov p2,#0b4h
   call delay
 mov p2,#0f8h
   clr p1.3
   call delay
   setb p1.3
   call delay
   mov p2,#78h
   call delay

   jmp loop
 delay:
   mov r1,#2
 l1:
   mov r2,#212
 l2:
   mov r3,#255
 l3:
   mov r4,#255
 l4:
   djnz r4,l4
   djnz r3,l3
   djnz r2,l2
   djnz r1,l1
   ret
   end
HEX CODE:
:1000000075A0F1C29012004FD29012004F75A0E17E
:1000100012004F75A0F2C29112004FD29112004F00
:1000200075A0D212004F75A0F4C29212004FD29266
:1000300012004F75A0B412004F75A0F8C2931200C1
:010040004F70
:10004100D29312004F75A07812004F02000079027E
:0F0051007AD47BFF7CFFDCFEDBFADAF6D9F222F1
:00000001FF


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: