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!

Disclaimer: this post discusses using the Ethernet shield in a way for which it wasn’t designed. If you blow yours up experimenting, you’ll have to buy another one, not blame me :) However, mine still works OK.

So, the nice chaps at Farnell (http://uk.farnell.com) sent me an Arduino Ethernet shield to play around with and review. (Update: I see they now have a dedicated Arduino section at http://uk.farnell.com/arduino/)

Reviewing a stock board is pretty boring – nice little Arduino box, free stickers etc. I plugged it on the top of my Uno, loaded up the Example “WebServer” program available from the IDE’s File→Examples→Ethernet→WebServer menu, set the IP address, subnet mask, MAC address (it’s the number on the sticker on the bottom of the board), uploaded the “sketch” and off it went. Immediately working. Like I say, it works out of the box – cool, but not very exciting to write about!

However my mind immediately started thinking… it’s all very well playing with this, but what if I want to build this in to a finished project? If you’ve read previous posts which explain how to build an Arduino-compatible circuit, you’ll know there’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?

In my innocence my first thought would be that the shield just uses a few of the pins on the headers – find the pins, connect them appropriately, and off you go.

So firstly I built up a quick Veroboarduino on a breadboard for this test:

On the board you can see the FTDI connector I use and a big LED. I ran the “blink” program to ensure everything was working OK. So far so good :)

First test – I connected +5V and GND from the breadboard to 5V and GND header sockets. My first problem! The ethernet shield’s “ON” LED wouldn’t light. Hmm… so how does it get its power? I tried all the GND and voltage sockets on the board – none of them would cause the shield to power up.

Then I realised that, as well as connecting to all the normal Arduino header sockets, there’s also a six-pin header socket under the shield which connects to the Arduino’s ICSP pins. Aha! The pinout of the Arduino’s ICSP header (the six pins by the reset button) are as follows (click the image to see it larger). Pay attention… we’ll revisit this later!

(NOTE: this image shows the pins as if if you are looking down onto the top of an Arduino board. NOT the underside of the shield.)

1 - MISO 2 - VCC (+5V) 3 - SCK 4 - MOSI 5 - RESET 6 - GND

So pins 2 and 6 – I connected them to the power rails of my breadboard and the shield’s “ON” LED lit up. One success!

Now… what pins does the shield use?

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: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286284349/5#5 (bottom post at time of writing).

According to his sheet, the Ethernet shield uses the following pins: D2, D10, D11, D12, D13, A0 and A1.

So first I tried hooking these up, as one would..! Expectantly I browsed to 192.168.1.7 (the IP address I’d assigned the board in the sketch). No response from the board. Hmmm.

Then I noticed Rob’s comment in the sheet on the Ethernet shield’s line: “SPI signals picked up from the ISP header”

The ICSP header actually just connects to pins on the Atmel chip – here’s where they go…

MOSI - D11 MISO - D12 SCK - D13 RST - RESET

So, I figured I needed to connect up more than just the power to the shield’s ICSP input! I didn’t bother with the RESET connection, but I attached the others. On the top of the shield I just kept D10 and D2 “passed through” to the D10 and D2 pins of the breadboard.

I ignored A0 and A1 which Rob’s sheet said were the other pins the shield uses – as I’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.

And… power up the circuit again, browse to 192.168.1.7, and I’m greeted with:

So, as a quick summary: to connect a Veroboarduino or breadboard Arduino to the Ethernet shield:

Connect the ICSP sockets on the bottom of the shield as described above for power and data connections.

“Pass through” D10 and D2

A0 and A1 are used for SD card access (I didn’t connect them – I wasn’t using it – something to experiment with at a later date)

Hope this helps… cheers!