EM4102 RFID Glass Transponder for Animals
How the Pet Microchip Works
The basic technology behind pet microchips traces back several decades. But, it wasn't until recently that the devices became cheap enough to hit the mainstream pet market.
A pet microchip uses radio frequency identification (RFID)technology. RFID, as the name implies, uses radio waves as a medium to transmit information. An RFID tag stores data and, using electromagnetic forces for power, communicates that data to a device that interprets it. If you're curious about this process, read How RFID Works.
RFID tags come in different forms. Microchips in animals don't need to actively transmit information; they just hold information (a unique identification number for the pet). This type of tag, dubbed a passive RFID tag, has no battery and no internal power source. Rather it sits completely inert in the animal, waiting to be read.
A microchip capsule is roughly the size of a grain of rice and incorporates several components to help it do its job. First, the glass material that encapsulates the device is biocompatible. That means it's not toxic and doesn't hurt the animal's body, so your pet won't experience an allergic reaction to the device after implantation. Some versions of the microchip also include a cap made of polypropylene polymer to keep the chip from moving around once it's inside the animal. The polymer works by encouraging connective tissue and other kinds of cells to form around the capsule to hold it in place [source: Identipet]. Although surgical removal of the device is difficult, microchips don't expire or wear down. They're good for the life span of the pet.
Inside the capsule, you'll find the actual silicon microchip that holds the important information, as well as atuning capacitor and an antenna coil. The capacitor receives power and sends it to the microchip. The microchip's information can then be picked up through the antenna, which is a copper coil.
Because it has no internal power source, a microchip like this needs a reader or scanner (also called aninterrogator) to energize it [source: RFID Journal]. Often, manufacturers of microchips donate scanners to animal shelters. When set to the correct frequency, the scanner "interrogates" the microchip by invigorating the capacitor with electromagnetic power. When energized, the microchip capsule sends radio signals back to the scanner with the identification number. The scanner can then interpret the radio waves and display the identification number on an LCD screen (liquid crystal display screen). To learn more about how radio waves transmit information, take a look at How Radio Works.
Implantation for a DOG
Reading RFID in a DOG
Arowana Fish identified by RFID
EM4102 RFID Glass Transponder
Ebay link that you can purchase.
http://www.ebay.com/itm/MINI-RFID-GLASS-TAG-EM4102-Read-only-12x2mm-125kHz-BIO-GLASS-/160703842948
It will be like this.
How to make this Chip reading Device Using Arduino and RDM 6300 RFID sensor
Wiring Diagram
Upload the following sketch to your Arduino and open the serial monitor window in the IDE:
// --------------------------------------------------------
#include <SoftwareSerial.h>
SoftwareSerial RFID(2, 3); // RX and TX
int i;
void setup()
{
RFID.begin(9600); // start serial to RFID reader
Serial.begin(9600); // start serial to PC
}
void loop()
{
if (RFID.available() > 0)
{
i = RFID.read();
Serial.print(i, DEC);
Serial.print(" ");
}
}
// --------------------------------------------------------
READING AND RECOGNISING RFID'S
To do anything with the card data, we need to create some functions to retrieve the card number when it is read and place in an array for comparison against existing card data (e.g. a list of accepted cards) so your systems will know who to accept and who to deny. Using those functions, you can then make your own access system, time-logging device and so on.
Let’s demonstrate an example of this. It will check if a card presented to the reader is on an “accepted” list, and if so light a green LED, otherwise light a red LED. Use the hardware from the previous sketche, but add a typical green and red LED with 560 ohm resistor to digital pins 13 and 12 respectively. Then upload the following sketch:
//-------------------------------------------------------------------------------------------------------------
#include <SoftwareSerial.h>
SoftwareSerial RFID(2, 3); // RX and TX
int data1 = 0;
int ok = -1;
int yes = 13;
int no = 12;
int tag1[14] = {2,52,48,48,48,56,54,66,49,52,70,51,56,3};
int tag2[14] = {2,52,48,48,48,56,54,67,54,54,66,54,66,3};
int newtag[14] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // used for read comparisons
void setup()
{
RFID.begin(9600); // start serial to RFID reader
Serial.begin(9600); // start serial to PC
pinMode(yes, OUTPUT); // for status LEDs
pinMode(no, OUTPUT);
}
boolean comparetag(int aa[14], int bb[14])
{
boolean ff = false;
int fg = 0;
for (int cc = 0 ; cc < 14 ; cc++)
{
if (aa[cc] == bb[cc])
{
fg++;
}
}
if (fg == 14)
{
ff = true;
}
return ff;
}
void checkmytags() // compares each tag against the tag just read
{
ok = 0; // this variable helps decision-making,
// if it is 1 we have a match, zero is a read but no match,
// -1 is no read attempt made
if (comparetag(newtag, tag1) == true)
{
ok++;
}
if (comparetag(newtag, tag2) == true)
{
ok++;
}
}
void readTags()
{
ok = -1;
if (RFID.available() > 0)
{
// read tag numbers
delay(100); // needed to allow time for the data to come in from the serial buffer.
for (int z = 0 ; z < 14 ; z++) // read the rest of the tag
{
data1 = RFID.read();
newtag[z] = data1;
}
RFID.flush(); // stops multiple reads
// do the tags match up?
checkmytags();
}
// now do something based on tag type
if (ok > 0) // if we had a match
{
Serial.println("Accepted");
digitalWrite(yes, HIGH);
delay(1000);
digitalWrite(yes, LOW);
ok = -1;
}
else if (ok == 0) // if we didn't have a match
{
Serial.println("Rejected");
digitalWrite(no, HIGH);
delay(1000);
digitalWrite(no, LOW);
ok = -1;
}
}
void loop()
{
readTags();
}
// ------------------------------------------------------------------------------------
In the sketch we have a few functions that take care of reading and comparing RFID tags. Notice that the allowed tag numbers are listed at the top of the sketch, you can always add your own and more – as long as you add them to the list in the function checkmytags() which determines if the card being read is allowed or to be denied.
The function readTags() takes care of the actual reading of the tags/cards, by placing the currently-read tag number into an array which is them used in the comparison function checkmytags(). Then the LEDs are illuminated depending on the status of the tag at the reader.
Let’s demonstrate an example of this. It will check if a card presented to the reader is on an “accepted” list, and if so light a green LED, otherwise light a red LED. Use the hardware from the previous sketche, but add a typical green and red LED with 560 ohm resistor to digital pins 13 and 12 respectively. Then upload the following sketch:
//-------------------------------------------------------------------------------------------------------------
#include <SoftwareSerial.h>
SoftwareSerial RFID(2, 3); // RX and TX
int data1 = 0;
int ok = -1;
int yes = 13;
int no = 12;
int tag1[14] = {2,52,48,48,48,56,54,66,49,52,70,51,56,3};
int tag2[14] = {2,52,48,48,48,56,54,67,54,54,66,54,66,3};
int newtag[14] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // used for read comparisons
void setup()
{
RFID.begin(9600); // start serial to RFID reader
Serial.begin(9600); // start serial to PC
pinMode(yes, OUTPUT); // for status LEDs
pinMode(no, OUTPUT);
}
boolean comparetag(int aa[14], int bb[14])
{
boolean ff = false;
int fg = 0;
for (int cc = 0 ; cc < 14 ; cc++)
{
if (aa[cc] == bb[cc])
{
fg++;
}
}
if (fg == 14)
{
ff = true;
}
return ff;
}
void checkmytags() // compares each tag against the tag just read
{
ok = 0; // this variable helps decision-making,
// if it is 1 we have a match, zero is a read but no match,
// -1 is no read attempt made
if (comparetag(newtag, tag1) == true)
{
ok++;
}
if (comparetag(newtag, tag2) == true)
{
ok++;
}
}
void readTags()
{
ok = -1;
if (RFID.available() > 0)
{
// read tag numbers
delay(100); // needed to allow time for the data to come in from the serial buffer.
for (int z = 0 ; z < 14 ; z++) // read the rest of the tag
{
data1 = RFID.read();
newtag[z] = data1;
}
RFID.flush(); // stops multiple reads
// do the tags match up?
checkmytags();
}
// now do something based on tag type
if (ok > 0) // if we had a match
{
Serial.println("Accepted");
digitalWrite(yes, HIGH);
delay(1000);
digitalWrite(yes, LOW);
ok = -1;
}
else if (ok == 0) // if we didn't have a match
{
Serial.println("Rejected");
digitalWrite(no, HIGH);
delay(1000);
digitalWrite(no, LOW);
ok = -1;
}
}
void loop()
{
readTags();
}
// ------------------------------------------------------------------------------------
In the sketch we have a few functions that take care of reading and comparing RFID tags. Notice that the allowed tag numbers are listed at the top of the sketch, you can always add your own and more – as long as you add them to the list in the function checkmytags() which determines if the card being read is allowed or to be denied.
The function readTags() takes care of the actual reading of the tags/cards, by placing the currently-read tag number into an array which is them used in the comparison function checkmytags(). Then the LEDs are illuminated depending on the status of the tag at the reader.
Comments
Post a Comment