
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
<title>NFC/RFID Bricklet – Tinkerforge</title>

<!--<link type="text/css" rel="stylesheet" href="http://www.tinkerforge.com/static/base_tf.css" />-->
<link type="text/css" rel="stylesheet" href="http://www.tinkerforge.com/static/jquery.lightbox-0.5.css" />
<meta name="keywords" content="Tinkerforge, Open Source Hardware, Bricks, Bricklets, USB Controllable, USB Sensing, USB Controlling" />
<meta name="description" content="Easy-to-use open source hardware. Control motors and sense the environment over USB, Ethernet or Wi-Fi/WLAN with C/C++, C#, Delphi/Lazarus, Java, JavaScript, LabVIEW, Mathematica, MATLAB/Octave, Perl, PHP, Python, Ruby, Shell, Visual Basic .NET or directly over TCP/IP." />
<meta name="copyright" content="Tinkerforge GmbH" />
<!--<script type="text/javascript">document.write('<style>.noscript { display: none; }</style>');</script>-->


    
    <link rel="stylesheet" href="../../_static/documentation_tf.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="Tinkerforge" href="../../index.html" />
    <link rel="up" title="Bricklets" href="Bricklets.html" />
    <link rel="next" title="Piezo Buzzer Bricklet" href="Piezo_Buzzer.html" />
    <link rel="prev" title="Multi Touch Bricklet" href="Multi_Touch.html" />

<script type="text/javascript" src="http://www.tinkerforge.com/static/jquery.lightbox-0.5.js"></script>
<script type="text/javascript">$(function() { $('#gallery a').lightBox(); });</script>
<script type="text/javascript">$(function() { $(".sphinxsidebarwrapper").filter(function() { return $.trim($(this).text()).length == 0; }).parent().hide(); });</script>


  </head>
  <body>
<div id="wrapper">
	<div id="tfcontent">
		<div class="boxContent3">


<div class="toctree">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../Getting_Started.html">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../Primer.html">Primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Tutorials/Tutorials.html">Tutorials</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../FAQ.html">FAQ</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="../Hardware.html">Hardware</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../Bricks/Bricks.html">Bricks</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="Bricklets.html">Bricklets</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="Ambient_Light.html">Ambient Light Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Analog_In.html">Analog In Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Analog_Out.html">Analog Out Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Barometer.html">Barometer Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Breakout.html">Breakout Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Color.html">Color Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Current12.html">Current12 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Current25.html">Current25 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Distance_IR.html">Distance IR Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Distance_US.html">Distance US Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Dual_Button.html">Dual Button Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Dual_Relay.html">Dual Relay Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="GPS.html">GPS Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Hall_Effect.html">Hall Effect Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Humidity.html">Humidity Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Industrial_Digital_In_4.html">Industrial Digital In 4 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Industrial_Digital_Out_4.html">Industrial Digital Out 4 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Industrial_Dual_020mA.html">Industrial Dual 0-20mA Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Industrial_Quad_Relay.html">Industrial Quad Relay Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="IO16.html">IO-16 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="IO4.html">IO-4 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Joystick.html">Joystick Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="LCD_16x2.html">LCD 16x2 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="LCD_20x4.html">LCD 20x4 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="LED_Strip.html">LED Strip Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Line.html">Line Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Linear_Poti.html">Linear Poti Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Moisture.html">Moisture Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Motion_Detector.html">Motion Detector Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Multi_Touch.html">Multi Touch Bricklet</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="">NFC/RFID Bricklet</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#features">Features</a></li>
<li class="toctree-l4"><a class="reference internal" href="#description">Description</a></li>
<li class="toctree-l4"><a class="reference internal" href="#technical-specifications">Technical Specifications</a></li>
<li class="toctree-l4"><a class="reference internal" href="#resources">Resources</a></li>
<li class="toctree-l4"><a class="reference internal" href="#compatibility">Compatibility</a></li>
<li class="toctree-l4"><a class="reference internal" href="#page-sizes-and-other-things-to-know">Page Sizes and other things to know</a></li>
<li class="toctree-l4"><a class="reference internal" href="#identifying-reading-and-writing-tags">Identifying, Reading and Writing tags</a></li>
<li class="toctree-l4"><a class="reference internal" href="#nfc-ndef-messages">NFC NDEF Messages</a></li>
<li class="toctree-l4"><a class="reference internal" href="#first-test">First Test</a></li>
<li class="toctree-l4"><a class="reference internal" href="#case">Case</a></li>
<li class="toctree-l4"><a class="reference internal" href="#programming-interface">Programming Interface</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="Piezo_Buzzer.html">Piezo Buzzer Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Piezo_Speaker.html">Piezo Speaker Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="PTC.html">PTC Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Remote_Switch.html">Remote Switch Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Rotary_Encoder.html">Rotary Encoder Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Rotary_Poti.html">Rotary Poti Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Segment_Display_4x7.html">Segment Display 4x7 Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Solid_State_Relay.html">Solid State Relay Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Sound_Intensity.html">Sound Intensity Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Temperature.html">Temperature Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Temperature_IR.html">Temperature IR Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Tilt.html">Tilt Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Voltage.html">Voltage Bricklet</a></li>
<li class="toctree-l3"><a class="reference internal" href="Voltage_Current.html">Voltage/Current Bricklet</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Master_Extensions/Master_Extensions.html">Master Extensions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Power_Supplies/Power_Supplies.html">Power Supplies</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Accessories/Accessories.html">Accessories</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Timeline.html">Timeline</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../Software/Software.html">Software</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../Software/Brickd.html">Brick Daemon (brickd)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Software/Brickv.html">Brick Viewer (brickv)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Software/API_Bindings.html">API Bindings</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Software/Firmwares_And_Plugins.html">Firmwares and Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Software/Device_Identifier.html">Device Identifier</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Source_Code.html">Source Code and Bug Tracking</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Programming_Interface.html">Programming Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../Kits/Kits.html">Starter Kits</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../Kits/WeatherStation/WeatherStation.html">Weather Station</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Kits/HardwareHacking/HardwareHacking.html">Hardware Hacking</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Kits/ServerRoomMonitoring/ServerRoomMonitoring.html">Server Room Monitoring</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Kits/Blinkenlights/Blinkenlights.html">Blinkenlights</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Kits/InternetOfThings/InternetOfThings.html">Internet of Things</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Kits/CameraSlider/CameraSlider.html">Camera Slider</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../Embedded/Boards.html">Embedded Boards</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../Embedded/Raspberry_Pi.html">Raspberry Pi</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../Specifications.html">Specifications</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../Technical_Data.html">Technical Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Low_Level_Protocols/TCPIP.html">TCP/IP Protocol</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Low_Level_Protocols/Modbus.html">Modbus Protocol</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Low_Level_Protocols/Wireshark_Dissector.html">Wireshark Dissector</a></li>
</ul>
</li>
</ul>

</div>



<div id="shoplink_img">
	<a href="../../../shop/bricklets/nfc-rfid-bricklet.html"><img alt="Shop" width="32" height="40" src="../../_images/Misc/cart-icon.png" /></a>
</div>
<div id="shoplink_a">
	<a href="../../../shop/bricklets/nfc-rfid-bricklet.html">In Shop</a>
</div>



    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="nfc-rfid-bricklet">
