Electronic Design

  
Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


[Ideas For Design]
Simple Circuit Creates Magnetic-Card Lock

Contributing Author  |   ED Online ID #6174  |   November 8, 1999


This is a simple but interesting circuit to make a magnetic card lock. Using this lock system, shown in the figure, you can open a door, switch on a machine, start a process, etc., all by merely swiping a magnetic card.

The first step is to close jumper JP1 and swipe a suitable card through the reader. If the read operation is successful (the LED connected to the RA2 pin switches on for about two seconds), it will save the card information in EEPROM memory. Then, jumper JP1 is removed, leaving the system in a “read” state.

Once configured, when a card is swiped, the system will check first if the card is correct (first character found, no parity error, etc.). If it’s also the previously saved card, a pulse will be generated on the corresponding output for about two seconds. If the magnetic card isn’t correct, it will indicate the error detected (parity error, control character error, missed start character, etc.).

The only “special” device needed to build this circuit is a manual magneticcard reader—the type used with standard credit cards. For this development, an LCC LM300 manual magnetic-card reader was used for ISO 2 strips conforming to ISO 7810, 7811, and 7812 specifications. It is important to carefully verify the manual reader pin assignments because they are sometimes in a different order.

At the core of the system lies the Microchip PIC16F84 microcontroller. This device has a 64-byte EEPROM in which the desired card information is saved. It also has a timer that’s used as a time-out function to detect the case of an incomplete read operation.

After sliding a card through the reader, the microcontroller’s outputs are set to a high or low level, depending on the result of the operation (Table 1). Acceptable magnetic cards contain the data represented in Table 2.


