Shop OBEX P1 Docs P2 Docs Learn Events
Can the RFID Reader detect a tag that is in range when the reader is enabled? — Parallax Forums

Can the RFID Reader detect a tag that is in range when the reader is enabled?

rmcbrmcb Posts: 39
edited 2011-08-12 10:17 in Accessories
I have a program that detects a tag correctly when the reader is first enabled and then the tag is brought into range but it doesn't detect or read the tag when the tag is brought into range and then the reader is enabled.

I was hoping that cycling the reader off and then back on would cause it to detect a tag that is already in range. What I'm trying to do is use the reader to rotate a servo when it detects the tag and then keep the servo rotated while the tag is in range, only rotating it back to it's original position when the tag is moved out of range.

Tech support's response is that the reader can't do what I'm asking it to do, but I wanted to see if anyone on the forum might have had a different experience.

Thank you

Comments

  • xanatosxanatos Posts: 1,120
    edited 2011-08-02 15:12
    I don't have the specs for the RFID reader in front of me, but if it doesn't have provision to continually scan for tag presence, you could accomplish the same with a second piece of hardware - a proximity sensor of some sort.

    You could have a reflective or transmissive sensor (depending on what else needs to happen with the tag, positioning, etc), and when the prox sensor is triggered, it would then poll the reader. If the item triggering the prox turns out to be an RFID item, do what you want, and it'll continually poll the prox sensor. As long as the prox sensor stays active, it'll keep your item in the state you wish. Once the prox sensor stops detectingt, it'll reset everything back to the ready state.

    If the prox sensor gets triggered but the RFID reads null, then nothing happens.

    Are you following this line, and does it make sense/is it helpful?

    Dave
  • rmcbrmcb Posts: 39
    edited 2011-08-02 16:03
    Xanatos,

    Like that handle, btw. Following it perfectly and had pretty much come to the same conclusion, so I ordered the PIR sensor to do just that. I thought about the PING but I'm only looking for a range 2-10 inches and so thought that the PIR would be a better fit. I plan to use the PIR in one of two ways. I will use it to detect something within range and then activate the reader to see if the tag is also in range, then open the servo if it is and then keep the servo open while the PIR tells me that something is in range. Once there is no longer something in range I close the servo. The other option and the one that I like better is to open the servo when the tag is in range and then basically ignore the rfid reader from that point onward, relying on the PIR to let me know if there is something in range to keep the servo open. Once the PIR says that there is nothing in range any more then close the servo and re-activate the reader to wait for another tag.

    Your thoughts?

    Ryan
  • xanatosxanatos Posts: 1,120
    edited 2011-08-02 18:40
    Hi,

    Option 2 is my thinking. Once the PIR AND the RFID are indicating, you only need to monitor the PIR to keep the gate in position.

    Xanatos isn't just a handle - it's actually my last name. Turns out I'm an eccentric billionaire technologist industrialist. Can't seem to remember where I put all the money, though! :-)

    Dave

    xanatos.com
    xanatronics.com
    Xanetics Research - coming soon
  • rmcbrmcb Posts: 39
    edited 2011-08-03 14:59
    Thanks very much,

    Never can tell when it will be helpful to know a billioniare technologist industrialist, who also is a martial arts expert. ;)

    I'll let you know how it goes with the PIR.

    Thanks again,

    Ryan
  • Jimmy LiebJimmy Lieb Posts: 46
    edited 2011-08-03 15:12
    The PIR is a good bet. No, the RFID reader cannot monitor tag presence.
    Maybe, if you didn't want to use the PIR, you could scan for the tag every 1/2 second, or something like that. If it suddenly stops picking it up, the program can assume that it is gone.
  • rmcbrmcb Posts: 39
    edited 2011-08-03 17:14
    Thanks Jimmy,

    That's what I thought as well, but what I've found and what led to this post was that you can scan for the tag, via the PBASIC SERIN command, as often as you want but it doesn't pick up a tag that is already within range. I put it in a loop and cycled, with a time delay, and it would pick up a tag when it was brought into range after the SERIN command was run, but would not register one if the tag is already in range when the SERIN command is run.

    Thanks for the suggestion though,

    Ryan
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-03 22:10
    As I remember, the RFID reader continually attempts to read an RFID tag when the enable line is active. Each time it reads a tag, whether already present within range or brought into range while the enable line is active, the reader transmits the tag ID via its data line. There's a delay in the process for the reader to do its processing, so the reader will send out the ID, appear to pause briefly, then send out the same ID again if the tag is still within range. The Stamp may not see the transmitted ID if it's doing anything else but waiting for serial data with a SERIN. If you don't use a WAIT($0A) clause in the SERIN, the Stamp may stay out-of-sync with the RFID reader.
  • Jimmy LiebJimmy Lieb Posts: 46
    edited 2011-08-04 11:28
    Yes, the WAIT($0A) is important. Mr. Green, I have had that problem before too, where they get out of sync.
    Rmcb, you should try adding the WAIT($0A), like this:

    SERIN RX, T2400, [WAIT($0A), SPSTR 10]

    It wont be the same in all cases, but it should be organized sort of like that. The WAIT($0A), then whatever else you already have here.
    If you don't quite understand putting in the wait command, you might try simply disabling and enabling the reader each time. I believe that would work? Correct me if I'm wrong, Mr. Green. I will pretend that the reader is plugged into pin 15, It could be as simple as this:

    HIGH 15
    PAUSE 5
    LOW 15

    I think that would work...
    this is about as far as my knowledge of serial communications goes, so I cant be of much more help, But good luck, I hope that it all works out!

    ~Jimmy
  • Jimmy LiebJimmy Lieb Posts: 46
    edited 2011-08-04 11:31
    I forgot to mention:
    I know that the reader will continuously scan, I have used the MAX323E on my Propeller professional dev. board, and hooked it up straight to the parallax serial terminal window. when I held a tag up to it, The tag's serial number would keep appearing in the terminal window, over and over. So, I know it can be done.
    Good luck,
    ~Jimmy
  • rmcbrmcb Posts: 39
    edited 2011-08-08 15:55
    Mike/Jimmy,

    Thanks very much for the information. I will try it out. Help me understand what exactly the WAIT($0A) is waiting on. Is it any input, or any hex input, or what exactly? I originally had my SERIN command coded like this:

    SERIN RX, T2400, [WAIT($0A), STR buf\10]

    Which I interpreted as waiting on some input to be read, (any input) and putting what it reads into the buf array (which is 10 bytes long).

    Then the rest of the pgm checked the contents of the buf array to see if it contained a valid tag.

    I changed it, I thought, to wait on a specific tag, thinking that this would be more efficient, but apparently not.

    SERIN RX, T2400, [WAITSTR MyTag\10]

    With the MyTag array containing the tag that I am looking for.

    Thanks very much for your assistance,

    Ryan
  • rmcbrmcb Posts: 39
    edited 2011-08-12 10:17
    Hi Mike

    Thanks very much for the information. I've tested and have some unexpected results. In short, I had been doing all of my testing with the key fob tag that came with the "RFID Reader USB and Tag Sampler Kit" and it was not behaving as I would expect, as in not detecting the tag when it was 2 inches in front of the reader when the reader was enabled. I decided to test with a different tag and used one of the rectangular, credit card sized tags. Lo and behold, it works perfectly and is being detected just as predicted. I thought it might be the type of tag and tried it with another of the rectangular credit card sized ones that came with the reader when I ordered the serial RFID reader and it didn't behave in the same way. It was also not being detected when in range.

    So, in summary, the program works but the tags don't respond consistently. BTW, all tags came from Parallax, either with the Sampler kit that came with the USB reader or the two that came with the serial reader.

    Any thoughts on why this would be?

    Ryan
Sign In or Register to comment.