Search This Blog

Showing posts with label RFID. Show all posts
Showing posts with label RFID. Show all posts

Sunday, October 10, 2010

Arduino RFID tag reader cleaned up

I made a more permanent version of the RFID tag reader:


It took some staring at the cryptic documentation and the web site below to figure out the circuit, so I drew it up, since the drawings elsewhere were awful and had errors.


  • Rewrote the code so that it keeps a list of tags to be granted access.  
  • Upgraded to arduino-0021, and replaced the add on NewSoftSerial library with the built in SoftwareSerial libarary.  The built in library is not as good as the add on, but it makes it easier for others to get my code running.
  • Used a prototype shield and made a permanent hardware version with some LEDs
Photo of the Arduino with the proto shield stacked on top.  The RFID module is soldered to a breakout board which is in turn soldered to the prototype shield.  Indicator LEDs are installed sticking up high so they will poke out of the box when done.

The unit placed inside the bottom half of the Sparkfun project box. This box fits an Arduino perfectly.  If I had the project to do over again, I'd have put the RFID module on the other end of the prototype board so it was centered in the box.  I built the unit while i was waiting for the box to come, and didn't plan this ahead properly.  I was thinking I might put a small LCD readout on the end of the prototype board, that is why I did it this way.  In the end the LCD wasn't really useful and I deleted it.


All buttoned up with the holes for the red and green LEDs drilled.


I'm going to repeat information in the previous post on the prototype version, so the writeup is all in one place.







The RFID module reads out serial ASCII data, and all you have to do is connect that output to a pin on the Arduino.  You use the SoftwareSerial library to be able to define any pin as a serial input.  Otherwise you have to use the TX/RX pins, and that interferes with serial communication to the computer.  Set the RFID reader serial speed to 9600 baud.  Other speeds i found spewed garbage.

The sketch looks for codes and compares them to a valid list.  I can't imagine anyone could pull the compiled code off the microcontroller to see the list of valid tags.  Plus the RFID reader has a good 5 inches of range, so you can put the reader INSIDE the door if you want.  It even reads from the back of the RFID module.

I found the reader only reads the tags from Sparkfun.  It does not read HID tags (at least the ones I have), it does not read pet chips, or Metro smartcards.  I was disappointed as a hacker, but the project still works great.

You could add a data logger or an ethernet shield if you want to save a record of what tags were read or send that information across the internet.

Parts List:
  • Used the RFID Reader ID-20 from Sparkfun:
            http://www.sparkfun.com/commerce/product_info.php?products_id=8628
           The datasheet is here:
           http://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf
           The ID-12 is functionally identical, with a smaller range and uses less power.  Pick that one for a battery operated project, or if range isn't important.
  • This little breakout board for the RFID module is worth the $0.95 to make the pins plug into the breadboard.
           http://www.sparkfun.com/commerce/product_info.php?products_id=8423

  • I got a couple of these tags for $1.95 each.  RFID Tag - 125kHz.  Even if you have your own tags, i'd get one to be sure the reader is working when you build it.

          http://www.sparkfun.com/commerce/product_info.php?products_id=8310
          http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=55
  • stacking headers $1.50
          http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=85
  • A red LED, a green LED, 2 1kohm resistors and a switch for reset.  If you don't have the miscellaneous stuff, you can get all this with the protoboard from Adafruit if you buy the proto kit for $12.50.
  • A project box.  This box is made for the Arduino and is easy to drill.  Kinda pricey at 11.95 but I needed something I wouldn't be embarrassed to see hanging on my wall.   Arduino and shield drop right in.  http://www.sparkfun.com/commerce/product_info.php?products_id=10088

These electric door locks look like they should work, I haven't tried yet.  Likely it will need a relay or transistor to boost the current to activate the lock, like an LM293
Electric Door Strike - Mortise Type

This was much cheaper, so i ended up getting this instead.  It is really for autos but worked fine.



The sketch code follows the break...

Thursday, October 7, 2010

Arduino RFID tag reader prototype







 Put together the basic Arduino RFID reader in about an hour!  It was way easier than I expected and worked the first time!  


