This device can be used to control (ON/OFF) eight high voltage electrical equipments with a remote control. The LEDs connected shows the status of the relays (ON or OFF). If one relay is ON then the corresponding LED will be ON otherwise it will be OFF. The remote control is shown in figure. The RED color POWER button (at top left) can be used to switch all the relays at a time. And the other shown button can be used to selectively ON/OFF the relays. If the other buttons are pressed except the programmed buttons, the Yellow LED will blink twice indicating WRONG button pressed. The buttons marked with RED color in the image of the remote control are the working buttons. If interested the device can be modified to control 30 electrical equipments.
Project Source Code
Project Source Code
###
ORG 00H
IR EQU P3.0
RELAY1 EQU P1.0
RELAY2 EQU P1.1
RELAY3 EQU P1.2
RELAY4 EQU P1.3
RELAY5 EQU P1.4
RELAY6 EQU P1.5
RELAY7 EQU P1.6
RELAY8 EQU P1.7
LED1 EQU P2.0
LED2 EQU P2.1
LED3 EQU P2.2
LED4 EQU P2.3
LED5 EQU P2.4
LED6 EQU P2.5
LED7 EQU P2.6
LED8 EQU P2.7
YELLOWLED EQU P3.1
CMNDCOUNT EQU R0
ADDRCOUNT EQU R1
CMNDSTORE EQU R2
ADDRSTORE EQU R3
TEMPVAR EQU R4
SETB YELLOWLED
CLR 10H
MOV P1,#00H
ACALL NINE
MOV P2,0FFH
MOV A,#0FFH
MOV TEMPVAR,#08
CLR C
OP: RLC A
MOV P2,A
ACALL TWOFIVE
DJNZ TEMPVAR,OP
MOV P2,0FFH
ORIGIN:
MOV A,#00
CLR C
MOV CMNDCOUNT,#16H
MOV ADDRCOUNT,#12
MOV TEMPVAR,#00
JB IR,$
ACALL NINE
GETADDR:
JNB IR,$
ACALL FIVESIX
JNB IR,CO
ACALL FIVESIX
ACALL FIVESIX
SJMP CI
CO:
MOV A,TEMPVAR
CLR C
RLC A
MOV TEMPVAR,A
SJMP ASTORE
CI:
MOV A,TEMPVAR
SETB C
RLC A
MOV TEMPVAR,A
SJMP ASTORE
ASTORE:
DJNZ ADDRCOUNT,GETADDR
MOV A,TEMPVAR
MOV ADDRSTORE,A
MOV TEMPVAR,#00
GETCMND:
JNB IR,$
ACALL FIVESIX
JNB IR,SO
ACALL FIVESIX
ACALL FIVESIX
SJMP SI
SO:
MOV A,TEMPVAR
CLR C
RLC A
MOV TEMPVAR,A
SJMP CSTORE
SI:
MOV A,TEMPVAR
SETB C
RLC A
MOV TEMPVAR,A
SJMP CSTORE
CSTORE:
DJNZ CMNDCOUNT,GETCMND
MOV A,TEMPVAR
MOV CMNDSTORE,A
CHECK_VALID_ADDR:
CJNE ADDRSTORE,#0CCH,ORIGIN
CMD1: CJNE CMNDSTORE,#0FFH,CMD2
JB 10H,OFF
MOV P1,#00H
MOV P2,#0FFH
SETB 10H
SJMP OUT
OFF: MOV P1,#0FFH
MOV P2,#00H
CLR 10H
SJMP OUT
CMD2: CJNE CMNDSTORE,#0EDH,CMD3
CPL RELAY1
CPL LED1
SJMP OUT
CMD3: CJNE CMNDSTORE,#0F1H,CMD4
CPL RELAY2
CPL LED2
SJMP OUT
CMD4: CJNE CMNDSTORE,#0E3H,CMD5
CPL RELAY3
CPL LED3
SJMP OUT
CMD5: CJNE CMNDSTORE,#0FDH,CMD6
CPL RELAY4
CPL LED4
SJMP OUT
CMD6: CJNE CMNDSTORE,#0F9H,CMD7
CPL RELAY5
CPL LED5
SJMP OUT
CMD7: CJNE CMNDSTORE,#0FAH,CMD8
CPL RELAY6
CPL LED6
SJMP OUT
CMD8: CJNE CMNDSTORE,#0E9H,CMD9
CPL RELAY7
CPL LED7
SJMP OUT
CMD9: CJNE CMNDSTORE,#0F5H,EXIT
CPL RELAY8
CPL LED8
SJMP OUT
EXIT: CLR YELLOWLED
ACALL TWOFIVE
SETB YELLOWLED
ACALL TWOFIVE
CLR YELLOWLED
ACALL TWOFIVE
SETB YELLOWLED
OUT: LJMP ORIGIN
FIVESIX:MOV R7,#255
DJNZ R7,$
MOV R7,#24
DJNZ R7,$
RET
NINE: MOV R5,#16
NINAG: MOV R6,#250
DJNZ R6,$
DJNZ R5,NINAG
RET
TWOFIVE:MOV R5,#5
ER: MOV R6,#90
RT: MOV R7,#255
DJNZ R7,$
DJNZ R6,RT
DJNZ R5,ER
RET
END
{C}{C}{C}{C}{C}{C} are/�*bc��h�sosition: initial initial; background-repeat: initial initial;">
DJNZ R7,$RETNINE: MOV R5,#16NINAG: MOV R6,#250DJNZ R6,$DJNZ R5,NINAGRETTWOFIVE:MOV R5,#5ER: MOV R6,#90RT: MOV R7,#255DJNZ R7,$DJNZ R6,RTDJNZ R5,ERRETEND###
Circuit Diagrams
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.