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

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

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