Tuesday, May 22, 2012

Adding Ethernet capability

Adding Ethernet capability I really like devices that can be controlled over a network. So, a natural add-on to this project is an Ethernet shield. This capability could eliminate the need for readouts and possibly physical controls. I discovered that there are several different Ethernet options all with different costs and benefits. Some boards are simply expansion shields while others apparently have features that don’t even require a controller board! Here are the options I considered.

  • One easy way of matching Ethernet with an Aurduino is simply to buy a unit with Ethernet already built onto the board (over $50). I'm sure it's nice & probably works right out of the box.
  • The more expensive “shields” have advanced features. Once feature is to use DC from a POE capable switch. If the feature is present, these higher-end switches can configure ports to provide (48v DC - usually 15W max) which can be used to power end devices.  Usually, this is a feature only found on commercial switches.
  • Then there are the really cheap Ethernet “shields”. Their main advantage seems to be price ($15-$25).  They are lower cost but more complex to program than the higher cost W5100 based shields.  Here is a good article that explains the differences in the ENC28J60 board varieties.
The board I ordered from Ebay cost $16 (most of which was in shipping). Although the board itself seemed to be new, it was an older design. It had the markings HanRun HR911105a. along with 11/16 on the second row.  It also had the markings “ekitzone.com’ on the board. Otherwise, it was undocumented. From somewhere, I also found that this board is also referred to as type ENC28J60.

Once it arrived, I first tried loading the example web server code that came with the latest Arduino editor. I had no luck making the example code work.  The example apparently expected another board type. So, I visited the ekitszone site to see if they had a different library that should be used. They did.

After downloading the ZIP, I unzipped the file into the \libraries directory and moved the examples directory to the proper place. 

After some trial and error, I finally got an Arduino board to spit out the webpage below.

The HanRun Ethernet board was tested with....
XP professional SP3
Arduino editor 1.0.3
Two board types were tried. They were:
-A genuine Arduino Uno 
-An Arduino Duemilanove compatible called the Freeduino
Thanks to Google Drive, I can also provide the specific files used for testing          
The above webpage was generated using this sample sketch HERE.
A copy of the Ekitzone library file required for the above example (which now appears to be rarer than hen's teeth) can be downloaded HERE

Due to working with XP, I can only use version 1.0.3 . Higher versions don't seem to allow XP to upload sketches to boards.  

There seems to be quite a bit of code used to write out a web page. So, making the assembly do things other than displaying static web pages may be a bit of a challenge.