Read Smart Cards With A BASIC STAMP

March 8, 1999
With eight general-purpose I/O lines and a regulated 5-V output, the BASIC STAMP 1 (created by Parallax, Rocklin, CA) can easily be interfaced to a standard smart-card connector (...

With eight general-purpose I/O lines and a regulated 5-V output, the BASIC STAMP 1 (created by Parallax, Rocklin, CA) can easily be interfaced to a standard smart-card connector (see the figure). Only four I/O lines, sometimes three, are needed to communicate with most of the “synchronous” smart cards, such as prepaid telephone cards, loyalty cards, or disposable “token” cards of all kinds.

The P0 to P3 I/O lines are still available for any application, related or not, to the “smart card” function.

Reading a card requires only a very short software routine. The example provided (see the listing) first resets the smart card, then reads 256 bits and stores them permanently into 32 bytes of the BASIC STAMP’s internal EEPROM memory.

Of course, a smaller number of bits could be read, at any valid location. This depends on the requirements of the application (the simplest smart cards contain only 104 bits, and the so-called “ID number” rarely exceeds 96 bits in length).

A very similar routine (using the EEPROM “read” instruction instead of the “write” instruction) could be used to check the contents of the smart card against what was previously recorded into the EEPROM.

Inserting a suitably “learned” card into the connector could energize a relay via one of the P0 to P3 I/O lines. It also could allow the execution of another part of the program, much like the way a “dongle” functions on a PC. Being powered through the “card present” contact of the card connector, the BASIC STAMP will run for quite a long time using a 9-V battery.

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!