Arduino Nano Ethernet Shield Woes

I recently purchased an ethernet shield on ebay for the Arduino Nano for my motion detector project.

The nano has a very small form factor and can be put on a PCB which was my reason for choosing it for my current project (plus you can get them dirt cheap on ebay:…1c33a75f27

The ethernet shield is also available on ebay. This is kind of an oddball shield – I’ve only seen it on ebay, made in china, but it too is dirt cheap:…5d39179999

For about $25 you’ve got a Nano + shield.

The ‘problem’ with this shield is it uses the ENC28J60 chipset, not the Wiznet 5100 of a normal Arduino Ethernet shield. That means the normal Arduino supplied software (drivers) don’t work on this shield.

After *a lot* of searching I finally found both good drivers and the ‘trick’ to getting them to work with this shield.

The latest version of the software can be found at:

This software defaults to use pin 8 to select the ethernet shield; however, this shield actually uses pin 10, so to use it you must specify pin 10 in the .begin code such as:

if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0)

(it took me a long time to figure this out, so I want to post it somewhere public so maybe I’ll find it again).

Once I got the nano ethernet shield running, I found this chipset/implementation is pretty simple and the author warns that it can’t handle a lot of edge cases. Until the current version, it could only send/receive 1 TCP packet per session. This version is supposed to support more packets, but I’ve not been able to find an example of how to make it do that.

The driver software was really meant to simply send http gets or puts. If that is all you need to do, it will probably work well. If you want to do something like implement a telnet client, it appears that would be difficult if not impossible.

Instead, I am, personally, simply using it to transmit UDP packets to another system that will do something based on what the nano is detecting.

Once setup, it is very easy to use for UDP. To initialize w/ DHCP:

if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0)
Serial.println( “Failed to access Ethernet controller”);
if (!ether.dhcpSetup())
Serial.println(“DHCP failed”);

and then to send a UDP packet:

EtherCard::sendUdp(data, 6, 555, destIp, 555);

For a network attached remote sensor, this is a pretty cool (and cheap) solution.

This entry was posted in c-arduino, MotionDetector. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.