Go Down

Topic: interfacing arduino to RFID, help (Read 1 time) previous topic - next topic


how to interface arduino to a RFID reader? probably we're using a short range RFID. thank you


the overview of my project i a security system, where it uses a short range freq. RFID, when the reader detects a tag, it will automatically turn the arm of a turnstile, the security barrier used is a tripod turnstile (with 3 arms). and can u give me some sample codes of this kind of project? thanks a lot po


There are a number of RFID readers out there.  I used an RFID ID-12 (SEN-08419) chip with the breakout board(SEN-08423) from Sparkfun.  

You basically hook it up to the serial pin.  When a card is swiped it sends the card ID over the serial line.  

Here is a small test program to give you an idea of how easy it is.  I X'ed  out the card id's (also from sparkfun).

Code: [Select]
char val = 0; // value read for serial port

char peopleCardID[][20] = {
char people[][20] = {
 "Ted", "Frank","Johnny","Franny","Bobby"};

void setup() {

void loop () {
 int i;
 char card[20] = "";
 if(Serial.available() > 0) {
   boolean bFound = false;
   while(Serial.available() > 0){
     val = Serial.read(); // read from the serial port
     if ((val >= 'A' && val <='Z') || (val >='0' && val <='9')){
       card[i++] = val;
   card[i] = 0;
   for (i=0;i<5;i++){
     if (!strcmp(peopleCardID[i],card)){
       bFound = true;
       Serial.print("Hello there ");
       Serial.println("!!  ");
   if (!bFound){
     Serial.println("Unknown Key!!!");

Also here is a link to a project someone did with it with more details. It has wiring diagrams and code as well.  http://www.markfickett.com/stuff/artPage.php?id=373#id12  

Adafruit also has an RFID shield that you can look at.    No wiring needed and she has a library and sample code to use.  Here is the link to the basic sample code https://github.com/adafruit/Adafruit_NFCShield_I2C/blob/master/examples/readMifare/readMifare.pde


thanks a lot, that will be a big help, another question sir denbo, if i added GSM to send sms to the parent of the owner of the tag, how will it be interfaced?

because that is the overview of my projects, it is a student entrance security and monitoring system, once a student palce his id tag near the reader, the turnstile will open and also sends sms to his parent, the contact no, probably stored in the database, which i ddnt know yet, thanks for helping


Hi Bibang! I'am also having a problem in interfacing my PC to arduino and to my GSM SHIELD. Actually we are, at some point is same in project.
I also made use of RFID reader by RDM, and a database. The overview of my project is; if the RFID card holder swipes its card to the reader, the read RFID code will be sent to the Arduino Mega using a software serial and the arduino will send or echo the read code to the PC database to match the identification and if it matches, the database will sent the needed info. back (accepted by)  to the arduino mega to perform another program to command the GSM to send the needed info. to a specific phone no. came from the database and the real-time entering of the student in the campus...
Bibang, if you have already solve your problem would you please post the sketch you use and some sort of procedures...I appreciate If you reply or give any thoughtful ideas to solve my problem..I think 90% of our project is alike.,. :)


sherluck, my project is successful and i use usb broadband to send sms, using VB 2010, and an arduino to control my turnstile c:


Hi bibang,that's good to know that your project is successful.Making it heard makes me optimistic that my project can be successful too.  But I wonder if why do you use a usb modem, what is the use of it in your project? have you not use the gsm? if not, did you directly connect the gsm to to the computer database.? Please tell me what you exactly did in your project. I really need your help, please post the sketches you use or the combined sketch you use.please!!!Hope you can help me...  :(


actually i dont have a complicated sketch in my arduino, it is only used in controlling the lock of the turnstile, lock and unlock, my VB program only sends a value that sets HIGH and LOW on the lock, my GSM modem which is smart bro is just used  for sending sms, i have a program in vb that enables to conect on my usb modem, so as soon as the student logs in, the lock will open and the parents of the student it rcv sms, the number is save in the database together with the student's info. communicating arduino and vb is simple just by the serial port tool on vb

Go Up