{"id":159,"date":"2012-06-19T19:49:46","date_gmt":"2012-06-19T17:49:46","guid":{"rendered":"http:\/\/jcoder.me\/blog\/?p=159"},"modified":"2013-02-14T21:16:52","modified_gmt":"2013-02-14T20:16:52","slug":"reading-rfid-tags-with-arduino-and-id12","status":"publish","type":"post","link":"https:\/\/jcoder.me\/blog\/2012\/06\/19\/reading-rfid-tags-with-arduino-and-id12\/","title":{"rendered":"Reading RFID tags with Arduino and ID12"},"content":{"rendered":"<h1>The mission: getting started with RFID<\/h1>\n<p>With my <a title=\"New gadget: Arduino Uno\" href=\"http:\/\/jcoder.me\/blog\/2012\/06\/08\/new-gadget-arduino-uno\/\" target=\"_blank\">recent gadget<\/a> order I also bought an <a href=\"http:\/\/www.watterott.com\/de\/RFID-Leser-ID-12\" target=\"_blank\">ID-12 RFID reader<\/a> with a corresponding <a href=\"http:\/\/www.watterott.com\/de\/RFID-Leser-Breakout\" target=\"_blank\">breakout board<\/a>. The breakout board is needed because the ID12 chip contacts have a 2mm grid while the breadboards have a 2.54mm grid.<\/p>\n<h1>Step 1 &#8211; setting up the circuits<\/h1>\n<p>Yesterday I soldered the reader and connectors to the breakout board (not a very easy task for a non-soldering-expert like me), and today I tried to get it working. And guess what: it didn&#8217;t work :(<\/p>\n<p>After each step of soldering I checked the connections with a multimeter and everything seems to work fine (except that I got confused, because on the breakout board the pins 3 and 4 both connect to the antenna somehow and are then connected which I did not expect).<\/p>\n<p>But when trying to get some data out of the assembled circuit nothing happened, and after some checks I found the error: the pin 2 did not connect correctly to the pin on the ID-12 chip. I wasn&#8217;t expecting this, so I tried to fix the soldering at that connection, but still no success, so finally I had to solder a testing wire to the pin, and then the contact worked.<\/p>\n<p><em>Conclusion up to this point:<\/em> check the soldering connections after each step, even if they <em>look<\/em> good.<\/p>\n<p>This is how the connections are made:<\/p>\n<p><a href=\"http:\/\/jcoder.me\/blog\/wp-content\/uploads\/2012\/06\/Simple-RFID-Reading_Steckplatine.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-158\" title=\"Simple RFID Reading_Steckplatine\" alt=\"\" src=\"http:\/\/jcoder.me\/blog\/wp-content\/uploads\/2012\/06\/Simple-RFID-Reading_Steckplatine.png\" width=\"600\" height=\"240\" srcset=\"https:\/\/jcoder.me\/blog\/wp-content\/uploads\/2012\/06\/Simple-RFID-Reading_Steckplatine.png 600w, https:\/\/jcoder.me\/blog\/wp-content\/uploads\/2012\/06\/Simple-RFID-Reading_Steckplatine-300x120.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Actually the ID-12 is soldered to a breakout board so this is how everything looks in reality (notice the white wire on the left side of the chip &#8211; this is the one that I soldered directly to the chip):<\/p>\n<p><a href=\"http:\/\/jcoder.me\/blog\/wp-content\/uploads\/2012\/06\/Arduino_with_ID12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-157\" title=\"Arduino_with_ID12\" alt=\"\" src=\"http:\/\/jcoder.me\/blog\/wp-content\/uploads\/2012\/06\/Arduino_with_ID12.png\" width=\"800\" height=\"429\" srcset=\"https:\/\/jcoder.me\/blog\/wp-content\/uploads\/2012\/06\/Arduino_with_ID12.png 800w, https:\/\/jcoder.me\/blog\/wp-content\/uploads\/2012\/06\/Arduino_with_ID12-300x160.png 300w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>(A big thanks goes out to HC Gilje for the good explaination on <a href=\"http:\/\/hcgilje.wordpress.com\/resources\/rfid_id12_tagreader\/\" target=\"_blank\">how to connect the ID-12 chip<\/a>.)<\/p>\n<h1>Step 2 &#8211; coding to get some results<\/h1>\n<p>There is some great example <a href=\"http:\/\/arduino.cc\/playground\/Code\/ID12\" target=\"_blank\">code for reading RFID tag data on the Arduino website<\/a>.<\/p>\n<p>It works quite well, <strong>but&#8230;<\/strong> the ID-12 chip uses a serial connection and the Arduino just has one serial port (input: pin 0, labeled RX), and internally the flashing and PC connection also uses a serial connection. So you cannot have both connections set up at the same time (therefore it is suggested to disconnect the ID-12 chip when uploading a new software version).<\/p>\n<p>But there is a great solution provided by the Arduino IDE: it comes with a SoftwareSerial library (see &#8220;File&#8221;, &#8220;Examples&#8221;, &#8220;SoftwareSerial&#8221;) which turns two normal pins into a serial port. I guess there are some limitations on this, but for me it works quite well.<br \/>\nIf you take a close look at the photo and schematics you&#8217;ll see that the blue wire (serial) is connected to pin 2 instead of pin 0. This is because I configured the SoftwareSerial lib to use pins 2 (RX) and 3 (TX) to provide a serial port.<\/p>\n<p>By changing the example code to work with two serial ports and opening a PuTTY on port COM3 I was finally able to see the tag IDs showing up!<\/p>\n<p>On request (please leave a comment below) I&#8217;ll share my code &#8211; it is currently not proper formatted and commented ;)<\/p>\n<h1>What&#8217;s next?<\/h1>\n<p>I&#8217;m very excited that this worked so well, but I&#8217;ll continue building upon the code and circuit layout:<\/p>\n<ul>\n<li><span style=\"color: #000000;\"><del>Putting up the code (actually needs some reformatting and commenting)<\/del><\/span><\/li>\n<li>Reading the data on the PC with a custom application<\/li>\n<li>Extending that PC application to provide this data to other applications, maybe using some plugin architecture<\/li>\n<li>Getting the ID-12 to work with a FEZ Panda II and a Gadgeteer board<\/li>\n<\/ul>\n<p>If you have any suggestions, ideas or any other feedback, please feel free to leave a comment below.<\/p>\n<h3>Update 14.02.2013<\/h3>\n<p>I&#8217;ve uploaded the code at\u00a0<a href=\"http:\/\/blog.jcoder.me\/files\/arduino\/RFIDReaderExample.txt\">http:\/\/blog.jcoder.me\/files\/arduino\/RFIDReaderExample.txt<\/a><\/p>\n<p>It is based on the example RFID reader code from the Arduino site, except that it uses the software serial connection at described above.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The mission: getting started with RFID With my recent gadget order I also bought an ID-12 RFID reader with a corresponding breakout board. The breakout board is needed because the ID12 chip contacts have a 2mm grid while the breadboards &hellip; <a href=\"https:\/\/jcoder.me\/blog\/2012\/06\/19\/reading-rfid-tags-with-arduino-and-id12\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,5],"tags":[55,33,32],"class_list":["post-159","post","type-post","status-publish","format-standard","hentry","category-arduino","category-coding","tag-arduino","tag-id12","tag-rfid"],"_links":{"self":[{"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/posts\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/comments?post=159"}],"version-history":[{"count":6,"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/posts\/159\/revisions"}],"predecessor-version":[{"id":164,"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/posts\/159\/revisions\/164"}],"wp:attachment":[{"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/media?parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/categories?post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jcoder.me\/blog\/wp-json\/wp\/v2\/tags?post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}