<span id="id1"></span><h1>NFC/RFID Bricklet<a class="headerlink" href="#nfc-rfid-bricklet" title="Permalink to this headline">¶</a></h1>
{% from "macros.html" import tfdocstart, tfdocimg, tfdocend %}
{{
    tfdocstart("Bricklets/bricklet_nfc_rfid_tilted_350.jpg",
               "Bricklets/bricklet_nfc_rfid_tilted_600.jpg",
               "NFC/RFID Bricklet")
}}
{{
    tfdocimg("Bricklets/bricklet_nfc_rfid_w_master_100.jpg",
             "Bricklets/bricklet_nfc_rfid_w_master_600.jpg",
             "NFC/RFID Bricklet with Master Brick")
}}
{{
    tfdocimg("Bricklets/bricklet_nfc_rfid_horizontal_100.jpg",
             "Bricklets/bricklet_nfc_rfid_horizontal_600.jpg",
             "NFC/RFID Bricklet")
}}
{{
    tfdocimg("Bricklets/bricklet_nfc_rfid_w_keyfob_100.jpg",
             "Bricklets/bricklet_nfc_rfid_w_keyfob_600.jpg",
             "NFC/RFID Bricklet with keyfob")
}}
{{
    tfdocimg("Cases/bricklet_nfc_rfid_case_tilted_100.jpg",
             "Cases/bricklet_nfc_rfid_case_tilted_600.jpg",
             "NFC/RFID Bricklet with case")
}}
{{
    tfdocimg("Bricklets/bricklet_nfc_rfid_brickv_100.jpg",
             "Bricklets/bricklet_nfc_rfid_brickv.jpg",
             "NFC/RFID Bricklet in Brick Viewer")
}}
{{
    tfdocimg("Dimensions/nfc_rfid_bricklet_dimensions_100.png",
             "Dimensions/nfc_rfid_bricklet_dimensions_600.png",
             "Outline and drilling plan")
}}
{{ tfdocend() }}<div class="section" id="features">
<h2>Features<a class="headerlink" href="#features" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Can read and write Mifare Classic and NFC Forum Type 1 and 2 RFID/NFC tags</li>
<li>Range is restricted to 10cm (3.94&quot;)</li>
<li>Operating frequency is 13.56 MHz</li>
</ul>
</div>
<div class="section" id="description">
<span id="nfc-rfid-bricklet-description"></span><h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference external" href="http://en.wikipedia.org/wiki/Near_field_communication">NFC</a>/
<a class="reference external" href="http://en.wikipedia.org/wiki/Rfid">RFID</a>
<a class="reference internal" href="../../Primer.html#primer-bricklets"><em>Bricklet</em></a> can be used to
extend <a class="reference internal" href="../../Primer.html#primer-bricks"><em>Bricks</em></a> by the possibility to read
and write NFC/RFID tags. To do this you only have to place a NFC or RFID
tag in the proximity (up to 10cm) of the Bricklet.</p>
<p>Currently we support Mifare Classic as well as NFC Forum Type 1 and 2 tags.</p>
<p>Capability for tag emulation as well as NFC P2P communication may be added
in the future firmware updates.</p>
</div>
<div class="section" id="technical-specifications">
<h2>Technical Specifications<a class="headerlink" href="#technical-specifications" title="Permalink to this headline">¶</a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="35%" />
<col width="65%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Property</th>
<th class="head">Value</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>NFC IC</td>
<td>PN532</td>
</tr>
<tr class="row-odd"><td>Current Consumption</td>
<td>115mA</td>
</tr>
<tr class="row-even"><td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td>Supported tags</td>
<td>Mifare Classic, NFC Forum Type 1, NFC Forum Type 2</td>
</tr>
<tr class="row-even"><td>Operating Frequency</td>
<td>13.56 MHz</td>
</tr>
<tr class="row-odd"><td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row-even"><td>Dimensions (W x D x H)</td>
<td>50 x 85 x 5mm (1.97 x 3.35 x 0.2&quot;)</td>
</tr>
<tr class="row-odd"><td>Weight</td>
<td>15g</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="resources">
<h2>Resources<a class="headerlink" href="#resources" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>PN532 Datasheet (<a class="reference external" href="https://github.com/Tinkerforge/nfc-rfid-bricklet/raw/master/datasheets/PN532.pdf">Download</a>)</li>
<li>Schematic (<a class="reference external" href="https://github.com/Tinkerforge/nfc-rfid-bricklet/raw/master/hardware/nfc-rfid-schematic.pdf">Download</a>)</li>
<li>Outline and drilling plan (<a class="reference external" href="../../_images/Dimensions/nfc_rfid_bricklet_dimensions.png">Download</a>)</li>
<li>Source code and design files (<a class="reference external" href="https://github.com/Tinkerforge/nfc-rfid-bricklet/zipball/master">Download</a>)</li>
</ul>
</div>
<div class="section" id="compatibility">
<h2>Compatibility<a class="headerlink" href="#compatibility" title="Permalink to this headline">¶</a></h2>
<p>The Bricklet should work with every tag that is either compatible to
Mifare Classic, NFC Forum Type 1 or NFC Forum Type 2. We explicitly
tested the Bricklet with the following tags:</p>
<p><strong>Mifare Classic:</strong></p>
<ul class="simple">
<li>FM11RF08</li>
<li>MF1S50</li>
</ul>
<p><strong>NFC Forum Type 1:</strong></p>
<ul class="simple">
<li>Jewel</li>
<li>Topaz 512 (TPZ-505-016)</li>
</ul>
<p><strong>NFC Forum Type 2:</strong></p>
<ul class="simple">
<li>NTAG203(F)</li>
<li>NTAG210</li>
<li>NTAG213</li>
<li>NTAG215</li>
<li>NTAG216</li>
<li>Mifare Ultralight (MF01CU1)</li>
</ul>
<p>Every smart phone that is capable of NFC can read NFC Forum Type 1 and 2 tags.</p>
</div>
<div class="section" id="page-sizes-and-other-things-to-know">
<h2>Page Sizes and other things to know<a class="headerlink" href="#page-sizes-and-other-things-to-know" title="Permalink to this headline">¶</a></h2>
<p>Mifare Classic and NFC Forum Type 1 as well as NFC Forum Type 2 have different
page sizes and a different memory structure. You have to keep track of this
structure to not accidentally lock a tag.</p>
<p><strong>Mifare Classic:</strong></p>
<ul class="simple">
<li>Page size 16 byte (1 page is read/written per call of <em>RequestPage</em>/<em>WritePage</em>).</li>
<li>4 pages build one sector.</li>
<li>Sector 0 (pages 0-3) should not be overwritten.</li>
<li>The last page in every sector controls the authentication keys for this sector (page 7, 11, 15, ..). Do not overwrite these pages if you don't know what you are doing.</li>
</ul>
<p><a class="reference external" href="http://www.adafruit.com">Adafruit</a> has a quite good description of the structure:
<a class="reference external" href="https://learn.adafruit.com/adafruit-pn532-rfid-nfc/mifare">Link</a></p>
<p><strong>NFC Forum Type 1:</strong></p>
<ul class="simple">
<li>Page size 8 byte (2 pages are read/written per call of <em>RequestPage</em>/<em>WritePage</em>).</li>
<li>pages 0-2 are reserved for lock control. Do not overwrite these pages if you don't know what you are doing.</li>
<li>page 15 is reserved and can not be written.</li>
</ul>
<p><strong>NFC Forum Type 2:</strong></p>
<ul class="simple">
<li>Page size 4 byte (4 pages are read/written per call of <em>RequestPage</em>/<em>WritePage</em>).</li>
<li>Page 0-1 are read only and contains the tag ID</li>
<li>Page 3-4 and the last two pages (page number depends on the size of the tag) contain lock bits. Do not overwrite these pages if you don't know what you are doing.</li>
</ul>
</div>
<div class="section" id="identifying-reading-and-writing-tags">
<h2>Identifying, Reading and Writing tags<a class="headerlink" href="#identifying-reading-and-writing-tags" title="Permalink to this headline">¶</a></h2>
<p>To identify and select a tag you have to call <em>RequestTagID</em> with a tag
type (Mifare Classic or NFC Forum Type 1/2). The state
of the Bricklet will change to <em>STATE_REQUEST_TAG_ID</em> and then change to
<em>STATE_REQUEST_TAG_ID_READY</em> if a tag was found. You can then get the tag ID
by calling <em>GetTagID</em>. Now the tag with this tag ID is selected and it can
be read or written. If the state changes to <em>STATE_REQUEST_TAG_ID_ERROR</em>
no tag with the given tag type was found. In this case you can try again
by calling <em>RequestTagID</em> again.</p>
<p>If you know the tag ID of your tag and <em>GetTagID</em> returns another tag ID it
means that another tag is also in the proximity of the reader. In this case
you can call <em>RequestTagID</em> again, the NFC/RFID Bricklet will cycle through up
to two tags if <em>RequestTagID</em> is called repeatedly. Therefore <em>RequestTagID</em>
select Tags.</p>
<p>If a tag is selected (i.e. the state is <em>STATE_REQUEST_TAG_ID_READY</em>) you can
read or write the tag page by page:</p>
<a class="reference external image-reference" href="../../_images/Misc/NFC_Type12.png"><img alt="NFC/RFID Bricklet read/write procedure for Type 1 and 2" class="align-center" src="../../_images/NFC_Type12.png" style="width: 623.0px; height: 142.0px;" /></a>
<p>To read a page you have to first call <em>RequestPage</em>. The state will change
to <em>STATE_REQUEST_PAGE_READY</em> after which you can get the page by calling
<em>GetPage</em>. Writing can be done by calling <em>WritePage</em>, the writing is finished
after the state changes to <em>STATE_WRITE_PAGE_READY</em>.</p>
<p>If a tag is selected you can read and write without calling <em>RequestTagID</em>
again as long as the tag isn't removed from the proximity of the
NFC/RFID Bricklet.</p>
<p><strong>Special Case for Mifare Classic</strong></p>
<p>In case of Mifare Classic you have to authenticate a page before you can
read or write it:</p>
<a class="reference external image-reference" href="../../_images/Misc/NFC_Mifare_Classic.png"><img alt="NFC/RFID Bricklet authenticate/read/write procedure for Mifare Classic" class="align-center" src="../../_images/NFC_Mifare_Classic.png" style="width: 953.0px; height: 172.0px;" /></a>
<p>This means that every time before you call <em>RequestPage</em> or <em>WritePage</em>,
you have to call <em>AuthenticatingMifareClassicPage</em> and wait for the state
to change to <em>STATE_AUTHENTICATING_MIFARE_CLASSIC_PAGE_READY</em>. Otherwise
Mifare Classic tags can be handled exactly as described above.</p>
<p>The default key (key number A) of a Mifare Classic tag is
[0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF].</p>
</div>
<div class="section" id="nfc-ndef-messages">
<h2>NFC NDEF Messages<a class="headerlink" href="#nfc-ndef-messages" title="Permalink to this headline">¶</a></h2>
<p>The NFC Forum has specified the NFC Data Exchange Format (NDEF) to
transfer messages from NFC tags to smart phones. NDEF Messages
consist of one or more NDEF Records. Many of the predefined
NDEF Records can be understood by any smart phone that is capable
of NFC communication.</p>
<p>We implemented an example program that can write <em>Text</em>, <em>URI</em> and
<em>Mime Media Type</em> Records to NFC Forum Type 1 and 2 tags.</p>
<p>The example is implemented in Python, but it can easily be used as a
starting point if you want to write NDEF Messages with any programming
language.</p>
<ul class="simple">
<li><a class="reference external" href="https://github.com/Tinkerforge/nfc-rfid-bricklet/raw/master/software/examples/python/example_write_ndef_message.py">Example on github</a>.</li>
</ul>
</div>
<div class="section" id="first-test">
<span id="nfc-rfid-bricklet-test"></span><h2>First Test<a class="headerlink" href="#first-test" title="Permalink to this headline">¶</a></h2>
<p>To test a NFC/RFID Bricklet you need to have <a class="reference internal" href="../../Software/Brickd.html#brickd"><em>Brick Daemon</em></a> and
<a class="reference internal" href="../../Software/Brickv.html#brickv"><em>Brick Viewer</em></a> installed. Brick Daemon acts as a proxy between
the USB interface of the Bricks and the API bindings. Brick Viewer connects
to Brick Daemon. It helps to figure out basic information about the connected
Bricks and Bricklets and allows to test them.</p>
<p>Connect the NFC/RFID Bricklet to a <a class="reference internal" href="../../Primer.html#primer-bricks"><em>Brick</em></a>
with a Bricklet Cable.</p>
<a class="reference external image-reference" href="../../_images/Bricklets/bricklet_nfc_rfid_w_master_1200.jpg"><img alt="NFC/RFID Bricklet with tag" class="align-center" src="../../_images/bricklet_nfc_rfid_w_master_600.jpg" style="width: 600.0px; height: 377.0px;" /></a>
<p>If you connect the Brick to the PC over USB, you should see a new tab named
&quot;NFC/RFID Bricklet&quot; in the Brick Viewer after a moment. Select this tab.</p>
<p>If everything went as expected you can now scan for tags and read/write
pages.</p>
<a class="reference external image-reference" href="../../_images/Bricklets/bricklet_nfc_rfid_brickv.jpg"><img alt="NFC/RFID Bricklet in Brick Viewer" class="align-center" src="../../_images/bricklet_nfc_rfid_brickv.jpg" style="width: 437.5px; height: 360.5px;" /></a>
<p>After this test you can go on with writing your own application.
See the <a class="reference internal" href="#nfc-rfid-bricklet-programming-interface"><em>Programming Interface</em></a>
section for the API of the NFC/RFID Bricklet and examples in different programming
languages.</p>
</div>
<div class="section" id="case">
<span id="nfc-rfid-bricklet-case"></span><h2>Case<a class="headerlink" href="#case" title="Permalink to this headline">¶</a></h2>
<p>A <a class="reference external" href="https://www.tinkerforge.com/en/shop/cases/case-nfc-rfid-bricklet.html">laser-cut case for the NFC/RFID Bricklet</a> is available.</p>
<a class="reference external image-reference" href="../../_images/Cases/bricklet_nfc_rfid_case_tilted_1000.jpg"><img alt="Case for NFC/RFID Bricklet" class="align-center" src="../../_images/bricklet_nfc_rfid_case_tilted_350.jpg" style="width: 350.0px; height: 270.0px;" /></a>
<p>The assembly is easiest if you follow the following steps:</p>
<ul class="simple">
<li>Put long screws through bottom plate,</li>
<li>put Bricklet on plate and fasten screws with spacers,</li>
<li>build up side plates,</li>
<li>plug side plates in bottom plate,</li>
<li>add top plate onto side plates and</li>
<li>add screws to top plate.</li>
</ul>
<p>Below you can see an exploded assembly drawing of the NFC/RFID Bricklet case:</p>
<a class="reference external image-reference" href="../../_images/Exploded/nfc_rfid_exploded.png"><img alt="Exploded assembly drawing for NFC/RFID Bricklet" class="align-center" src="../../_images/nfc_rfid_exploded_350.png" style="width: 350.0px; height: 432.0px;" /></a>
<p>Hint: There is a protective film on both sides of the plates,
you have to remove it before assembly.</p>
</div>
<div class="section" id="programming-interface">
<span id="nfc-rfid-bricklet-programming-interface"></span><h2>Programming Interface<a class="headerlink" href="#programming-interface" title="Permalink to this headline">¶</a></h2>
<p>See <a class="reference internal" href="../../Programming_Interface.html#programming-interface"><em>Programming Interface</em></a> for a detailed description.</p>
<table border="1" class="docutils">
<colgroup>
<col width="45%" />
<col width="18%" />
<col width="18%" />
<col width="18%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Language</th>
<th class="head">API</th>
<th class="head">Examples</th>
<th class="head">Installation</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>Modbus</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Modbus.html#nfc-rfid-bricklet-modbus-api"><em>API</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td>TCP/IP</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_TCPIP.html#nfc-rfid-bricklet-tcpip-api"><em>API</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row-even"><td>C/C++</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_C.html#nfc-rfid-bricklet-c-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_C.html#nfc-rfid-bricklet-c-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_C.html#api-bindings-c"><em>Installation</em></a></td>
</tr>
<tr class="row-odd"><td>C#</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_CSharp.html#nfc-rfid-bricklet-csharp-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_CSharp.html#nfc-rfid-bricklet-csharp-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_CSharp.html#api-bindings-csharp"><em>Installation</em></a></td>
</tr>
<tr class="row-even"><td>Delphi/Lazarus</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Delphi.html#nfc-rfid-bricklet-delphi-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Delphi.html#nfc-rfid-bricklet-delphi-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_Delphi.html#api-bindings-delphi"><em>Installation</em></a></td>
</tr>
<tr class="row-odd"><td>Java</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Java.html#nfc-rfid-bricklet-java-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Java.html#nfc-rfid-bricklet-java-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_Java.html#api-bindings-java"><em>Installation</em></a></td>
</tr>
<tr class="row-even"><td>JavaScript</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_JavaScript.html#nfc-rfid-bricklet-javascript-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_JavaScript.html#nfc-rfid-bricklet-javascript-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_JavaScript.html#api-bindings-javascript"><em>Installation</em></a></td>
</tr>
<tr class="row-odd"><td>LabVIEW</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_LabVIEW.html#nfc-rfid-bricklet-labview-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_LabVIEW.html#nfc-rfid-bricklet-labview-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_LabVIEW.html#api-bindings-labview"><em>Installation</em></a></td>
</tr>
<tr class="row-even"><td>Mathematica</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Mathematica.html#nfc-rfid-bricklet-mathematica-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Mathematica.html#nfc-rfid-bricklet-mathematica-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_Mathematica.html#api-bindings-mathematica"><em>Installation</em></a></td>
</tr>
<tr class="row-odd"><td>MATLAB/Octave</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_MATLAB.html#nfc-rfid-bricklet-matlab-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_MATLAB.html#nfc-rfid-bricklet-matlab-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_MATLAB.html#api-bindings-matlab"><em>Installation</em></a></td>
</tr>
<tr class="row-even"><td>Perl</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Perl.html#nfc-rfid-bricklet-perl-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Perl.html#nfc-rfid-bricklet-perl-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_Perl.html#api-bindings-perl"><em>Installation</em></a></td>
</tr>
<tr class="row-odd"><td>PHP</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_PHP.html#nfc-rfid-bricklet-php-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_PHP.html#nfc-rfid-bricklet-php-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_PHP.html#api-bindings-php"><em>Installation</em></a></td>
</tr>
<tr class="row-even"><td>Python</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Python.html#nfc-rfid-bricklet-python-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Python.html#nfc-rfid-bricklet-python-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_Python.html#api-bindings-python"><em>Installation</em></a></td>
</tr>
<tr class="row-odd"><td>Ruby</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Ruby.html#nfc-rfid-bricklet-ruby-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Ruby.html#nfc-rfid-bricklet-ruby-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_Ruby.html#api-bindings-ruby"><em>Installation</em></a></td>
</tr>
<tr class="row-even"><td>Shell</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Shell.html#nfc-rfid-bricklet-shell-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_Shell.html#nfc-rfid-bricklet-shell-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_Shell.html#api-bindings-shell"><em>Installation</em></a></td>
</tr>
<tr class="row-odd"><td>Visual Basic .NET</td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_VBNET.html#nfc-rfid-bricklet-vbnet-api"><em>API</em></a></td>
<td><a class="reference internal" href="../../Software/Bricklets/NFCRFID_Bricklet_VBNET.html#nfc-rfid-bricklet-vbnet-examples"><em>Examples</em></a></td>
<td><a class="reference internal" href="../../Software/API_Bindings_VBNET.html#api-bindings-vbnet"><em>Installation</em></a></td>
</tr>
</tbody>
</table>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
		<div id="tf_license">
			<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
				<img alt="Creative Commons Licence" width="88" height="31" style="border-width:0" src="/static/images/cc_license_logo.png" />
			</a>
			The content of this page is licensed under
			<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution 3.0 Unported License</a>.
		</div>
		</div>
	</div>
</div>

    <div class="footer">
        &copy; Copyright 2011-2015, Olaf Lüke (olaf@tinkerforge.com).
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
    </div>
  </body>
</html>