Microcontroller › 8051 › Rfid ACCESS CONTROL system
- This topic has 1 reply, 1 voice, and was last updated 9 years, 4 months ago by
kalpana.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
November 14, 2015 at 7:00 am #4102
kalpana
ParticipantHi sir,
I am trying to access the the RFID cards and make a control access system.in this am using 3 different rfid tags and making three different orders to control the relays using this sequence matching of codes.for example if i card1,card2,card3 in sequence then relay 1 should ON and if i place Card2.card1,card3 relay2 should ON and if i place card3,card2,card1 then buzzer should get ON.i have written the code but only first sequence is working and next sequences are not working Please help me to work my code.
Here is the Code:
#include<reg51.h>#include "DELAY.H"#include "LCD.h"#include<string.h>sbit buz = P3^7;sbit ip1 = P3^6;sbit ip2 = P3^5;code unsigned char card1[]="1600507D201B";code unsigned char card2[]="160050736055";code unsigned char card3[]="4500C57DDD20";unsigned char modem[20],j=0,modem1[20],k=0,modem2[20],l=0;void serintr(void) interrupt 4{if(RI==1){if(SBUF != 12){modem[j]=SBUF;j=j+1;}RI=0;}if(RI==1){if(SBUF != 12){modem1[k]=SBUF;k=k+1;}RI=0;}if(RI==1){if(SBUF != 12){modem2[l]=SBUF;l=l+1;}RI=0;}}void uart_init(){SCON=0X50;TMOD|=0X20;TH1=0XFD;TR1=1;EA=1;ES=1;}void main(){unsigned char i=0,count1=0,count2=0;buz=0;ip1=0;ip2=0;LCD_init();uart_init();LCDStringXY("WELCOME",0,5);_delay_ms(100);LCDStringXY("ACCESS CONTROL",0,1);LCDStringXY("USING RFID",0,0);start:j=0;k=0;l=0;_delay_ms(300);LCDStringXY(" SHOW THE CARD",0,1);while(j==k==l==0);_delay_ms(350);modem[12]='