<Note: See the final version in this post>
http://siliconfishtech.blogspot.com/2010/10/arduino-rfid-tag-reader-cleaned-up.html


Here is the prototype breadboard version I just whipped up:



The RFID module reads out serial ASCII data, and all you have to do is connect that output to a pin on the Arduino.  The serial library called in the code (the link is in the code) lets you put a serial input on any pin.
Thats all there is to it.  

You can read your tags, and put if statements in the loop to activate a pin on the arduino to make a lock, or whatever you want to happen when a card is read.   

  • Used the RFID Reader ID-20 from Sparkfun:
            http://www.sparkfun.com/commerce/product_info.php?products_id=8628
           The datasheet is here:
           http://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf
           The ID-12 is functionally identical, with a smaller range and uses less power.  Pick that one for a battery operated project.
  • This little breakout board for the RFID module is worth the $0.95 to make the pins plug into the breadboard.
           http://www.sparkfun.com/commerce/product_info.php?products_id=8423

  • I got a couple of these tags for $1.95 each.  RFID Tag - 125kHz.  Even if you have your own tags, i'd get one to be sure the reader is working when you build it.

          http://www.sparkfun.com/commerce/product_info.php?products_id=8310
It took some staring at the cryptic documentation and the web site below to figure out the circuit, so I drew it up since the drawings elsewhere were awful and had errors.




The sketch code follows the break...

Tuesday, October 5, 2010

Arduino RFID reader started

I've started putting together an RFID reader, using an ID-20 module from Sparkfun and an Arduino.
This post is just a place to note a couple links to information I'll need.  This is what I got so far.  The RFID is pretty pricey!  Sparkfun is a good website, the only place I could find the RFID reader.  However, the stuff took a week and a half to come from Colorado.  Hacktronics and Adafruit are 3 days (for me on the east coast).


RFID Reader Breakout$0.951$0.95
RFID Tag - 125kHz$1.951$1.95
RFID Reader ID-20$34.951$34.95

And of course, and Arduino Duemilanove, now selling for $25.  I got a new Uno version  to try out as well, either will work.  I learned my lesson buying the Chinese knockoff boards from Ebay.  Save money but no workie.

It appears that i connect the output pin to the serial pin on the arduino and then just let her rip.  We will see if it is that easy.


Data sheets and info were here:

http://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf

http://hcgilje.wordpress.com/resources/rfid_id12_tagreader/

Although this is a different tag, maybe the concepts are the same:
http://www.arduino.cc/playground/Learning/PRFID

Another tag reader i didn't try is here:

http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/txtSearch/rfid/List/1/ProductID/114/Default.aspx?SortField=ProductName,ProductName

Wednesday, September 29, 2010

RFID reader

Found some info on RFID readers that i'm making note of

http://www.instructables.com/id/Weather-proof-Bluetooth-capable-RFID-reader/

makes use of
http://www.sparkfun.com/commerce/product_info.php?products_id=8419
http://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf

Also found this on Ebay.   A little too much to spend at $59, but it has some info on how they work.
Still thinking about building a fun project to detect who is in my office by reading their badges.

Datasheet at
http://www.rfidshop.com.hk/datasheet/T5567/HI-R-W26-W2%20Datasheet.pdf







HI-R-W26-W2

125Khz HID compatible RFID Reader
with wiegand 26 bit output Interface






Features  (Datasheet download here)





  • Frequency : 125Khz




  • support protocol : HID compatible protocol  




  • power : +9V to +12V DC




  • read card serial No only




  • wall mount version




  • embedded antenna




  • effective distance up to 3-5 cm




  • Less than 100ms decoding time




  • Low power dissipation with single power supply




  • Built-in LED and buzzer




  • output interface : wiegand 26 bit




  • (42x80x15) mm

Interface Description  

Wire color
Wiegand
Red
+9V To 12V DC
Black
Ground
Green
Data 0
White
Data 1
Drain
Shield Ground
Brown
Red LED (active low)
Orange
Green LED (active low)
Yellow
Buzzer (active low)
Blue
Hold
Violet
Card Present