Image

This is my first 13,56MHz RFID Reader Setup: Arduino, SM130 with PCB Antenna. Parts of the Wiring are covered by the RFID module, but they get understood when you have a look on the according scheme.

Image

Like the scheme, also the code by A. van der Meer worked well for me:
//Simple communication sketch for the SM130 RFID-reader.
//The sketch reads a tag end sends it over the Serial port.
//Made by A. van der Meer (AvdM.nl)
// http://www.avdm.nl/?p=164

//#include <NewSoftSerial.h>
//NewSoftSerial mySerial(6, 7);

#include <SoftwareSerial.h>

SoftwareSerial mySerial(6, 7);

String temp;
String reader;
String tag;

void setup()  {
Serial.begin(57600);
mySerial.begin(19200);//begin mySerial at 19200(standard baudrate for the SM130
}

void loop() {

mySerial.print((char)0xFF); //first byte for indicating a new frame
mySerial.print((char)0x00); //a reserved byte for future use; it always has to be 0x00
mySerial.print((char)0x01); //the length of the frame
mySerial.print((char)0x82); //the real command: seek for tag
mySerial.print((char)0x83); //CSUM byte

delay(500); //a small delay is needed for giving the rfidreader time

while (mySerial.available() > 0) {
temp=String(mySerial.read(), HEX);
reader=reader+temp; //compile the answer of the rfidreader
}

if(reader!=”ff02824cd0″){//ff02824cd0 is the answer if no tag is found
tag=reader.substring(17,25); //distract the tagid from the answer
Serial.println(tag); //print the found tag over the Serial port (usb)

}
reader=””;

}

The code by Ben Lamb could be compiled, but I could not get any RFID tag ID be printed in the arduino serial monitor. Haven’t spend more time, to get that version running. I found some more example code by Marc Boon, which I have not tested yet. Always be patient with the example code. Once in a while there some issues on the Arduino library SoftwareSerial, which changed to the NewSoftSerial.

Advertisements