Simple Circuit Creates Magnetic-Card Lock

Nov. 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...

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.

Sponsored Recommendations

The Importance of PCB Design in Consumer Products

April 25, 2024
Explore the importance of PCB design and how Fusion 360 can help your team react to evolving consumer demands.

PCB Design Mastery for Assembly & Fabrication

April 25, 2024
This guide explores PCB circuit board design, focusing on both Design For Assembly (DFA) and Design For Fabrication (DFab) perspectives.

What is Design Rule Checking in PCBs?

April 25, 2024
Explore the importance of Design Rule Checking (DRC) in manufacturing and how Autodesk Fusion 360 enhances the process.

Unlocking the Power of IoT Integration for Elevated PCB Designs

April 25, 2024
What does it take to add IoT into your product? What advantages does IoT have in PCB related projects? Read to find answers to your IoT design questions.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!