<h3 class="post-title entry-title" itemprop="name" style="margin: 0px; position: relative; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; color: #ffffff; background-color: #000000;">Connecting the MRF24WB0MA to the Arduino</h3>
<div class="post-header" style="line-height: 1.6; margin: 0px 0px 1em; color: #ffffff; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; background-color: #000000;">
   <div class="post-header-line-1">&nbsp;</div>
   </div>
<div class="post-body entry-content" id="post-body-578986898748490685" itemprop="articleBody" style="width: 776px; position: relative; line-height: 1.4; color: #ffffff; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; background-color: #000000;">UPDATE 01-Mar-2016: Use Atmel's&nbsp;<a href="http://www.digikey.com/product-detail/en/atmel/ATWINC1500-MR210PA/ATWINC1500-MR210PA-ND/5015469" target="_blank" style="text-decoration-line: none; color: #444444;">ATWINC1500</a>&nbsp;instead - Low power, WPA-Entreprise, better Stability!<br /><br />UPDATE 01/05/2013: They are calling all this "Internet of Things" now lol :D<br /><br /><br /><br />Power to the masses.<br /><br />
   <div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-eO67cLiFLpI/TptMMCOQ3oI/AAAAAAAAARQ/Le2QOnYwMEk/s1600/IMG_8128+%2528Medium%2529.JPG" imageanchor="1" style="text-decoration-line: none; color: #444444; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" height="266" src="https://2.bp.blogspot.com/-eO67cLiFLpI/TptMMCOQ3oI/AAAAAAAAARQ/Le2QOnYwMEk/s400/IMG_8128+%2528Medium%2529.JPG" width="400" style="border: 1px solid transparent; position: relative; padding: 8px; background: rgb(34, 34, 34); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; border-radius: 0px;" /></a></div>
   <br /><br />With the recent availability of&nbsp;<i>cheap&nbsp;</i>WiFi modules like<a href="http://uk.farnell.com/microchip/mrf24wb0ma-rm/module-rf-trx-2-4ghz-ieee-802-11/dp/1823142" style="text-decoration-line: none; color: #444444;" target="_blank">&nbsp;Microchip's&nbsp;MRF24WB0MA</a>, I find it quite difficult to NOT use them in some way or another, given their essentially limitless potential in&nbsp;<i>remote&nbsp;</i>sensing/control applications.<br /><br />The word "remote" here retains its&nbsp;full meaning; you can basically turn on that lamp in your room from the other side of the&nbsp;<i>planet</i>, - or anywhere in the world for that matter - provided that you can get access to that thing we call the internet.<br /><br />
   <div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-i-pBo2icz1Q/TptMEXMcahI/AAAAAAAAARI/1NjmQ8cPN7g/s1600/IMG_8125+%2528Medium%2529.JPG" imageanchor="1" style="text-decoration-line: none; color: #444444; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" height="213" src="https://3.bp.blogspot.com/-i-pBo2icz1Q/TptMEXMcahI/AAAAAAAAARI/1NjmQ8cPN7g/s320/IMG_8125+%2528Medium%2529.JPG" width="320" style="border: 1px solid transparent; position: relative; padding: 8px; background: rgb(34, 34, 34); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; border-radius: 0px;" /></a></div>
   <br /><br />In this post, I will show you how to use the MRF24WB0MA on the Arduino platform.<br /><br />Things you will need:<br /><br />- MRF24WB0MA WiFi Module. (Available from Farnell&nbsp;<a href="http://uk.farnell.com/microchip/mrf24wb0ma-rm/module-rf-trx-2-4ghz-ieee-802-11/dp/1823142?Ntt=mrf24wb0ma" style="text-decoration-line: none; color: #444444;" target="_blank">here</a>)<br />- 4x 4.7k Ohm Resistors<br />- 2x 1.0uF Capacitors.<br />- Some way of connecting these together. I used a perfboard and some wires.&nbsp;<br /><br />[Also, check out<a href="http://uk.farnell.com/arduino/" style="text-decoration-line: none; color: #444444;" target="_blank">&nbsp;Farnell's Arduino page</a>&nbsp;for some interesting Arduino-related products. These guys are cool.]<br /><br />The schematics described below are based on the&nbsp;<a href="http://asynclabs.com/wiki/index.php?title=WiShield_1.0" style="text-decoration-line: none; color: #444444;" target="_blank">WiShield 1.0</a>&nbsp;Arduino shield from AsyncLabs.<br /><br />First you will have to connect the module as described below to the Arduino shield. The resistors are all 4.7k and the two caps are 1.0uF each.&nbsp;<br /><br />
   <div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-G34XEMSsR6M/TptJRvsF9aI/AAAAAAAAARA/awgsSkyI-pM/s1600/mrf_arduino.png" imageanchor="1" style="text-decoration-line: none; color: #444444; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" height="297" src="https://4.bp.blogspot.com/-G34XEMSsR6M/TptJRvsF9aI/AAAAAAAAARA/awgsSkyI-pM/s400/mrf_arduino.png" width="400" style="border: 1px solid transparent; position: relative; padding: 8px; background: rgb(34, 34, 34); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; border-radius: 0px;" /></a></div>
   <div class="separator" style="clear: both; text-align: center;"><br /></div>
   <br /><b>Remember: Power is at 3.3v.&nbsp;</b><br /><br />The resulting circuit should be something similar to this:<br /><br />
   <div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-xdSHmkWFku0/TptMfsoQwRI/AAAAAAAAARY/DjZr1kRW6XQ/s1600/IMG_8129+%2528Medium%2529.JPG" imageanchor="1" style="text-decoration-line: none; color: #444444; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" height="266" src="https://1.bp.blogspot.com/-xdSHmkWFku0/TptMfsoQwRI/AAAAAAAAARY/DjZr1kRW6XQ/s400/IMG_8129+%2528Medium%2529.JPG" width="400" style="border: 1px solid transparent; position: relative; padding: 8px; background: rgb(34, 34, 34); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; border-radius: 0px;" /></a></div>
   <br /><br />Then you'll just hook this up to your Arduino. Your setup may look&nbsp;similar&nbsp;to this:<br /><br />
   <div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-9t96IGzYWwU/TptNDHPSD3I/AAAAAAAAARg/ymXUnxx5Alk/s1600/IMG_8131+%2528Medium%2529.JPG" imageanchor="1" style="text-decoration-line: none; color: #444444; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" height="266" src="https://1.bp.blogspot.com/-9t96IGzYWwU/TptNDHPSD3I/AAAAAAAAARg/ymXUnxx5Alk/s400/IMG_8131+%2528Medium%2529.JPG" width="400" style="border: 1px solid transparent; position: relative; padding: 8px; background: rgb(34, 34, 34); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; border-radius: 0px;" /></a></div>
   <br /><br />The task of connecting the WiFi module to the Arduino is way simpler than the above pictures might suggest. It's really only about connecting the SPI interface (5 wires) and Power + Reset (3 wires).<br /><br />The hardware setup described is basically equivalent to an Arduino board with a WiShield 1.0 stacked on it.<br /><br />Therefore, as you might have guessed, things get easier from now on - it's all software.<br /><br />On your computer:<br /><br /><span class="Apple-style-span" style="background-color: white; font-family: sans-serif; line-height: 19px;"></span><br />
   <ol style="line-height: 1.5em; list-style-image: none; margin: 0.3em 0px 0px 3.2em; padding: 0px;">
      <li style="padding: 0px; margin: 0px 0px 0.1em;">Download the WiShield library&nbsp;<a href="http://asynclabs.com/wiki/index.php?title=WiShield_library" style="text-decoration-line: none; color: #444444;" target="_blank">here</a>. [now mirrored on my&nbsp;<a href="https://github.com/manis404/WiShield" target="_blank" style="text-decoration-line: none; color: #444444;">github</a>]</li>
      <li style="padding: 0px; margin: 0px 0px 0.1em;">Put all the files/directories under&nbsp;<arduino dir="" sketch="">/libraries/WiShield/ directory.</arduino></li>
      <li style="padding: 0px; margin: 0px 0px 0.1em;">Restart the Arduino environment, so that the library files get built and the sketches become available.</li>
      </ol>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;">Done. At this stage you are ready to experiment with the examples included in the WiShield libraries.&nbsp;</span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;">I'll suggest you to start with the "WiShield&gt;Webserver" example.&nbsp;</span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;">This is a screencap of the page you should get when you type in the IP address of the module in your browser:</span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-dDw4Hg3eoVY/TptUbrOYEOI/AAAAAAAAARo/9PSv68bIrSY/s1600/1.jpg" imageanchor="1" style="text-decoration-line: none; color: #444444; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" height="311" src="https://2.bp.blogspot.com/-dDw4Hg3eoVY/TptUbrOYEOI/AAAAAAAAARo/9PSv68bIrSY/s400/1.jpg" width="400" style="border: 1px solid transparent; position: relative; padding: 8px; background: rgb(34, 34, 34); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; border-radius: 0px;" /></a></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;">You'll have to hardcode the IP settings in the Arduino Sketch. The module does NOT support DHCP for automatic IP assignment in the examples. This implies that if you are using infrastructure mode, you will need to set your router to reserve the IP address you set in the Arduino Sketch.&nbsp;</span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;">If you are using adhoc mode, things get simpler. Just make sure you set your computer up for static IP addressing. To use adhoc mode: In the sketch, change the line containing&nbsp;</span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><span class="Apple-style-span" style="font-family: &quot;courier new&quot;, courier, monospace;"><b>unsigned char wireless_mode = WIRELESS_MODE_INFRA;</b></span></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;">to&nbsp;</span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><span class="Apple-style-span" style="font-family: &quot;courier new&quot;, courier, monospace;"><b>unsigned char wireless_mode = WIRELESS_MODE_ADHOC;</b></span></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;">I noticed that if you use WPA2 authentication, the module will take about 30seconds to authenticate. No need to panic if the LED (shown on the schematic) does not light up right away.&nbsp;</span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;">Also, make sure that you set up the security type properly:</span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
   <div><span class="Apple-style-span" style="line-height: 24px;"></span><br />
      <div style="font-family: &quot;Courier New&quot;, Courier, monospace;">
         <pre></pre>
         </div>
      <span class="Apple-style-span" style="line-height: 24px;"></span><br />
      <div style="font-family: &quot;Courier New&quot;, Courier, monospace;"><span class="Apple-style-span" style="line-height: 24px;"><span style="color: #cc6600;">unsigned</span>&nbsp;<span style="color: #cc6600;">char</span>&nbsp;security_type = 0;<span class="Apple-tab-span" style="white-space: pre;"></span><span style="color: #7e7e7e;">// 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2</span></span></div>
      <span class="Apple-style-span" style="line-height: 24px;"></span><br />
      <div style="font-family: &quot;Courier New&quot;, Courier, monospace;"><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
      <span class="Apple-style-span" style="line-height: 24px;"></span><br />
      <div style="font-family: &quot;Courier New&quot;, Courier, monospace;">&nbsp;</div>
      <span class="Apple-style-span" style="line-height: 24px;"></span><br />
      <div style="font-family: &quot;Courier New&quot;, Courier, monospace;"><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
      <span class="Apple-style-span" style="line-height: 24px;"></span><br />
      <div><span class="Apple-style-span" style="line-height: 24px;"><br /></span></div>
      <span class="Apple-style-span" style="line-height: 24px;"></span>
      <div><span class="Apple-style-span" style="line-height: 24px;">After you've managed to correctly run the examples included in the libraries, check out<a href="http://asynclabs.com/forums/" style="text-decoration-line: none; color: #444444;" target="_blank">&nbsp;AsyncLabs' forums</a>&nbsp;for a variety of more interesting, real-life applications.&nbsp;</span></div>
      </div>
   </div>