Saturday, September 11, 2010

Project Phase 1: RFID READER


    RFID reader reads EM4100 family transponder tags. Each tag contains a 10 unique data byte. The reader has a 12 byte output with one start and stop and the 10 unique data byte. The start and stop bytes are used to identify that a correct string has been received from the reader.There is a LED provided to indicate the detection of the card. Normal detection range of the reader is 10-15cm for the tags. The power requirement for RFID reader is 7-9V DC.
    RFID reader connects directly to an RS-232 compatible interface. When the RFID is powered up,then a green LED will be ON.When the antenna gets signal from the transponder tag a red LED starts blinking.If a transponder tag is place within the range of RFID reader a unique 10 byte ID of the tag which is printable ASCII string is passed to the PC.
    As the first phase of our project, we had connected this RFID reader to our PC through RS-232 serial port. We are using python as the programming language. We have to install pyserial for programming using serial ports. Following is a simple program in python used to retrive data from the serial port.

------------------------------------------
import serial
p=serial.Serial('/dev/ttyS1')
def readport(port):
    x=port.read(12)
    return x
r=readport(p)
------------------------------------------

    The function readport() returns the string that is read from theserial port. By importing a module serial we can access the serial ports.
  ser=serial.Serial('/dev/ttyS1') opens the port ttyS1. ser.read(100) reads the data from the ttyS1 up to 100 bytes.

    Our plan is to pass the retrived data to a database so that we can get the complete details of the person using the tag. We are using Google Appengine for this process.

2 comments:

  1. You should not "open" /dev/ttyS1 every time readport is called --- do it only once and pass the the object returned by serial.Serial() as parameter to readport:

    p = serial.Serial('/dev/ttyS1')

    def readport(port):
    --- do whatever you want ---

    r = readport(p)

    ReplyDelete