RFID id-12 tagreader
May 8, 2007 — hcgiljeHere 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;






May 8, 2007 at 22:27
[...] 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, [...]
May 22, 2007 at 21:39
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!
May 22, 2007 at 22:09
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
May 23, 2007 at 0:12
Thanks!
May 23, 2007 at 0:16
(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))
June 11, 2007 at 4:07
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
June 11, 2007 at 20:43
I have no idea if your code would work, sorry, but maybe someone else sees your comment and can help you out.
September 21, 2007 at 5:01
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.
October 1, 2007 at 16:09
sorry,
I only work with the arduino.
hc
October 4, 2007 at 18:59
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
October 12, 2007 at 7:40
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
October 23, 2007 at 4:31
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!
October 23, 2007 at 9:06
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
November 12, 2007 at 18:58
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.
January 11, 2008 at 18:24
Thank you Hcgilje for posting new cct!