Guru.Technosains.Com

Home Kuliah Elektro Elektronik Project Tutorial Download Donasi

     

 

more searching, type here

 

   

 

 

 

 

 

 

 

 

 

 

 

 

Traffic Light Control Using AT89C51 (2)

By: Arif Johar Taufiq

 

To turn on the lights, microcontroller sends a signal to the port-related high. Here flame lamp requires a high input for the lamp drivers, because the design of such drivers in the figure 4.1, the first transistor in the off state. So if you get a high input from the port teraliri base current registration:


        Ib= (Vport-Vbe)/4,7k ohm Ampere


This current is enough to make working transistors will be saturated so that the LED current from the VCC :


        Iic= (Vcc-VLED)/560ohm Ampere


Suppose we want a green light east (HT) and all the other red, send data to port 1 = 0CH (00001100b) and port3 = 09H (00001001b)
So that the program is written as follows, for the sake of convenience delay is not counted in minutes that precision. If you want more detailed reference clock can be used by programmers at uC timer.


;-----------------------------------
; PROGRAM TRAFFIC LIGHT

; By : Arif Johar Taufiq

; http://guru.technosains.com
;-----------------------------------
     ORG 00H
     LJMP K1
     ORG 100H
K1:  MOV P1,#09H ; MERAH SEMUA
     MOV P3,#09H
     ACALL TUNDA
K2:  MOV P1,#0CH
     MOV P3,#09H
     ACALL TUNDA
K3:  MOV P1,#0EH
     MOV P3,#09H
     ACALL TUNDA
K4:  MOV P1,#09H
     MOV P3,#09H
     ACALL TUNDA
K5:  MOV P1,#21H
     MOV P3,#09H
     ACALL TUNDA
K6:  MOV P1,#31H
     MOV P3,#09H
     ACALL TUNDA
K7:  MOV P1,#09H
     MOV P3,#09H
     ACALL TUNDA
K8:  MOV P1,#09H
     MOV P3,#0CH
     ACALL TUNDA
K9:  MOV P1,#09H
     MOV P3,#0EH
     ACALL TUNDA
K10: MOV P1,#09H
     MOV P3,#09H
     ACALL TUNDA
K11: MOV P1,#09H
     MOV P3,#21H
     ACALL TUNDA
K12: MOV P1,#09H
     MOV P3,#31H
     ACALL TUNDA
     LJMP K1
TUNDA:  MOV R7,#00H
ULANG2: MOV R6,#00H
ULANG1: MOV R5,#00H
ULANG:  INC R5
        CJNE R5,#02H,ULANG
        INC R6
        CJNE R6,#02H,ULANG1
        INC R7
        CJNE R7,#02H,ULANG2
        RET
        END

Download Program-1

Download Traffic Light Circuit

NEXT-3

 

 

 

Software Unik

Elektro Series

 

 

 

Copyright (C) guru.technosains.com

For problems or questions regarding this web contact [admin]