{"id":817,"date":"2020-10-10T14:00:57","date_gmt":"2020-10-10T18:00:57","guid":{"rendered":"https:\/\/dc540.org\/xxx\/?p=817"},"modified":"2020-10-10T14:01:30","modified_gmt":"2020-10-10T18:01:30","slug":"commercial-rfid-and-arduino","status":"publish","type":"post","link":"https:\/\/dc540.org\/xxx\/2020\/10\/commercial-rfid-and-arduino\/","title":{"rendered":"Commercial RFID and Arduino"},"content":{"rendered":"\n<p>Today I&#8217;ve been playing with a commercial RFID reader and an Arduino UNO. I like the idea of this combo in principle, because I can connect a 12V power supply to the Arduino and power the reader directly from the VIN pin, eliminating the need for two power supplies or a step-down converter.<\/p>\n\n\n\n<p>I tried several different libraries for Arduino, and wasn&#8217;t having the best of luck &#8212; I settled on Daniel Smith&#8217;s code from Pagemac back in 2012.  <\/p>\n\n\n\n<p>http:\/\/www.pagemac.com\/projects\/rfid\/arduino_wiegand<\/p>\n\n\n\n<p>Then I made a change that caused buffer overflows and Arduino resets. Once that was fixed, it started reading cards consistently. But it was reading them at twice the actual tag length.  A 34-bit card was detected at 68 bits. I changed the pin mode from INPUT to INPUT_PULLUP on both data pins, and bang, I was getting 34-bit tag reads.<\/p>\n\n\n\n<p>Unfortunately, the code I had only interpretation for 35 and 26-bit formats, so some minor rearrangement of boundaries and bitshifting was required. It&#8217;s easy to tell when bitshifting is required, because the result you get is a multiplier or a factor of the result you expect.  In my case, the facility code was coming up at 1\/8 of the value of the actual facility code, and the card code was coming up as 2x the actual card code (actual codes were validated by the Proxmark3 RDV4).<\/p>\n\n\n\n<p>After the bitshifting was done, it was able to read my card properly. Now I just need to set up interpreters for all the known card variants that I need to test against.<\/p>\n\n\n\n<p>BIG thanks to Kevin for his help in narrowing down the issues I was fighting with.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I&#8217;ve been playing with a commercial RFID reader and an Arduino UNO. I like the idea of this combo in principle, because I can connect a 12V power supply &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/dc540.org\/xxx\/2020\/10\/commercial-rfid-and-arduino\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Commercial RFID and Arduino&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":818,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[73],"tags":[],"class_list":["post-817","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rfid"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/dc540.org\/xxx\/wp-content\/uploads\/2020\/10\/hidreader-scaled.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/comments?post=817"}],"version-history":[{"count":2,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/817\/revisions"}],"predecessor-version":[{"id":821,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/817\/revisions\/821"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/media\/818"}],"wp:attachment":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/media?parent=817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/categories?post=817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/tags?post=817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}