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

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!