Hi there guys, I am doing a college project and am trying to make the arduino power an led when an rfid tag is present, and turn it off when the tag is out of range of the antenna.
The rfid module i have is: http://www.seeedstudio.com/depot/125khz-rfid-module-uart-p-171.html?cPath=144_153
the rfid tags i have are: http://www.seeedstudio.com/depot/RFID-tag-combo-125khz-5-pcs-p-700.html
I followed this example (http://www.instructables.com/id/Arduino-and-RFID-from-seeedstudio/) closely and managed to get it working, but this only allows the arduino to read the tag once then stops reading, whereas i want it to keep on reading and power the led when the tag is within range and turn off when it isnt in range.
Please help me this needs to be done very soon!
Regards,
Jake912
Only thing you have to do is keep polling the reader. How fast you have to poll depends on what you can tolerate and what the Arduino needs to do besides RFID.
How would i do that exactly? could you give me an example?
card can’t be read again within the range of read antenna after read once. User must move it out of reading antenna range first, swipe card again & can be read.
So septillion how do you account for the fact that it says this in the data sheet for the device?
Only thing you have to do is keep polling the reader. How fast you have to poll depends on what you can tolerate and what the Arduino needs to do besides RFID.
Guys could someone please tell me how to have the arduino constantly searching for the RFID tag as it reads it once then the code stops, is there a function that will repeat this step continuously as the void loop() function doesnt seem to work
the void loop() function doesnt seem to work
Wow 10 years of people using Arduinos and you are the first to spot this?
Now don't be silly.
The reader will send you the ID code when the tag first enters the field, then it will only send the ID code again once there are no tokens in the field and then a token enters the field.
If you want a reader that constantly sends the token when it is in the field, then get another reader or design your own that gives this function.
http://playground.arduino.cc/Main/DIYRFIDReader
so is it definitely not possible with the reader that i have purchased? I would have thought that the arduino was controlling the rfid module so could tell it when to search for the tag?
I would have thought that the arduino was controlling the rfid module so could tell it when to search for the tag?
No that is not how it works. The RFID reader is it's own system and only does what the designers have told it to do. The ones I used to design had a PIC chip controlling what it did. It had many options and one of them was a repeat output but only in the Wegand mode. There were things a user could do to put the reader into various modes. However, these were not hobby type readers but professional readers costing upwards of $300 each.
However, these were not hobby type readers but professional readers costing upwards of $300 each.
In this case how would I get my hands on a reader which is within the same price region as the RFID module I have that would allow me to constantly search for the tag?
Thank you for all your help grumpy_mike 
The only way would be to make your own.
Arduino Playground - HomePage
Is this the only diy rfid reader as this looks very complicated and goes way over my head!
Also is there any way in which i could modify the RFID module i have to allow for it to search for the tag continuously?
The reader will send you the ID code when the tag first enters the field, then it will only send the ID code again once there are no tokens in the field and then a token enters the field.
Ive just had a think about what you said and all i want to know is when the tag is in the field, then when the tag isnt in the field, i can bypass the whole repeatedly sending out a signal if i can communicate with the module and get it to tell the arduino when the tag enters the field and when it leaves the field cant i?
if i can communicate with the module and get it to tell the arduino when the tag enters the field and when it leaves the field cant i?
Yes but the RFID reader in question does not allow that sort of information exchange does it?
I'm not sure, is there some sort of latch that i can do to gather the information from it and be able to read it on the arduino?
What if you turn the reader off and on? Does it then re-recognise the same card? Can it be turned off and on more than once per second?
The page linked in the first post says that this part is obsolete and links to the replacement. The new one has Weigand mode, so perhaps it does allow this mode of operation?
What if you turn the reader off and on? Does it then re-recognise the same card?
It could be, it depends on the reader design.
Can it be turned off and on more than once per second?
In my experience this is too fast and it normally takes about 2 to 3 second for a reader to start up.
What if you turn the reader off and on?
This worked great actually! i set the delay to 1 and it is just constantly reading it! Thank you for your help!
#include <SoftwareSerial.h>
SoftwareSerial rfid = SoftwareSerial(5,6);
String msg;
String ID ; //string to store allowed cards
void setup()
{
Serial.begin(9600);
Serial.println("Serial Ready");
rfid.begin(9600);
Serial.println("RFID Ready");
}
char c;
void loop(){
digitalWrite(5,LOW);
digitalWrite(6,LOW);
delay(1);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
if(Serial.available())
{
while(Serial.available())
Serial.write(Serial.read());
}
while(rfid.available()>0){
c=rfid.read();
msg += c;
Serial.println(msg);
Serial.println(msg.length());
}
}