After reading this entry on Hack-a-Day: http://hackaday.com/2011/11/19/getting-useful-data-from-a-dirt-cheap-rfid-reader/ I ordered one of those cheap RFID readers for myself from this eBay seller: http://www.ebay.co.uk/sch/gbmsale/m.html?_nkw=125khz+rfid (note: it took 3.5 weeks to arrive)
I also ordered 10 125khz RFID keychain tags a week later, they haven't arrived yet but luckily I already have a glass capsule 125khz tag to test with.
When plugged into a PC it pretends to be a USB keyboard, placing a tag next to the antenna causes it to be read and then the red LED blinks green and a loud beep is emitted (you'll be searching for tape or blu-tack to dampen the sound) and the 10 digit number is 'typed out' with an Enter on the end.
But this unit is dead easy to use with a Picaxe, there's an unused pinheader point on the circuitboard with 4 lines; +5v, GND, Serout and one I have no idea what it does.
(click pictures for bigger)
To read the tag with a Picaxe you simply hook the +5v, GND & Serout to the Picaxe (a resistor on the serial line won't hurt), then read in the data at 9600 baud. This is an example of the 19 numbers the Picaxe will receive:
189 5 30 39 36 32 36 5 3 189 6 35 30 38 33 38 40 5 3
And the actual tag ID in this instance is 1073769149. So how do you extract that number? easily, you only need the 3rd, 4th, 5th, 6th, 7th, 12th, 13th, 14th, 15th, 16th numbers which are USB scan codes, read the comments in the Hack-a-Day link above for a more detailed explanation of the serial data the Picaxe received.
This little program for M2/X2 parts will read in and output the scanned RFID tag number through your programming cable:
The use of the @bptr & @bptrinc in the serin line mean only the 10 relevant numbers are captured & stored in memory, the b1=b1-29//10 line is for turning the captuired USB scan codes for "0"-"9" into 0-9.
Main loop for non-M2/X2 parts:
Bonus points for anyone who can write a short piece of code to turn the 10 digit decimal number (actually a 32bit number) into two 16bit numbers the Picaxe can easily & quickly cope with for comparing against known IDs stored in memory, it'll also make storing tag IDs take up just 4 bytes instead of 10.
What am I going to do with this RFID reader? I haven't got the foggiest, I just wanted another electronic toy in my toolbox to tinker with and the price was right.
I also ordered 10 125khz RFID keychain tags a week later, they haven't arrived yet but luckily I already have a glass capsule 125khz tag to test with.
When plugged into a PC it pretends to be a USB keyboard, placing a tag next to the antenna causes it to be read and then the red LED blinks green and a loud beep is emitted (you'll be searching for tape or blu-tack to dampen the sound) and the 10 digit number is 'typed out' with an Enter on the end.
But this unit is dead easy to use with a Picaxe, there's an unused pinheader point on the circuitboard with 4 lines; +5v, GND, Serout and one I have no idea what it does.
(click pictures for bigger)
To read the tag with a Picaxe you simply hook the +5v, GND & Serout to the Picaxe (a resistor on the serial line won't hurt), then read in the data at 9600 baud. This is an example of the 19 numbers the Picaxe will receive:
189 5 30 39 36 32 36 5 3 189 6 35 30 38 33 38 40 5 3
And the actual tag ID in this instance is 1073769149. So how do you extract that number? easily, you only need the 3rd, 4th, 5th, 6th, 7th, 12th, 13th, 14th, 15th, 16th numbers which are USB scan codes, read the comments in the Hack-a-Day link above for a more detailed explanation of the serial data the Picaxe received.
This little program for M2/X2 parts will read in and output the scanned RFID tag number through your programming cable:
Code:
#picaxe 08m2
#no_data
#terminal 19200
setfreq m16
symbol RFID=c.1
symbol RFIDbaud=t9600_16
main:
bptr=28
serin [800,main],RFID,RFIDbaud,@bptr,@bptr,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr,@bptr,@bptr,@bptr,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr
bptr=28
for b0=1 to 10
b1=@bptrinc
b1=b1-29//10
sertxd(#b1)
next b0
sertxd(cr,lf)
goto main
Main loop for non-M2/X2 parts:
Code:
main:
serin RFID,RFIDbaud,b0,b0,b0,b1,b2,b3,b4,b5,b5,b5,b5,b5,b6,b7,b8,b9
b0=b0-29//10
b1=b1-29//10
b2=b2-29//10
b3=b3-29//10
b4=b4-29//10
b5=b5-29//10
b6=b6-29//10
b7=b7-29//10
b8=b8-29//10
b9=b9-29//10
sertxd(#b0,#b1,#b2,#b3,#b4,#b5,#b6,#b7,#b8,#b9,cr,lf)
goto main
What am I going to do with this RFID reader? I haven't got the foggiest, I just wanted another electronic toy in my toolbox to tinker with and the price was right.