PDA

View Full Version : Smartcard projects - anyone tried 'em?



nolly
30-01-2006, 17:32
I have used the Revolution Smartcard programmer and reader in classroom demonstrations. ( <A href='http://www.mutr.co.uk/products.aspx?catID=103' Target=_Blank>External Web Link</a>
I am keen to see if there is a way to incorporate the use of smartcards into A Level projects without the use of these programmers. Presumably they could be read like a memory chip or programmed like a PIC. Anyone out there any experience or could you point me to any articles?
Thanks,
nolly

Edited by - nolly on 1/30/2006 4:34:25 PM

Technical
30-01-2006, 18:00
These particular smartcards use a very specific communications protocol and would be difficult to use in the classroom 'as is'

However you can buy so call 'wafer cards' which contain a normal PIC and EEPROM chip. These are commonly used for hacking consumer goods and so info is all over the internet! These would be more easy to interface to.

hippy
30-01-2006, 18:39
Not sure that is a Rev-Ed programmer, but there are two types of &quot;smart card&quot; ...

The &quot;actually not very smart card&quot; which just contains an Eeprom ( often I2C or maybe SPI ) has the power and lines needed to control the Eeprom brought out to the familair pad on the credit card carrier.

Its smarter brother contains a processor ( Microchip, Atmel or other ) which connects to the pads and can be programmed through the pad, and when running also communicates through the same pads. The processor itself often connects to an Eeprom within the card, but may sometimes only have its own internal Eeprom for storage. The greater the cost, the more powerful and capable the processor or the more Eeprom is included. These are also often cald &quot;Wafer Cards&quot;.

In the simple data card, it's usually just a case of connecting power and PICAXE control lines to the pads and using the card insertion switch to indicate when the card is in place or not. When in place, the card is assessed just as if it were any other I2C/SPI Eeprom connected to the PICAXE.

Proper smart cards usually use a serial protocol which allows a microcontroller to identify the card, ask for data and tell it to write data. This is how credit cards work and the way the data is held, what it means and how it is to accessed is defined by various standards. The processors on credit cards include encryption mechanisms so if the controller doesn't give the card the right password etc it won't play ball and won't allow anything to be done with it.

Programmable smart cards are the same except they can be programmed to implement any protocols and mechanisms they wish to. It's like putting a PICAXE and Eeprom in a black box and just bringing out its serial and PSU connections.

Programmable smart cards can be programmed in assembly language or high level languages and some contain pre-programmed firmware to run Basic or Java programs.

I'm not sure how the cards used in the MUTR products work using &quot;SmartBasic&quot;, but they are either 'dumb' data cards which are programmed to hold instructions which another processor interprets to do what they are programmed with, or they contain a processor which is programmed to send out commands to additional hardware to achieve what they are programmed to do.

The questions then are, what sort of smart cards are you thinking of using, and what do you hope to do with such smart cards ?

And a word of caution - Smart cards, in particular wafer cards ( going by names like Gold, Silver, Green etc ), are often used by hackers to emulate the cards used to authorise satellite TV reception etc. A number of sites offer tempting information on such things but are there simply to entice visitors to have software virus infections thrown at them. Some software downloads may also contain viruses. When visiting sites dealing with smart cards, and especially when downloading software, make sure you have a firewall installed, latest security patches in place and your virus scanner up to date etc.

hippy
30-01-2006, 18:54
What a typical &quot;Wafer Card&quot; looks like inside ...

http://www.maxking.com/images/mm2gold64.gif

A &quot;Fun Card&quot; is similar but uses an Atmel processor.

nolly
31-01-2006, 00:23
Thanks for the info which should get me started. I imagine that pupils would be interested in using them to model current usage of cards e.g. door entry &amp; security systems, perhaps with LCD displays displaying the name of the cardholder, vending machines with the card recording the balance remaining, pay-as-you-view cards as used in hospitals etc.
I'll get hold of some wafer cards &amp; sockets (or whatever they're called) to make connections, and start experimenting.
Thanks,
Nolly

BrendanP
31-01-2006, 06:41
Silicon Chip magazine did a article on a kit availiable from Jaycar electronics with a smart card and reader. I built it, it works well, the kit was around 80$ I think.

Â*

Michael 2727
31-01-2006, 10:11
You could use the DS18B20 as a smart card ID only, or an ID iButton, with the
&quot;readowsn&quot; command.

hippy
31-01-2006, 11:37
Or simply stick a PICAXE, and maybe I2C Eeprom, on a PCB/Strip-Board with a suitable connector and call it a Smart Card ! There seems no reason to me that a PCB can't be designed which will mate with a proper smart card socket.

With real &quot;Wafer Cards&quot; it's necessary to put a program in the PICmicro before they can be used, which means having to learn Assembler or a high-level language ( and find a compiler ), get a programmer for the card, and debug the program before you can do anything else with it.

Building your own PICAXE smart cards would allow students to not only use the cards but also program the smart cards to add password protection and simple encryption etc. They can be given a unique ID by adding any Dallas 1-wire chip.

I don't know the capabilities of your students, but using PICAXE programming on both the smart card readers and the cards themselves would be easier than having them try and use cards which require much more complex programming and debugging.<code><pre><font size=2>.------------------------------.-----.
| __|__ |
| 100nF --.-- |
| .----.---------. | |
`----| +V | 0V |----.-----^-----|------------------.
}----{ .----{ .|. | .----------. |
| | | | |_| 10K `---| +V 0V |---'
}----{ }----{ | .---| SI O0 |---.
| | | DX |----|-----------|---| X4 X1 | |
}----{ }----{ | ___ | | I3 X2 | |
.----| SO | | SI |----^---|___|---' `----------' |
| `----^----^----' 22K PICAXE-08M |
| |
`-------------------------------------------------------' </font></pre></code>

Edited by - hippy on 1/31/2006 11:01:42 AM