Program for 125MHz RFID Reader

Grove is a modulated, ready-to-use tool set.
Much like Lego, it takes a building block approach to assembling electronics.

Moderators: lily.li, violet, jeremy882, crail.lyu969

Post Reply
just_riko11
Pre-kindergarten
Pre-kindergarten
Posts: 14
Joined: Mon May 20, 2013 2:10 pm

Program for 125MHz RFID Reader

Post by just_riko11 » Wed May 29, 2013 6:12 pm

Dear all,

i want to ask,how to know the distance between RFID tags and RFID reader when read within?
is it possible we can know the distance when the tags read by the reader? can we programmer it or we insert that code into that tags?

please your advice, if consider i hope you can share about that program.

Thanks,
Riko

User avatar
Jacket Chen
Staff
Staff
Posts: 659
Joined: Thu Jun 21, 2012 4:25 pm
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino Shields
Location: China

Re: Grove 125Khz RFID

Post by Jacket Chen » Thu May 30, 2013 11:14 am

Hey , it seems the RFID doesn't have this function: it has no sensor to detect the distance...
Love little, love long.

just_riko11
Pre-kindergarten
Pre-kindergarten
Posts: 14
Joined: Mon May 20, 2013 2:10 pm

Re: Grove 125Khz RFID

Post by just_riko11 » Sun Jun 09, 2013 3:55 pm

Dear Jacky,

Have you ever coding using rfid 125khz grove?
could you share your code how to read that data uniq/tag using arduino?

User avatar
Jacket Chen
Staff
Staff
Posts: 659
Joined: Thu Jun 21, 2012 4:25 pm
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino Shields
Location: China

Re: Grove 125Khz RFID

Post by Jacket Chen » Sun Jun 09, 2013 4:34 pm

The program have been posted on the wiki:

Code: Select all

#include <SoftwareSerial.h>
 
SoftwareSerial SoftSerial(2, 3);
unsigned char buffer[64]; // buffer array for data recieve over serial port
int count=0;     // counter for buffer array 
void setup()
{
  SoftSerial.begin(9600);               // the SoftSerial baud rate   
  Serial.begin(9600);             // the Serial port of Arduino baud rate.
 
}
 
void loop()
{
  if (SoftSerial.available())              // if date is comming from softwareserial port ==> data is comming from SoftSerial shield
  {
    while(SoftSerial.available())          // reading data into char array 
    {
      buffer[count++]=SoftSerial.read();     // writing data into array
      if(count == 64)break;
  }
    Serial.write(buffer,count);            // if no data transmission ends, write buffer to hardware serial port
    clearBufferArray();              // call clearBufferArray function to clear the storaged data from the array
    count = 0;                       // set counter of while loop to zero
 
 
  }
  if (Serial.available())            // if data is available on hardwareserial port ==> data is comming from PC or notebook
    SoftSerial.write(Serial.read());       // write it to the SoftSerial shield
}
void clearBufferArray()              // function to clear buffer array
{
  for (int i=0; i<count;i++)
    { buffer[i]=NULL;}                  // clear all index of array with command NULL
}
And it works well.
Love little, love long.

User avatar
Jacket Chen
Staff
Staff
Posts: 659
Joined: Thu Jun 21, 2012 4:25 pm
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino Shields
Location: China

Re: Grove 125Khz RFID

Post by Jacket Chen » Sun Jun 09, 2013 4:39 pm

Also,you can use UART port(TX/RX)
void setup()
{
Serial.begin(9600);
}
void loop()
{
if(Serial.available())
{
while(Serial.available())
Serial.write(Serial.read());
}
}
Love little, love long.

just_riko11
Pre-kindergarten
Pre-kindergarten
Posts: 14
Joined: Mon May 20, 2013 2:10 pm

Re: Grove 125Khz RFID

Post by just_riko11 » Tue Jun 11, 2013 11:15 am

Jacket Chen wrote:Also,you can use UART port(TX/RX)
void setup()
{
Serial.begin(9600);
}
void loop()
{
if(Serial.available())
{
while(Serial.available())
Serial.write(Serial.read());
}
}

Actually, i used UART in that output. in my program that program on wiki can compiler, but it doesn't give me any output in the serial :shock:
is that hardware problem?
i used arduino mega 2560 R2 + Grove Rfid 125 Khz and grove 4 pin to grove pin converter.
pin TX from Grove reader into RX arduino, VCC and ground plug same from reader and arduino.

User avatar
Jacket Chen
Staff
Staff
Posts: 659
Joined: Thu Jun 21, 2012 4:25 pm
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino Shields
Location: China

Re: Grove 125Khz RFID

Post by Jacket Chen » Tue Jun 18, 2013 3:30 pm

you can use Mega with RFID, and it works well. So you need confirm that whether you have used a 125khz tag? Also ,don't forget to turn the RFID mode jumper to "U"
RFID Reader--------Arduino (Mega)
Tx-------------------Rx
Rx-------------------Tx
GND-----------------GND
VCC------------------5v
Love little, love long.

Post Reply