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

TTI Transportation Resource Center

April 8, 2024
From sensors to vehicle electrification, from design to production, on-board and off-board a TTI Transportation Specialist will help you keep moving into the future. TTI has been...

Bourns: Automotive-Grade Components for the Rough Road Ahead

April 8, 2024
The electronics needed for transportation today is getting increasingly more demanding and sophisticated, requiring not only high quality components but those that interface well...

TTI Rail Transit Line Card

April 8, 2024
TTI stocks premier interconnect, passive and electromechanical components for rail systems as diverse as door control, HVAC and cabin entertainment, trackside safety, communications...

Littelfuse: Take Charge for Peak Performance in Material Handling Evs

April 8, 2024
As material handling electric vehicles such as automated guided vehicles (AGVs), autonomous mobile robots (AMRs) and forklifts become an integral part of Industry 4.0, Littelfuse...

Comments

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