RFID reader

Hello all,
I’ve just received a GHI RFID module and it works like a charm once connected with a Spider Board :slight_smile:

I was wondering if it will be possible to modifiy the reader behaviour so that it sends continuous data when the rfid car is near.
What I would need is the possibility to read the tag whed the rfid card is positioned over the reader and also the possibility to intercept when the card is removed from over the reader.

Anyone knows if it would be possible?

Thanks in advcance
Angelo

The driver code is as follows. GHI could easily make the cardID a public property which you could then poll to detect when the card enters & leaves the range. You could do the same in the interim if you wish by downloading their driver code here:

http://gadgeteer.codeplex.com/SourceControl/changeset/view/22735#273369

        void _readThreadStart()
        {
            int bytesToRead = 0;
            byte[] readBuffer;

            string cardID = new string(null);

            for (; ; )
            {
                bytesToRead = serialPort.BytesToRead;

                if (bytesToRead > 0)
                {
                    readBuffer = new byte[bytesToRead];

                    serialPort.Read(readBuffer, 0, bytesToRead);

                    for (int i = 0; i < readBuffer.Length; i++)
                    {
                        cardID += (char)readBuffer[i];

                        if (cardID.Length == ID_LENGTH)
                        {
                            OnIDReadyEvent(this, cardID);

                            System.Threading.Thread.Sleep(100);

                            cardID = new string(null);

                            break;
                        }
                    }
                }

                System.Threading.Thread.Sleep(10);
            }
        }

@ ianlee74 - Unfortunately, that will not work as planned. The read thread only begins to build a string when data is received on the serial port. Once a full ID has been read, the event is fired and the string is cleared. Our module will only write to the serial port when a new ID card has been put into its proximity.

Ah… I see. Angelo, it looks like you’re out of luck.

You could use two readers. One when the car comes into the stop point and another as it leaves. That way you could time the interval too.

@ Angelo_ita - I have a 13mhz module coming soon which will be able to do all that…

@ ianlee: I’ve stepped into the driver code and it blocks until the serial receives data, as Steven says…
@ steven: was wondering if it will be possible to modify the sensor firmware :slight_smile:
And then add a public method ReadTags() to the driver that we can poll with a timer.

@ justin: where can we read more infos on your reader?

Thanks all for the fast response.
Angelo

@ Angelo_ita - have a look here http://www.tinyclr.com/forum/topic?id=8871
Gadgeteer board for this module https://www.sparkfun.com/products/10126