Shop OBEX P1 Docs P2 Docs Learn Events
125kHz RFID Tag Emulator — Parallax Forums

125kHz RFID Tag Emulator

65816581 Posts: 132
edited 2010-11-04 11:10 in Propeller 1
Hey there,

I've just finished some proof-of-concept 125kHz RFID-Tag emulator
based on the Propeller. It emulates an RFID-Tag with 0xFFFFFFFFFF - binary 1111111111111111111111111111111111111111)
CON _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000

    COIL_PIN = 4
    WAIT = 4_728  ' So the ID gets transferred in exacty 32.761ms

PUB main | chksum, i

  dira[COIL_PIN] := 1
  outa[COIL_PIN] := 0

  repeat
    i := 0
    repeat 64
      encodeManchester(0, id[i])
      waitcnt(cnt+(CLKFREQ/WAIT+390))
      encodeManchester(1, id[i])
      waitcnt(cnt+(CLKFREQ/WAIT))
      i++
    waitcnt(cnt+(CLKFREQ*2))

PUB encodeManchester(clock, data) | encoded
  encoded := clock ^ data
  if(encoded == 1)
    outa[COIL_PIN] := 0
  else
    outa[COIL_PIN] := 1


DAT     '       Start squence      B0         B1         B2         B3         B4         B5         B6         B7         B8         B9         End
        id byte 1,1,1,1,1,1,1,1,1, 1,1,1,1,0 ,1,1,1,1,0, 1,1,1,1,0 ,1,1,1,1,0, 1,1,1,1,0 ,1,1,1,1,0, 1,1,1,1,0 ,1,1,1,1,0, 1,1,1,1,0 ,1,1,1,1,0, 0,0,0,0,0
          

I haven't tryed it yet, but it should work.

Here's a circuit. You'll need an appropriate antenna of course (can be DIY - search for 125kHz Coil Antenna).
It sould be around 160uH. The transistor should be a NPN transistor.
transponder.jpg

Comments

  • VernVern Posts: 75
    edited 2010-10-22 09:35
    Very cool, best of all I can even understand whats going on as I step through the code, which is an accomplishment for me as I just started with spin about 3 days ago :) One question though and I'm only asking because I'm to lazy to look up the spec myself but are there any timing tolerance's in the RFID spec?

    Keep up the good work, and I would love to see you build a working prototype. I can see the this being used in college dorms around the world to brute force other kids RFID door locks haha.
  • virtuPICvirtuPIC Posts: 193
    edited 2010-10-28 00:15
    6581 wrote: »
    Here's a circuit. You'll need an appropriate antenna of course (can be DIY - search for 125kHz Coil Antenna).
    It sould be around 160uH. The transistor should be a NPN transistor.
    transponder.jpg

    Ahem... I don't understand this circuit. Where does it get it's power? Shouldn't the LC-tank be between the collector and power supply? Should work then.
  • 65816581 Posts: 132
    edited 2010-10-28 01:13
    virtuPIC wrote: »
    Ahem... I don't understand this circuit. Where does it get it's power? Shouldn't the LC-tank be between the collector and power supply? Should work then.

    The RFID tag is powered by inductivity. This circuit was also used
    in an article featured at Hackaday.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-10-28 01:41
    I saw a cct that used the coils induced energy to power the chip, they even used the pin protect diodes as the rectifiers AND the clock for it, by using that pin.
  • virtuPICvirtuPIC Posts: 193
    edited 2010-10-29 01:08
    Uuuh... sorry, I missed the point. Tags are electromagnetic sinks - so to say - controlled by short-circuiting the antenna. You are right. Should work.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-10-29 09:08
    I remembered where I had seen the *&£ version of this, it was by Micah on Hack a Day.
  • 65816581 Posts: 132
    edited 2010-11-04 06:33
    I see there is a timing problem in my version. Please see the upper posting
    for a fixed version.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2010-11-04 11:10
    Has anyone tested this with a RFID reader?

    6581 said:
    I haven't tryed it yet, but it should work.

    I don't know about you, but I've had a lot projects that "should work" but didn't on my first attempt.

    Duane Degn
Sign In or Register to comment.