Reprints   Printer-Friendly  Email this Article  RSS    Font Size   What's This?


  • In EDA, A Year Of Mergers, Failed And Otherwise
  • 2008 BEST Electronic Design Winners
  • Engineers Rely On Internet For Product Info
  • Rochester Electronics Establishes New Design and Technology Group
  • November 17, 2008
  • Custom Sources Light Way To 22-nm IC Lithography
  • Software Turns Scopes Into Vector RF Signal Analyzers
  • Couple’s $15 Million Gift Advances Rice Engineering Education
    1) Behind The Bright Lights, LED Drivers Evolve To Meet New Requirements
    (732 views today)
    2) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (271 views today)
    3) Wi-Fi Chips Stand Out In A Sea Of Wireless Products
    (205 views today)
    4) What's All This "Adjustable Slew Rate Stuff," Anyhow?
    (187 views today)
    5) Ten Top Design Skills For Tough Times
    (184 views today)
    ALL TOP 20



    Reader Comments

    Thanks for posting this circuit, can you send me the code for the 16F84 please? I'll be very grateful

    Ignacio -November 10, 2008

    Nice project, could you please send the code of pic 16f84. Thanks.

    Hendra -September 28, 2008

    Hello ,great Project ,can u send me the pic program for this circuit

    Thanks.

    Harry -June 24, 2008

    this is amazing.

    wasif waheed -March 03, 2008

    your project is very good and excellent

    M.saravanan -February 25, 2008

    hi,could u pls send me the details about this project include the pic program.thanks in advanced.

    anne -February 11, 2008

    hey ,great circuit,can u let me the pic program for this circuit

    Anonymous -February 04, 2008

    thankx

    Anonymous -February 04, 2008

    thanks it's very useful please send me the program.I am a student in Mersin University

    OGUZ KOÇ -August 03, 2007

    thanks it's very useful please send me the program.I am a student in Mersin University

    OGUZ KOÇ -August 03, 2007

    thanks

    suresh namal -July 12, 2007   (Article Rating: )

    i want the circuit diagram of matel detector.cng remote &its programmingwith circuti diagram

    safeer -July 07, 2007

    thank u

    tushil -June 05, 2007   (Article Rating: )

    Rating Only

    Rating Only -June 05, 2007   (Article Rating: )

    v.good

    ahmed -May 13, 2007

    v.good

    ahmed -May 13, 2007   (Article Rating: )

    hi...i am making an electronic lock which output is connected to a a dc motor. could you please give me the code to program the pic for this project. not that i want an accurately timed output for the dc motor.

    haywakays -April 07, 2007   (Article Rating: )

    rtygrtyr

    Anonymous -April 01, 2007

    Does this circuit really work or do I have to build it myself to see. I have been reading some of the above comments containing info about a Source Code, Program, and Hex. Do I have to have a program encoded in the PIC16F84-EEPROM chip? Really I think you do not need to program the EEPROM IC, But I may be very wrong.

    E-DeVore -March 23, 2007   (Article Rating: )

    its very useful..........please send me the program ..............

    Anonymous -March 04, 2007

    Nice article.

    Anand Srivastav -December 26, 2006   (Article Rating: )

    I can't believe how many people say they want to use this for "their" project and want all of the code and circuit diagrams!! Figure it out for yourself, it's not that tough!

    Nice article.

    Anonymous -December 10, 2006

    Hello ! please can u send me the hex for the pic ? Thanks in advance

    antmar -August 30, 2006

    Could you also send me the enlarged circuit diagram of this project with each component specification. We are also seeking for the software programming to implement this circuit. Thak you

    Anonymous -August 24, 2006

    actually i need the program code and the logic of this project as i am making this as my final year project. Can you send them please. Thank you..

    Anonymous -August 24, 2006   (Article Rating: )

    I want to find a reader for magnetic card.Would you recommend me a simple circuit to do it. Thank in deep.

    Flashman -August 22, 2006   (Article Rating: )

    I want to find a reader for magnetic card.Would you recommend me a simple circuit to do it. Thank in deep.

    Flashman -August 22, 2006

    i'm an engg. student in my final year. i'm doin a project on magnetic swipe card reader. plz send the simplest detailed circuit diagram along with the components as soon as possible. hopin to get your reply soon......

    Pranay -August 17, 2006   (Article Rating: )

    Please send me more info about magnetic card, I need these for my project too, it would be very appreciated if you give me include the software. Regards

    H Winarta -July 26, 2006   (Article Rating: )

    sir i am final year BE student.i want to any project using magnetic-card

    senthil kumar -July 25, 2006

    hi

    this looks like an interesting project. I'm not a competent programmer, so any chance of getting the PIC code ?

    regards

    Anonymous -July 11, 2006

    Hi, i m a final year student and i m making a project on visual basic, in a storehouse moudle i.e inventory project ,i also have to attcah and implement a magnetic card technology to swipe in and out the details of each employee... can u please hlep me in its description and also the entity relation ship diagram... the firm has to issue some products to its employees on yearly basis like ..chlothes , shoes , etc.. please help in its desgin ..thnk you.. take care..godbless

    dj -July 01, 2006   (Article Rating: )

    Hope you can mail me copy of the circuit design with the specifications of the components and description of the design.

    Anonymous -May 04, 2006

    please send me the simplest circuit design with the most affordable components of an electronic swipe lock door system. I am an engineering student from the philippines. I really am in need of your help. I hope to hear from you soon...We need this design (affordable) because we are too few to shoulder a very expensive electronic swipe lock door system.thank you so much. godbless.

    krislet -May 04, 2006   (Article Rating: )

    Where can i find LCC LM300?

    Ajay -April 05, 2006   (Article Rating: )

    i too am working on a similar project but in my case i need the circuit diagram of a swipe through card reader also pls provide the detailed circuit diagram if possible

    parag -April 01, 2006

    Please if you could send me the code or hex for your circuit

    Adam -March 23, 2006   (Article Rating: )

    Sir, we want to implement this project as a part of our final year project.It would be of great help if you can provide with enlarged circuit diagram with each component specification and also software programming to implement this circuit.pls give pic 16f84 program in .asm& as hex file.

    sudhir -March 10, 2006

    I needed this for my project. Can you please send the asm code to my email. Or, can you please direct me to a site where I can find it? Help would be much appreciated.

    Thank you.

    Sunil -March 03, 2006   (Article Rating: )

    can u send me circuit for card PIN accessible to unlock doors? tnx!

    Anonymous -February 19, 2006

    Hi. Great idea! If it is ok, can you please send the asm code to my email? Or, if you have a site with the code, can you please refer it? Thank you.

    Jin -February 06, 2006   (Article Rating: )

    can u please give me the prog code for the Application , thank u.

    Srikanth -February 01, 2006   (Article Rating: )

    very usfule please can u send me hex file thanks

    Gamal -January 20, 2006   (Article Rating: )

    I AM INNOCENT!!!!

    Michael Jackson -January 09, 2006

    I tray to use many other application, but dont work, please can you give me source code. pls

    dan -December 26, 2005

    Very interesting, actually i need it for a part of my final project. Can you send me the program and the logic maybe. Thank you..

    frd -September 29, 2005   (Article Rating: )

    hi can u plz help me in making a circuit for an electronic lock which uses access cards.

    disha -September 27, 2005   (Article Rating: )

    Hi,can u help me to design a simple circuit for a magnetic card reader (interrupt) and the program.Best regards ...

    Madox -September 15, 2005

    hi Olaoluwa i'm murad from in dia in the same potion. i'm also planning to do a project on employee card reader for that what kind of circuit i need to build for reader plesae send me whatever information u have plesae

    murad

    murad -September 13, 2005

    kader ,tu as besoin de codes sources,de programmes,j'ai tout au niveau de lecteur carte magnetique salut

    kader,tu need source codes, programs, I have all on the level of reader magnetic chart hello

    dack -September 03, 2005

    Hello I am currently a student of third year mechatronics engineering, we have a task of making mini projects regarding pic controller, i saw your article, and found it very impressive, can i use it as my project?, if yes then i will be waiing for your response with the assebmly code and hardware list Regards Qadeer Ahmed

    Qadeer Ahmed -August 18, 2005

    Hello I am currently a student of third year mechatronics engineering, we have a task of making mini projects regarding pic controller, i saw your article, and found it very impressive, can i use it as my project?, if yes then i will be waiing for your response with the assebmly code and hardware list Regards Qadeer Ahmed

    Qadeer Ahmed -August 18, 2005   (Article Rating: )

    Can you give me a info about a magnetic swipe card?

    VinC -July 20, 2005

    can you please send me a software for this hardware? and can you give me a info about a magnetic swipe card? thank you!

    lui -July 05, 2005   (Article Rating: )

    Site is average. Try to make it better.

    jomin dolges -July 01, 2005

    I like your website. It's cool...

    mersol -June 27, 2005   (Article Rating: )

    I would like very much if you could send the source code for the PIC. Thank you.

    ovolpato -June 21, 2005   (Article Rating: )

    Can you give more info about magnetic card on how they program it and what do I need to create a file like info when you swipe the card?

    Don -June 09, 2005

    I am building a card and reader for my final year project and will really appreciate if you can can give more detail on your design and help with the programming of the controller. Pls, it is urgent.

    Olaoluwa -May 30, 2005

    can we use more than one card in same circuit,like for access of 2 or more persons?

    prateek -May 10, 2005   (Article Rating: )

    pleae you send me ,hex ,software

    ali -April 13, 2005

    tech. info very usefull

    orhan orekici -April 09, 2005   (Article Rating: )

    Heyy, It is great. I can earn 1 million:) I need this kind of reader very much. Can you send the program of the PIC to me? If you do that, you will make me very, very hapy. Thank you in advance.

    Anonymous -March 02, 2005

    Very good, but it would be more interesting if you could keep on the links you mentioned inside the article, like the icon mentioned there.

    Gustavo -November 17, 2004

    We are implementing this circuit as our final-year engineering project for our academic curriculum. We need an enlarged circuit diagram with each component specification. We are seeking for the software programming to implement this circuit. We need pic 16f84 program in .asm& as hex file. Please help us.

    Sushil -August 30, 2004

    POST YOUR COMMENTS HERE
    Name:

    Email:
    Your Comments:

    Enter the text from the image below


    Please refresh the page if you have trouble reading this text.

    Search Electronic Design
         
      
     
    Web Seminar
    Sponsored By:
    Title: Read Pacing: A Performance Enhancing Feature of PCI Express Gen 2 Switch Devices
    Speakers: 
    Date: 07/01/08
    Register: 

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF
    Mobile Dev & Design Schematics Find Power Products Military Electronics EE Events Related Resources