Introduction: Arduino Nano With Ethernet Shield

Picture of Arduino Nano With Ethernet Shield

I recently bought an Arduino Ethernet shield designed for the Arduino Uno, and thought I could just easily hook it up to my existing Arduino Nano. I was wrong!

I couldn't find much information at all on how to do this, except that some documents listed the required IO pins.

I even tried hooking up all the wires from my Nano to the matching pins of the shield, and it still didn't work.

After giving up and buying a proper Uno online I noticed that there is a 6 pin connector named ICSP. But it wasn't clearly labelled and the connector didn't have any special shape so it could be hooked up in two possible ways.
So I had to do a bit of searching to see which pin was which on the Nano and the shield, to make sure I wouldn't be connecting it backwards.

So I thought I would add this quick little instructable to save others the effort.

And I'm sure I can find plenty of uses for another Arduino ;)

Edit: Here's a newer Instructable on how to hook up an Arduino Nano to a smaller WIZ550io module instead.

Step 1: Parts

Picture of Parts

1 Arduino Nano. (if you have an Arduino Uno, just plug it in and you're done - no need for this instructable!)
1 Ethernet shield with SD card slot, with Wiznet w5100 chip. The w5100 is directly supported by the Arduino libraries, which could save a lot of programming pain.
5 m-m hookup wires.
1 breadboard
1 micro SD card
a couple of business cards or a piece of paper (to make sure we don't accidentally short out pins on the shield)

For software you will need the Arduino 1.0 software (from www.arduino.cc - click the download link).

The Nano is essentially the same as a Uno except it's much smaller and has male header pins underneath it - perfect for plugging into a breadboard. You can buy ethernet shields specifically for the Nano too, as it turns out, but they may be more expensive.

When buying the shield, note that some do not have SD card support. I opted to buy one with the SD card on it - it was only a few extra dollars, and can be useful for many other projects as well (data logging, for instance). It also allows for much more advanced ethernet board examples!

Total price of everything, if starting from scratch, is less than $50 on eBay, but I'm assuming that most people looking at tutorials like this already have many of the parts like the Arduino and the breadboard and wires. I already had a Nano, breadboard, wires, and even the micro SD card (it was in my cell phone, but came from an older camera, if I recall correctly). The shield itself cost me about $15.

To put files on the SD card, you'll need some way to hook it to your computer, of course. For that you'll likely need a micro-to-regular SD card adapter. For my Macbook I also have an SD-to-USB converter (eBay $4).


Step 2: Insert Arduino Nano Into Breadboard

If you have an Arduino Nano, you've likely already done this many times before.

I usually insert my Nano right at the edge of the board, so that the USB connector hangs over the edge, and D12 and D13 are in the holes closest to the edge. The pictures on the next steps show it well.

It's a good idea to not have power to the board at this time.

Step 3: Plug ICSP of Shield Onto the Nano

Picture of Plug ICSP of Shield Onto the Nano

This is the part where you have to be a bit more careful. Do not have power to your board at this time.

The shield could be plugged in in 2 ways. One way covers the Nano, the other doesn't. You need to plug in the shield so that most of the Nano is still visible. This turns out well, as it gives full access to the Nano connections that way.
Also make sure that you get all 6 pins plugged in.

Because the shield's pins are all exposed underneath, I put some business cards underneath to ensure that the pins cannot accidentally connect with the power bus (you can use paper or hard plastic too).

Step 4: Connect the Wires

Picture of Connect the Wires

Connecting the wires is easy - simply match up the label on the Arduino Nano with the same label on the ethernet shield. The ICSP connector does most of the work and hooks up the power, so we only need 5 wires to complete the setup:

Pins 11, 12, 13 (SPI bus)
Pin 10 selects the w5100
Pin 4 selects the SD card


Step 5: Test the Setup

To test the setup, you can use the built in Arduino examples under the File-Examples menu list, under the Ethernet and the SD folders.

To use the SD card with the file system, you will need this SDFatLib library:
http://code.google.com/p/sdfatlib/downloads/list

One thing that's a bit of a bother is that it only supports the old DOS style 8.3 filenames, not long file names.
Keep that in mind when you later serve up a website and half the pictures don't show ;)

To test both the ethernet connection and the SD card at the same time, try this LadyAda tutorial:
http://www.ladyada.net/learn/arduino/ethfiles.html
Note that this LadyAda example is using a slightly outdated version. Luckily you can just replace the outdated references to Server with EthernetServer, and Client with EthernetClient, and it all seems to work.

Many more examples exist online, including simple web servers such as the samples provided by Teslaling in this Instructable:
https://www.instructables.com/id/ServDuino-Arduino-Webserver/step7/Programming/
Note that Teslaling's instructable also uses the outdated "Client" and "Server" types that need to be updated to EthernetClient and EthernetServer.

Enjoy!

Comments

MonteM7 (author)2017-05-10

If I Upload e.g. the "WebServer"-Example to the Arduino, i get the following line on the serial monitor:

server is at 0.0.0.0

At my arduino mega it works with the same programm. Can anyone help me?

jcstange (author)2015-03-04

For Pro Mini that doesn't have ICSP, you should connect pins 11,12, 13 and RESET to the wiznet's ICSP. Like this photo

gphat (author)jcstange2015-05-27

can you tell me the detail of wiznet's ICSP is connected to Pro Mini. I have schematic, it run ok but it will halt for some minutes.

diy_bloke (author)2014-11-19

Good article, but yes it works with the pins connected rather than only with the header.
I know two years ago the prices were different but for a nano it probably be cheaper and even easier to get a WIZ5100 or ENC28j60 module for a few euro.

@ntewinkel=> I saw u are canadian. Are u of Dutch descent? just guessing :-)

ntewinkel (author)diy_bloke2014-11-24

Hi diy_bloke,

A couple of years definitely makes a difference in price and selection of these electronics. Funny you should mention the Wiznet item - I should be receiving a couple of Wiznet modules (one of which is Wifi) in a few days and I'll post an updated Instructable after I have a chance to try them out :)

And you're right, I was born in The Netherlands :) The name kind of gives it away doesn't it?

diy_bloke (author)ntewinkel2014-11-25

A WiFi Wiznet, interesting. I have two cheap wifi modules that i havent had time to play with them yet. Looking forward to your update.
Indeed, it was the name that triggerred me although it is rather rare in the netherlands at the moment

dentalan (author)2013-10-10

May I ask, what is the purpose of using the ICSP connector if you are connecting the pins 10,11,12,13. If I'm not mistaken these pins are the ICSP pins. Have toy tried this without connecting the other pins?

ntewinkel (author)dentalan2013-10-10

It wasn't working without the ICSP connection. I was thinking the same, that it should work with just those 4 pins, and spent a lot of time trying to figure out why it wasn't working.
If you try this out and find out more, please let us know!

dcav8r (author)ntewinkel2014-09-21

Confirmed it works with the pins connected as described as well as just the ICSP header and Pins 10 & 4.

Thanks for the article - I had hoped it the header would "just work".

Raphango (author)2014-07-24

Great! Thanks!

ioan_vapi (author)2014-06-05

Looks like you don't have to wire again the pins 11, 12 and 13. They are already connected by ICSP. You need to wire the pin 10 only. From your sketch remove wires for pins 11, 12 and 13, keep wire for pin 10 and test again. It worked for me.

Var1abl3 (author)2014-01-07

If you are using the ICSP connector then pins 11,12 and 13 are not needed. I have not tested to see if pins 11,12 and 13 are usable for other I/O.

About This Instructable

64,858views

45favorites

License:

Bio: Hi There! I'm a mobile app developer (iPhone and Android) in British Columbia, Canada. I also write firmware, and enjoy dabbling with electronic circuits ... More »
More by ntewinkel:Arduino Nano with WIZ550io = Easy InternetArduino Echo LocatorCrazy Countdown Timer
Add instructable to: