
<!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>RS485 Extension – 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="Master Extensions" href="Master_Extensions.html" />
    <link rel="next" title="WIFI Extension" href="WIFI_Extension.html" />
    <link rel="prev" title="Ethernet Extension" href="Ethernet_Extension.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.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"><a class="reference internal" href="../Bricklets/Bricklets.html">Bricklets</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="Master_Extensions.html">Master Extensions</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="Chibi_Extension.html">Chibi Extension</a></li>
<li class="toctree-l3"><a class="reference internal" href="Ethernet_Extension.html">Ethernet Extension</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="">RS485 Extension</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="#connectivity">Connectivity</a></li>
<li class="toctree-l4"><a class="reference internal" href="#rs485-bus-assembly">RS485 Bus Assembly</a><ul>
<li class="toctree-l5"><a class="reference internal" href="#rs485-configuration">RS485 Configuration</a></li>
<li class="toctree-l5"><a class="reference internal" href="#rs485-bus-modification">RS485 Bus Modification</a></li>
</ul>
</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="WIFI_Extension.html">WIFI Extension</a></li>
</ul>
</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.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.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.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 class="breadcrumbs">
<a href="../../Hardware.html">Hardware</a> / <a href="./Master_Extensions.html">Master Extensions</a> / RS485 Extension
</div>



<div id="shoplink_img">
	<a href="../../../shop/master-extensions/rs485-master-extension.html"><img alt="Shop" width="32" height="40" src="../../_images/Misc/cart-icon.png" /></a>
</div>
<div id="shoplink_a">
	<a href="../../../shop/master-extensions/rs485-master-extension.html">In Shop</a>
</div>



    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="rs485-extension">
<span id="id1"></span><h1>RS485 Extension<a class="headerlink" href="#rs485-extension" title="Permalink to this headline">¶</a></h1>
{% from "macros.html" import tfdocstart, tfdocimg, tfdocend %}
{{
    tfdocstart("Extensions/extension_rs485_tilted_350.jpg",
               "Extensions/extension_rs485_tilted_600.jpg",
               "RS485 Extension")
}}
{{
    tfdocimg("Extensions/extension_rs485_top_100.jpg",
             "Extensions/extension_rs485_top_600.jpg",
             "RS485 Extension top")
}}
{{
    tfdocimg("Extensions/extension_rs485_bottom_100.jpg",
             "Extensions/extension_rs485_bottom_600.jpg",
             "RS485 Extension bottom")
}}
{{ tfdocend() }}<div class="section" id="features">
<h2>Features<a class="headerlink" href="#features" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Allows cable based interconnection between stacks of Bricks</li>
<li>Long distance connections (up to 1200m)</li>
<li>Configurable baud rate, parity and stop bits</li>
<li>Can be used in existing RS485 networks (<a class="reference internal" href="../../Low_Level_Protocols/Modbus.html#llproto-modbus">Modbus RTU</a>)</li>
</ul>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>The RS485 Extension can be used for long range cable based
inter-<a class="reference internal" href="../../Primer.html#primer-stack">stack</a> communication. It uses the RS485 differential
interface standard to achieve ranges of <strong>up to 1200m</strong>.</p>
<p>To establish a RS485 bus with <a class="reference internal" href="../../Primer.html#primer-bricks">Bricks</a>, two RS485
Extensions and two <a class="reference internal" href="../Bricks/Master_Brick.html#master-brick">Master Bricks</a> are needed. Both Master
Bricks can be connected to a full stack of Bricks and
<a class="reference internal" href="../../Primer.html#primer-bricklets">Bricklets</a>, whereas one Master Brick is
battery powered and one is connected with USB, Ethernet or WIFI to a PC. From a
programming perspective
the RS485 bus is completely transparent, i.e. the two stacks can
be used exactly the same way as if they were both connected via USB.</p>
<p>It is also possible to create a bus with several RS485 Extension where
only one is connected via USB, Ethernet or WIFI to a PC (many-to-one routing).</p>
<p><a class="reference internal" href="../../Low_Level_Protocols/Modbus.html#llproto-modbus">Modbus RTU</a> is used as the
protocol on the RS485 interface. This allows to use a stack of Bricks
and Bricklets with an RS485 Extension to be integrated in existing
Modbus networks. It is also possible to communicate with a stack
directly via Modbus from an embedded device or over a Modbus gateway.</p>
<p>The following combinations with other Extensions in a stack are possible
(regardless of order):</p>
<ul class="simple">
<li>RS485 Master / Chibi Slave</li>
<li>RS485 Master / Ethernet</li>
<li>RS485 Master / WIFI</li>
<li>RS485 Slave / Chibi Master</li>
</ul>
</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>Current Consumption</td>
<td>8mA</td>
</tr>
<tr class="row-odd"><td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row-even"><td>Maximum Distance</td>
<td>1200m</td>
</tr>
<tr class="row-odd"><td>Maximum Baud Rate</td>
<td>2Mbit/s</td>
</tr>
<tr class="row-even"><td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td>Dimensions (W x D x H)</td>
<td>40 x 40 x 16mm (1.57 x 1.57 x 0.63&quot;)</td>
</tr>
<tr class="row-even"><td>Weight</td>
<td>13g</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>ADM3485 datasheet (<a class="reference external" href="https://github.com/Tinkerforge/rs485-extension/raw/master/datasheets/ADM3485.pdf">Download</a>)</li>
<li>Schematic (<a class="reference external" href="https://github.com/Tinkerforge/rs485-extension/raw/master/hardware/rs485-extension-schematic.pdf">Download</a>)</li>
<li>Outline and drilling plan (<a class="reference external" href="../../_images/Dimensions/rs485_extension_dimensions.png">Download</a>)</li>
<li>Source code and design files (<a class="reference external" href="https://github.com/Tinkerforge/rs485-extension">Download</a>)</li>
</ul>
</div>
<div class="section" id="connectivity">
<span id="rs485-connectivity"></span><h2>Connectivity<a class="headerlink" href="#connectivity" title="Permalink to this headline">¶</a></h2>
<p>The following picture shows the connection possibilities of the RS485-Extension.</p>
<a class="reference external image-reference" href="../../_images/Extensions/extension_rs485_caption_800.jpg"><img alt="RS485 Extension connectivity" class="align-center" src="../../_images/extension_rs485_caption_600.jpg" style="width: 600.0px; height: 394.0px;" /></a>
</div>
<div class="section" id="rs485-bus-assembly">
<h2>RS485 Bus Assembly<a class="headerlink" href="#rs485-bus-assembly" title="Permalink to this headline">¶</a></h2>
<p>A RS485 bus consists of one master and multiple slaves.
RS485 master is the Master Brick which has a USB, Ethernet or WIFI connection
to the PC running brickd. All the other Master Bricks with RS485 Extension
must not have a USB, Ethernet or WIFI connection (they can use a USB Power Supply).
Each RS485 slave is identified with its own ID. The IDs have
to be unique on the bus.</p>
<p>To create a RS485 bus, stack the RS485 Extension on top of a Master Brick.
Connect the Master Brick via USB, Ethernet or WIFI with your PC and start the
Brick Viewer software. You should see the Master Brick view
with the identified RS485 Extension (see images below). Configure the extension
as slave or master (as described <a class="reference internal" href="#rs485-configuration">here</a>).</p>
<p>If you have configured all extensions you can build your system. Connect
Bricks and Bricklets as you like. The Master Brick of each stack has to be the
lowermost Brick (except if you are using a Power Supply). The RS485 Extension
can be positioned in the stack as you wish. Wire up the RS485 stacks and set
the termination switch on the first and last RS485 Extension in the bus to
&quot;on&quot;, as shown below.</p>
<a class="reference external image-reference" href="../../_images/Extensions/extension_rs485_assembly.jpg"><img alt="Assembly of RS485 Extension" class="align-center" src="../../_images/extension_rs485_assembly.jpg" style="width: 871.2px; height: 334.8px;" /></a>
<p>You have to power up the slaves before the master, since the RS485 master
searches for slaves only at startup. You should now be able to see all
connected stacks in the Brick Viewer.</p>
<div class="section" id="rs485-configuration">
<span id="id2"></span><h3>RS485 Configuration<a class="headerlink" href="#rs485-configuration" title="Permalink to this headline">¶</a></h3>
<p>To configure a RS485 Extension you first have to choose the baud rate,
parity and stop bits.</p>
<a class="reference external image-reference" href="../../_images/Extensions/extension_rs485_config.jpg"><img alt="Configuration of RS485 Extension" class="align-center" src="../../_images/extension_rs485_config.jpg" style="width: 471.0px; height: 267.0px;" /></a>
<p>If your bus isn't absolutely huge you should probably
choose &quot;speed: 2000000 (2Mbit/s), parity: None, Stop bits: 1&quot;. If you start to
get timeouts and the CRC error counter is rising rapidly, you might want
to lower the baud rate. If you want to use a stack with RS485 Extension in
your existing Modbus network, you have to match the values with the
other bus participants.</p>
<p>For slave configuration choose &quot;Slave&quot; as type and set an address for
the slave (1-255).</p>
<a class="reference external image-reference" href="../../_images/Extensions/extension_rs485_slave.jpg"><img alt="Configuration of RS485 in slave mode" class="align-center" src="../../_images/extension_rs485_slave.jpg" style="width: 471.0px; height: 267.0px;" /></a>
<p>For master configuration choose &quot;Master&quot; as type and input the addresses
of the slaves in the RS485 bus as a comma separated list.</p>
<a class="reference external image-reference" href="../../_images/Extensions/extension_rs485_master.jpg"><img alt="Configuration of RS485 in master mode" class="align-center" src="../../_images/extension_rs485_master.jpg" style="width: 472.0px; height: 334.0px;" /></a>
<p>At the end, press &quot;Save RS485 Configuration&quot; to save the configuration permanently
on the RS485 Extension.
The Master Brick has to be restarted to apply the new configuration.</p>
</div>
<div class="section" id="rs485-bus-modification">
<h3>RS485 Bus Modification<a class="headerlink" href="#rs485-bus-modification" title="Permalink to this headline">¶</a></h3>
<p>If you want to change something in your bus, e.g. add new Bricks or
Bricklets, you have to power down the stack you would like to change.
Change it and repower it. If the stack was slave in the RS485 bus, you
also have to reset the RS485 master (it only searches for new
Bricks and Bricklets on startup).
This can be achieved by a power cycle or pressing the reset
button on the Master Brick.</p>
</div>
</div>
<div class="section" id="programming-interface">
<h2>Programming Interface<a class="headerlink" href="#programming-interface" title="Permalink to this headline">¶</a></h2>
<p>See <a class="reference internal" href="../Bricks/Master_Brick.html#master-brick-programming-interface">Master Brick documentation</a>.</p>
</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>

  </body>
</html>