{"id":284,"date":"2011-11-19T10:46:02","date_gmt":"2011-11-19T10:46:02","guid":{"rendered":"http:\/\/www.martyndavis.com\/?p=284"},"modified":"2021-07-29T10:57:32","modified_gmt":"2021-07-29T09:57:32","slug":"using-the-ethernet-shield-with-veroboarduino","status":"publish","type":"post","link":"https:\/\/www.martyndavis.com\/?p=284","title":{"rendered":"Using the Ethernet Shield with Veroboarduino"},"content":{"rendered":"<p>In which I investigate whether I can connect an Arduino Ethernet shield to my Veroboarduino. Not as easy as I first thought it would be!<\/p>\n<p><!--more--><\/p>\n<p><span style=\"color: #999999;\"><em>Disclaimer: this post discusses using the Ethernet shield in a way for which it wasn&#8217;t designed. If you blow yours up experimenting, you&#8217;ll have to buy another one, not blame me :) &nbsp;However, mine still works OK.<\/em><\/span><\/p>\n<p>So, the nice chaps at Farnell (<a href=\"http:\/\/uk.farnell.com\" target=\"_blank\" rel=\"noopener\">http:\/\/uk.farnell.com<\/a>) sent me an <a href=\"http:\/\/uk.farnell.com\/arduino\/a000031\/board-arduino-ethernet-shield\/dp\/1848680\" target=\"_blank\" rel=\"noopener\">Arduino Ethernet shield<\/a> to play around with and review. &nbsp;(Update: I see they now have a dedicated Arduino section at&nbsp;<a href=\"http:\/\/uk.farnell.com\/arduino\/\" target=\"_blank\" rel=\"noopener\">http:\/\/uk.farnell.com\/arduino\/<\/a>)<\/p>\n<p>Reviewing a stock board is pretty boring &#8211; nice little Arduino box, free stickers etc. I plugged it on the top of my Uno, loaded up the Example &#8220;WebServer&#8221; program available from the IDE&#8217;s File\u2192Examples\u2192Ethernet\u2192WebServer menu, set the IP address, subnet mask, MAC address (it&#8217;s the number on the sticker on the bottom of the board), uploaded the &#8220;sketch&#8221; and off it went. Immediately working. Like I say, it works out of the box &#8211; cool, but not very exciting to write about!<\/p>\n<p><a href=\"http:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/terminal.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-291\" title=\"terminal\" src=\"http:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/terminal-300x205.jpg\" alt=\"\" width=\"300\" height=\"205\" srcset=\"https:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/terminal-300x205.jpg 300w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/terminal.jpg 776w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>However my mind immediately started thinking&#8230; it&#8217;s all very well playing with this, but what if I want to build this in to a finished project? If you&#8217;ve read previous posts which explain how to build an Arduino-compatible circuit, you&#8217;ll know there&#8217;s no point buying a new Arduino board each time you make a new invention. Prototype on your Arduino, then build a Veroboarduino to make it permanent. But how would you interface a shield such as this Ethernet shield to a Veroboarduino?<\/p>\n<p>In my innocence my first thought would be that the shield just uses a few of the pins on the headers &#8211; find the pins, connect them appropriately, and off you go.<\/p>\n<p>So firstly I built up a quick Veroboarduino on a breadboard for this test:<\/p>\n<p><a href=\"http:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-285\" title=\"1\" src=\"http:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/1-300x170.jpg\" alt=\"\" width=\"300\" height=\"170\" srcset=\"https:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/1-300x170.jpg 300w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/1.jpg 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>On the board you can see the FTDI connector I use and a big LED. I ran the &#8220;blink&#8221; program to ensure everything was working OK. So far so good :)<\/p>\n<p>First test &#8211; I connected +5V and GND from the breadboard to 5V and GND header sockets. My first problem! The ethernet shield&#8217;s &#8220;ON&#8221; LED wouldn&#8217;t light. Hmm&#8230; so how does it get its power? I tried all the GND and voltage sockets on the board &#8211; none of them would cause the shield to power up.<\/p>\n<p>Then I realised that, as well as connecting to all the normal Arduino header sockets, there&#8217;s also a six-pin header socket under the shield which connects to the Arduino&#8217;s ICSP pins. Aha! The pinout of the Arduino&#8217;s ICSP header (the six pins by the reset button) are as follows (click the image to see it larger). Pay attention&#8230; we&#8217;ll revisit this later!<\/p>\n<p><a href=\"http:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/icsp.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-287\" title=\"icsp\" src=\"http:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/icsp-300x48.png\" alt=\"\" width=\"300\" height=\"48\" srcset=\"https:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/icsp-300x48.png 300w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/icsp.png 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><em>&nbsp;(NOTE: this image shows the pins as if if you are looking down onto the top of an Arduino board. <strong>NOT the underside of the shield.<\/strong>)<\/em><\/p>\n<pre> 1 - MISO\n 2 - VCC (+5V)\n 3 - SCK\n 4 - MOSI\n 5 - RESET\n 6 - GND<\/pre>\n<p>So pins 2 and 6 &#8211; I connected them to the power rails of my breadboard and the shield&#8217;s &#8220;ON&#8221; LED lit up. One success!<\/p>\n<p>Now&#8230; what pins does the shield use?<\/p>\n<p>This was a useful post on the Arduino forums, a chap called Rob Gray has compiled a list of shields and what pins they use: <a href=\"http:\/\/www.arduino.cc\/cgi-bin\/yabb2\/YaBB.pl?num=1286284349\/5#5\" target=\"_blank\" rel=\"noopener\">http:\/\/www.arduino.cc\/cgi-bin\/yabb2\/YaBB.pl?num=1286284349\/5#5<\/a>&nbsp;(bottom post at time of writing).<\/p>\n<p>According to his sheet, &nbsp;the Ethernet shield uses the following pins: D2, D10, D11, D12, D13, A0 and A1.<\/p>\n<p>So first I tried hooking these up, as one would..! &nbsp;Expectantly I browsed to 192.168.1.7 (the IP address I&#8217;d assigned the board in the sketch). No response from the board. Hmmm.<\/p>\n<p>Then I noticed Rob&#8217;s comment in the sheet on the Ethernet shield&#8217;s line: &#8220;<em>SPI signals picked up from the ISP header<\/em>&#8221;<\/p>\n<p>The ICSP header actually just connects to pins on the Atmel chip &#8211; here&#8217;s where they go&#8230;<\/p>\n<pre> MOSI - D11\n MISO - D12\n SCK  - D13\n RST  - RESET<\/pre>\n<p>So, I figured I needed to connect up more than just the power to the shield&#8217;s ICSP input! &nbsp;I didn&#8217;t bother with the RESET connection, but I attached the others. On the top of the shield I just kept D10 and D2 &#8220;passed through&#8221; to the D10 and D2 pins of the breadboard.<\/p>\n<p>I ignored A0 and A1 which Rob&#8217;s sheet said were the other pins the shield uses &#8211; as I&#8217;d read elsewhere that these are used to control access to the SD card reader built into the Ethernet shield. I might experiment with this later but ignored them for the time being.<\/p>\n<p>And&#8230; power up the circuit again, browse to 192.168.1.7, and I&#8217;m greeted with:<\/p>\n<p><a href=\"http:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/online.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-292\" title=\"online\" src=\"http:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/online-300x152.jpg\" alt=\"\" width=\"300\" height=\"152\" srcset=\"https:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/online-300x152.jpg 300w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2011\/11\/online.jpg 757w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>So, as a quick summary: to connect a Veroboarduino or breadboard Arduino to the Ethernet shield:<\/p>\n<ul>\n<li>Connect the ICSP sockets on the bottom of the shield as described above for power and data connections.<\/li>\n<li>&#8220;Pass through&#8221; D10 and D2<\/li>\n<li>A0 and A1 are used for SD card access (I didn&#8217;t connect them &#8211; I wasn&#8217;t using it &#8211; something to experiment with at a later date)<\/li>\n<\/ul>\n<div>Hope this helps&#8230; cheers!<\/div>\n<pre><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In which I investigate whether I can connect an Arduino Ethernet shield to my Veroboarduino. Not as easy as I first thought it would be!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/posts\/284"}],"collection":[{"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=284"}],"version-history":[{"count":17,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/posts\/284\/revisions"}],"predecessor-version":[{"id":818,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/posts\/284\/revisions\/818"}],"wp:attachment":[{"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}