EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Rfid ACCESS CONTROL system

Rfid ACCESS CONTROL system

|

Microcontroller › 8051 › Rfid ACCESS CONTROL system

  • This topic has 1 reply, 1 voice, and was last updated 10 years ago by kalpana.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 14, 2015 at 7:00 am #4102
    kalpana
    Participant

    Hi 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]='';modem1[12]='';modem2[12]='';
      
     
      
      
     
    while(1)
     {
       
    if((!strcmp(modem,card1))==(!strcmp(modem1,card2))==(!strcmp(modem2,card3)))
     {
    LCD_Data(0x01,0);
    LCDStringXY(" CARDS        ",0,1); 
     
            LCDStringXY("   AUTHORIZED",1,0); 
    _delay_ms(600);
     
     
      LCD_Data(0x01,0);
    LCDStringXY("RELAY 1 ON   ",0,1); 
          _delay_ms(300);
     
     ip1 = 1;
     ip2 = 0;
     _delay_ms(350);
     ip1 = 0;
     ip2 = 0;
     
     
    goto start;
    }
     
     
     if((!strcmp(modem1,card2))==(!strcmp(modem,card1))==(!strcmp(modem2,card3)))
     {
     
     
    LCD_Data(0x01,0);
    LCDStringXY(" CARDS        ",0,1); 
     
            LCDStringXY(" AUTHORIZED",1,0); 
    _delay_ms(500);
     
     
      LCD_Data(0x01,0);
    LCDStringXY("RELAY 2 ON   ",0,1); 
          _delay_ms(300);
     
     ip2 = 1;
     ip1 = 0;
     
     _delay_ms(350);
     ip1 = 0;
     ip2 = 0;
     
     
    goto start;
    }
     
    if((!strcmp(modem2,card3))==(!strcmp(modem,card1))==(!strcmp(modem1,card2)))                //checking for enrolling
       {
        buz=0;
                                                      
        LCDStringXY("CARDS",0,1);
                                                        
        LCDStringXY("  UN AUTHORIZED",1,0);
     
        _delay_ms(500);
     
    buz=1;
    goto start; 
      }
     
     }
     
     }
     

     

    November 14, 2015 at 7:03 am #13486
    kalpana
    Participant

    Please any one help me out to improve my code

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Quick question on capacitors value in UF December 9, 2025
  • EEPROM not being written or read on dsPIC30F2010 December 9, 2025
  • Want Thermal Camera with Fixed Thermal Span option December 9, 2025
  • Printer loop December 9, 2025
  • mechanism to shutdown feeding when sensor temperature rises December 9, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise