RFID id-12 tagreader

Here is a simple code for reading tags from the id12 RFID reader. It should be quite easy to modify if you know the dataformat your reader is sending out.

Here is how to hook it up for serial communications, either using a microcontroller like arduino or wiring, or through a serial to usb interface, or wirelessly over bluetooth, using a bluetooth module like bluesmirf:

ID-12 schematics, originally uploaded by hc gilje.

(This schematic has been updated with a 1k resistor between pin 10 and LED after reports by users)

If you are using the breakout board from sparkfun, the pinout is as seen in the image below.
Connect the led+resistor to pin 10, serial connection to pin 9, ground to pins 1 and 7, +5v to pins 2 and 11 (updated june 26th, 2008 )

If you use an arduino or wiring board here is the code to read (from RFID reader) and write (to your computer) the serial port (modified from Tom Igoe´s code):
/* RFID ID12
*/

char val = 0; // variable to store the data from the serial port

void setup() {
Serial.begin(9600); // connect to the serial port
}

void loop () {
// read the serial port

if(Serial.available() > 0) {
val = Serial.read();
Serial.print(val, BYTE);

}
}

Maxmsp code:

copy and paste into maxmsp. You might want to clear the menu before adding your own tags:

#P window setfont “Sans Serif” 18.;
#P number 549 297 35 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 206 361 121 196617 filter out the 10 data bits;
#P newex 457 289 49 196617 delay 10;
#P newex 144 417 80 196617 prepend symbol;
#P message 550 178 33 196617 clear;
#P newex 508 432 69 196617 route symbol;
#P newex 508 459 78 196617 prepend append;
#P newex 508 409 41 196617 v temp;
#P newex 457 343 32 196617 sel 0;
#P newex 457 320 27 196617 0;
#P newex 525 261 21 196617 t 1;
#P newex 508 198 40 196617 t s b 0;
#P user ubumenu 550 224 100 196617 0 1 1 0;
#X add 0D003B363E;
#X add 0E002A0E4D;
#X add 0E002A393C;
#X add 0E002A0148;
#X add 0E002A047E;
#X add 0E002A0A2E;
#X prefix_set 0 0 <none> 0;
#P newex 144 391 40 196617 itoa;
#P newex 144 360 57 196617 zl slice 10;
#P newex 103 319 51 196617 zl slice 1;
#P newex 103 293 54 196617 thresh 40;
#P toggle 103 187 15 0;
#P number 145 186 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 103 210 52 196617 metro 20;
#P button 85 215 15 0;
#P newex 103 254 98 196617 serial b 9600 8 1 0;
#P comment 158 321 100 196617 filter out start bit;
#P window linecount 2;
#P comment 520 113 156 196617 checks if tag is already in list \, if not adds it. if yes shows the id;
#P window linecount 1;
#P comment 281 65 80 196617 RFID tag reader;
#P comment 587 177 100 196617 clear taglist;
#P window linecount 2;
#P comment 173 212 100 196617 how often the serial port is checked;
#P connect 9 0 7 0;
#P fasten 6 0 5 0 90 240 108 240;
#P connect 7 0 5 0;
#P connect 5 0 10 0;
#P connect 10 0 11 0;
#P connect 11 1 12 0;
#P connect 12 0 13 0;
#P connect 13 0 23 0;
#P connect 8 0 7 1;
#P connect 15 1 24 0;
#P connect 24 0 17 0;
#P connect 17 0 18 0;
#P connect 15 2 17 1;
#P connect 16 0 17 1;
#P connect 23 0 15 0;
#P connect 15 0 19 0;
#P connect 18 0 19 0;
#P connect 19 0 21 0;
#P connect 21 0 20 0;
#P connect 14 0 16 0;
#P connect 14 0 26 0;
#P connect 15 0 14 0;
#P connect 22 0 14 0;
#P connect 20 0 14 0;
#P window clipboard copycount 27;

35 Responses to “RFID id-12 tagreader”

  1. Conversations with spaces From the lab: ID-12 RFID reader « Says:

    [...] a bluetooth modem. You can find a code example for maxmsp + schematics on how to hook up the reader here. Posted in max, physical computing, lab, tools, software, [...]

  2. David Says:

    Great project! A friend and me been trying to set up a ID-20 and a bluesmirf to connect to a Max/msp patch on my mac today.
    We soldered together the components and managed to connect the smirf to my mac. There is a copy the above patch running and when i set up the correct port, the indicator light in the smirf stopped flashing comes on red. When i move a tag near the reader the led connected to the ID-20 comes on.
    So all seems to work fine, except there is no data coming into the max/msp patch…

    I’ve had hassle with mac and bluetooth before, but we have tried all the tricks i know off. Maybe you have some suggestions?

    Thanks!

  3. hcgilje Says:

    Hi David,
    the only issues I have heard from people trying out the patch, is that it might be necessary to adjust the thresh value to get the right number of values collected, but you are not getting anything? Maybe try to add a print object to see if anything at all comes out of the serial object. Since your ID-20 indicates it registers a tag, and you have a bluetooth connection, the only other problem I could think of is that there is a problem with the connection between the ID module and the bluesmirf, or that your format pin is not set right (to ground on the ID12, I assume the same on the ID20).
    hc

  4. David Says:

    :-) got it to work!

    Thanks!

  5. David Says:

    (I think the setting of the smirf might have been altered for the last project it was involved in, set it back to 9600 BD and fast data mode and it started working (found pdf instructions at sparkfun))

  6. kiwi Says:

    hi.. may i know if this code will work?:
    Private Sub Form1_Load( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load

    For i As Integer = 0 To _
    My.Computer.Ports.SerialPortNames.Count – 1
    cbbCOMPorts.Items.Add( _
    My.Computer.Ports.SerialPortNames(i))
    Next
    btnDisconnect.Enabled = False
    End Sub

  7. hcgilje Says:

    I have no idea if your code would work, sorry, but maybe someone else sees your comment and can help you out.

  8. TJ Says:

    Hi could you give me details on implementanting the above with a PIC microcontroller? I know we have to hook up the output of the ID-12 to the EUART of the microcontroller – however i’m worried about overflow and underflow and detecting the actual RFID serial no. within the PIC.

  9. hcgilje Says:

    sorry,
    I only work with the arduino.
    hc

  10. george powell Says:

    If you have any questions regarding the ID12 then pls feel free to contact me at help@id-innovations.com

    I may be able to help because I designed it.

    Really nice to see all the applications you that you have all put this module to, amazing.

    GP

  11. chock Says:

    Hey,

    was wondering if is there any other way to check if the ID-12 Reader is working. I was thinking if i “may” have fried it somehow. I seriously need a simple way to even know if it’s working. Thanks in advance

    chock

  12. kim Says:

    Hi there,

    I actually have the same question as chock. I just got my ID-12 yesterday, and I’ve set up the circuit exactly as it is here (using an Arduino Diecimila). I haven’t been able to get any response from either the LED or the serial port. Is there a quick and dirty way to test if the board is dead?

    I was curious about one other thing: can you have the serial coming in pin RX (on the Arduino) while monitoring the data over the USB connection? I was under the impression this didn’t work.

    Thanks!

  13. george powell Says:

    Dear Constructors

    RE: ID12

    The circuit diagram for the ID12 has an error. It will blow up the ID12 because the diode is driven directly without a 1k series resistor!!!

    Please check out the ID series data sheet at http://www.ID-innovations.com
    or Email help@id-innovations.com

  14. hcgilje Says:

    For some reason I didnt see this last comment before today, and I am sorry if this has caused problems for people, I have not had this problem at all and have used my ID12s for a while. Anyway, I have uploaded a new image to reflect the 1k resistor between pin 10 and the LED.

  15. george powell Says:

    Thank you Hcgilje for posting new cct!

  16. Ali Says:

    Would anyone please tell me what is the specification or the brand name of the tags that can communicate with the 12 core RFID you used cause I need to buy some tags and I am not sure if compatibility would only depend on the frequency of the reader and the tag.

  17. hcgilje Says:

    hi ali,
    the id-12 uses passive 125KHz tags

  18. Ali Says:

    Hi ,
    I have a question please. I am trying to connect the blueSmirf to the RFID 12 core reader and I am wondering which pins from the RFID should be linked to the bluetooth device.

  19. hcgilje Says:

    the pin that goes to the microcontroller in the schematic above (the dot), which is the serial out.

  20. david Says:

    Have tried it out and it work perfectly.

  21. diana Says:

    Have connected as shown, and I’m getting response in Arduino’s serial monitor, but it’s only junk data. Specifically, I get “ÿÿÿÿÿÿÿÿÿÿÿÿÿ” for any tag scanned. Anyone have thoughts as to why this might be? Thanks so much in advance!

  22. sky Says:

    Hi, I got a problem with my RFID reader. It seems that it is only able to read a bunch of question marks when I run the code given above. The LED blinks when I place a card near it but the serial monitor just shows me 13 ? symbols. Is there a problem with my RFID reader? I am using the white RFID cards ( 125 kHz tag).

  23. Thomas Says:

    I’m having the same trouble as diana. Outputting the data as hex says it’s just a bunch of FF bytes.

  24. Thomas Says:

    Sorry for the double-post, but I had a look at the ID12 datasheet which mentions a 4K7 pull-up resistor to be put on the clock and data pins. Unfortunately I have no idea of how to do this and cannot test it. Can anyone else shed some light?

  25. Thomas Says:

    And again, a triple-post. But this time with the solution to the “ÿÿÿÿÿ”/FFFFFF problem; connect a 4K7 resistor between V+ (+5V on the schematic) and pin 9.

  26. Maha Says:

    I have a problem with the ID-12.
    i connect pin 9 through the Max232 to the computer serial port to see the readed Tag code on the hyperterminal.
    when power on the led goes red even there is no tag to read.
    and the hypertermial didn’t receive anything (if the tag exist).
    can anyone explain this to me?did the ID-12 IC blow up.

  27. zach Says:

    i am having the same ffffff problem, i tried a pullup resistor but it doesnt work any suggestions?

  28. Alex Says:

    I have the same ffff problem….

    The thing is that the ID12 isn’t responding to changes in format pin… in other words the output is always in Wiegand26 format. (I have a logic analyzer).

    I don’t know what I’m doing wrong (I’m using pull ups resistor and connect the format pin to GND!

    HEEELP!

  29. Alex Says:

    To solve the ffff’s problems you have to use pull up resistors.

    There’s another problem with this IC.

    You MUST disconnect the power supply pin of the IC and connect it to GND. After this step the IC takes the new configuration of the format selector pin (7). (5v – Wiegand26 ; 0V – Ascii; PIN 10 – Magnet Emulation). This is because the reset pin doesn’t work as expected.

    You don’t need to use pull-up resistor in Ascii Mode.

  30. Alex Says:

    To zach:

    If you’re using pull up resistors and still getting FF’s, your problem is that you’re in Wiegand26 format output. Change the output to Ascii mode as I described in my last post.

  31. Daxesh Says:

    hello,
    i m working on rfid project. i do no know how i connect pic16 to id-20. please sent me schemetice daigrame and programe.

  32. hcgilje Says:

    Please check out the ID series data sheet at http://www.ID-innovations.com
    or Email help@id-innovations.com

  33. โปรเจคแรกกับ arduino – RFID access control doorlock with Arduino | Ayarafun Says:

    [...] BARRAGAN <http://people.interaction-ivrea.it/h.barragan>; // and code from HC Gilje – http://hcgilje.wordpress.com/resources/rfid_id12_tagreader/ // Modified for Arudino by djmatic // Modified for ID-12 and checksum by Martijn The – [...]

  34. Edo Says:

    Yes, it works! (without any pull up resistors) =)

    And: It is possible to upload software to the arduino without cutting the RX -> Pin 9 wire. Just put a diode between the RX pin from the arduino and the pin 9 from the ID12 module. It works great!

    Best, Edo


Leave a Reply