Hi all,
I want to read the data of a smart card with arduino but it isn't as simple as i thought.
I have a smart card that I don't know of which type it is, so I discover that by sending a "answer to reset" command to the card I should get a 4 byte string that identify the card type. My problem now is how to get this code.
I've plugged the card to arduino by following this image:

1. VCC (alimentation)
2. RST (remise à zéro)
3. CLK (horloge)
4. D+ (USB Inter-chip)
5. GND (masse)
6. SWP
7. I/O (entrée/sortie)
8. D- (USB Inter-chip)
I've plugged 1 with the 5v pin
2 with the 3 analog pin
3 with the 5 analog pin
5 with the GND pin
7 with the 4 analog pin
To send an ATR command you have to held the reset pin high, send one clock, relase the reset pin and then you can read the 4 byte data.
Here is shown well:

I've wrote this code:
#include <Wire.h>
int resetPin=3;
int clockPin=4;
int dataPint=5;
void clock(){
analogWrite(clockPin, 1023);
delay(70);
analogWrite(clockPin, 0);
}
void setup(){
Wire.begin();
Serial.begin(9600);
Wire.beginTransmission(0x00);
analogWrite(resetPin, 1023);
clock();
analogWrite(resetPin,0);
Serial.println(Wire.receive());
Wire.endTransmission();
}
void loop(){}
Obviously it doesn't work... Any idea about how to do this operation? I can't find any reference on the internet...
Thanks