UPDATE: Now it works with IDE 021
Remove these ads by
Signing UpStep 1: What you gonna need?
- RFID Sensor from seeedstudios
- Wires
- Protoboard
- RFID tags (125kHz) from seeedstudios
Remove these ads by
Signing Up
PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format.
You also have the ability to customize your PDF download.
Can you send me pics of your circuit and your code?
I did not try this conde with UNO. With any one here make it works with this arduino please help us.
Cya
Can you send me pics of your circuit and your code?
I did not try this conde with UNO. With any one here make it works with this arduino please help us.
Cya
Tx from RFID board goes to Digital PIN 5 on Arduino Board, not PIN 2.
But the old sketch is point at PIN 2, so I think that why some people said that's not work.
I am interested in winding my own antenna for 125Khz RFID.
Any ideas or links about the physical properties of the antenna?
Thank you
otaviofedrizze@gmail.com
Regards
Otavio
Instructable update and code uploaded.
#include
#define ADD_TAG_CODE "200537982AA" //change this ID with your own card TAG
#define DEL_TAG_CODE "20057370C6E"
SoftwareSerial mySerial(2, 3); // RX, TX
String msg;
String ID ; //string to store allowed cards
void setup()
{
Serial.begin(9600);
Serial.println("Serial Ready");
mySerial.begin(9600);
Serial.println("RFID Ready");
}
char c;
void loop(){
while(mySerial.available()>0){
c=mySerial.read();
msg += c;
//Serial.println(msg); //Uncomment to view your tag ID
//Serial.println(msg.length());
}
msg=msg.substring(1,13);
if(msg.indexOf(ADD_TAG_CODE)>=0) add();
else if(msg.indexOf(DEL_TAG_CODE)>=0) del();
else if(msg.length()>10) verifica();
msg="";
}
void add(){
Serial.print("What TAG do you wanna grant access?: ");
msg="";
while(msg.length()<13){
while(mySerial.available()>0){
c=mySerial.read();
msg += c;
}
}
if(ID.indexOf(msg)>=0) {
Serial.println("\nAccess already granted for this card.");
msg="";
}
else{
Serial.print("Card: ");
Serial.println(msg);
ID += msg;
ID += ",";
//Serial.print("ID: ");
//Serial.println(ID);
msg="";
Serial.println("Access granted for this card.");
}
}
void del(){
msg="";
Serial.print("What TAG do you wanna deny access?: ");
while(msg.length()<13){
while(mySerial.available()>0){
c=mySerial.read();
msg += c;
}
}
msg=msg.substring(1,13);
if(ID.indexOf(msg)>=0){
Serial.println(msg);
Serial.println("TAG found. Access for this card denied.");
//ID.replace(card,"");
int pos=ID.indexOf(msg);
msg="";
msg += ID.substring(0,pos);
msg += ID.substring(pos+15,ID.length());
ID="";
ID += msg;
//Serial.print("ID: ");
//Serial.println(ID);
} else Serial.println("\nTAG not found or already denied");
msg="";
}
void verifica(){
msg=msg.substring(1,13);
if(ID.indexOf(msg)>=0) Serial.println("Access granted.");
else
Serial.println("Access denied.");
}
sketch_nov02a:5: error: 'NewSoftSerial' does not name a type
sketch_nov02a.cpp: In function 'void setup()':
sketch_nov02a:14: error: 'RFID' was not declared in this scope
sketch_nov02a.cpp: In function 'void loop()':
sketch_nov02a:22: error: 'RFID' was not declared in this scope
sketch_nov02a.cpp: In function 'void add()':
sketch_nov02a:40: error: 'RFID' was not declared in this scope
sketch_nov02a.cpp: In function 'void del()':
sketch_nov02a:66: error: 'RFID' was not declared in this scope
Please help me fix this!
You can find here: http://arduiniana.org/libraries/newsoftserial/
you can find words:
*****************************************************************************************
"The latest version of NewSoftSerial is available here: NewSoftSerial12.zip. Note: donât download this if you have Arduino 1.0 or later. As of 1.0, NewSoftSerial is included in the Arduino core (named SoftwareSerial)."
*****************************************************************************************
This means that on Arduino 1.0 and later this library named SoftwareSerial!
Thats why your program does not work...
1.Green excepted
2.red denied
3.yellow ready for an RFID card reprogramming
This would also make it easier for for people like me to connect a motor to the place the led was.
Thank you very much.
http://www.jayconsystems.com/product_detail.php?prod_id=283
it with this problem
sketch_mar19a.cpp:1:27: error: NewSoftSerial.h: No such file or directory
sketch_mar19a:5: error: 'NewSoftSerial' does not name a type
sketch_mar19a.cpp: In function 'void setup()':
sketch_mar19a:14: error: 'RFID' was not declared in this scope
sketch_mar19a.cpp: In function 'void loop()':
sketch_mar19a:22: error: 'RFID' was not declared in this scope
sketch_mar19a.cpp: In function 'void add()':
sketch_mar19a:40: error: 'RFID' was not declared in this scope
sketch_mar19a.cpp: In function 'void del()':
sketch_mar19a:66: error: 'RFID' was not declared in this scope
does it mean needing head file "NewSoftSerial.h"
Im a newbie, but I like to play araund with arduino and cool stuff like the rfid reader.
My problem is the code.
i used the little part of code from mwp
to make the arduino`s serial monitor speak to me. But the only thing it says is:
access denied
access denied
access denied
access denied
no matter what a Tag i use it ever gets this failure..
What can I do now..
please help me :)
In file included from FY1Z49MGH89ZZ95.cpp:1:
C:\Users\joker\Downloads\arduino-1.0-windows\arduino-1.0\libraries\NewSoftSerial/NewSoftSerial.h:71: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
C:\Users\joker\Downloads\arduino-1.0-windows\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)
Am I missing other libraries? Any help at all would be greatly appreciated!
When you got more expertise, you can adapt the old libraries to work with new 1.0 arduino SDK ;)
I'm a nooby to RFID and as well to arduino stuff.
I'm trying to keep the accepted cards in arduino's EEPROM and I managed to do so but it is getting difficult to know which way to grant access by comparing the read card number and stored card number. How can I do that??
I am having problems with the reader reading the add and delete cards twice. Hope that makes sense. Cheers
When I uncommented the println statements in the reading loop it worked as expected, so it seems that the program was trying to read the bytes too fast. After the first byte is read it loops back to test if another byte is waiting, and if it is not, then the loop exits with the string 'msg' just one byte long.
It works when the println is executed, because then there is always time for the next byte to arrive before RFID.available is called.
The solution is to add an explicit delay:
while(RFID.available()>0){
c=RFID.read();
msg += c;
delay(1); //allow time for another byte to arrive
//Serial.println(msg); //Uncomment to view your tag ID
//Serial.println(msg.length());
}