Low cost Ethernet shield with ENC28J60

By on June 30, 2012

Economical alternative to original Arduino ethernet shields, allows data rates up to 10 Mbps and is achieved with a traditional assembly components.

One of the most interesting shield that you can mount on the Arduino platform is certainly the ethernet shield, because enable numerous networking applications such as remote control of systems and users, web access and publication of data, and more yet, the simplicity of finding and integrating open-source libraries on Arduino IDE does the rest. The usefulness of LAN connectivity has meant that the market would respond by offering different ethernet shield, first of all the original Arduino Ethernet Shield, which was accompanied by the good shield by Seeed Studio, both of these circuits are based on the chipset WIZnet W5100, allow multiple socket connections and can work at 100 Mbps

This ethernet shield is low-cost thanks to components used: all traditional mounting (THT). This feature makes the circuit accessible to those who haven’t the equipment to assemble SMD components. The data-rate is limited to 10 Mbps.

 

Wiring diagram

The shield is based on a Microchip ENC28J60 chip that interfaces with Arduino and data conversion according to the ethernet protocol. It integrates the MAC controller, an 8 KB Transmit / Receive Packet Dual Port Buffer and a circular FIFO managed at the hardware level, allows the programming of data retransmission in case of collision.
The MAC controller supports both Unicast, Multicast and Broadcast packets, has a programmable 64-byte pattern within a margin allowed to the user and programmable wake-up on multiple packet formats (Magic Packet, Unicast, Multicast, Broadcast, specific packet match or any packet).

 

In the circuit we see that over all’ENC28J60 there are a standard RJ45 jack with integrated LEDs, filters and line transformers, and a voltage level shifter for the SPI interface to communicate with the Arduino.

MISO is the output data of the slave device and the input of Arduino, while MOSI is the opposite; SCK is the clock that marks the two-way communication on the SPI bus and RESET the reset line, which is also connected to a button that allows you to reset the Ethernet interface, if necessary, manually. The digital D10 and D2 lines of Arduino are used, respectively, for the control of CS (Chip Select, active logic zero) and the reading of INT. U3B is used to adapt the logic levels 0/3, 3 V to those of Arduino 0/5 V.

The ENC28J60 operates with a clock of 25 MHz, defined by the quartz Q1 connected between the pins 23 and 24; the capacitor connected to pin VCAP filters the output voltage (2.5 V) of the internal controller and should preferably be of the type low ESR (low series resistance parasite). The resistor connected to RBIAS is used to bias the LAN transceiver that is part of the pin TPIN + / – and TPOUT + / -.

We conclude the analysis of the circuit diagram of the shield with the power that is drawn by Arduino 5V and Vin through the strip: the first provides the 5 volts continuous stabilized points of the circuit that require them (basically the 74HC125 and the resistance of pull Line-up reset and Chip Select) and the second give power to the integrated regulator U2, which creates the 3.3 volts needed to power the microcontroller and circuits contained in the RJ45 jack.


BOM

[code]

R1: 47 ohm
R2: 47 ohm
R3: 18 ohm
R4: 47 ohm
R5: 47 ohm
R6: 270 ohm
R7: 270 ohm
R8: 2,7 kohm
R9: 10 kohm
R10: 10 kohm
R11: 10 kohm

C1: 100 nF
C2: 100 nF
C3: 100 nF
C4: 100 nF
C5: 470 µF 16 VL
C6: 10 µF 63 VL
C7: 15 pF
C8: 15 pF
C9: 470 µF 16 VL
C10: 100 nF

U1: ENC28J60
U2: LD1086-V33
U3: 74HC125

RST: Microswitch

Q1: 25 MHz

RJ45: RJ45 (RJ45EM)

- chip holder 7+7
- chip holder  14+14
- Strip M/F 6 (2 pz.)
- Strip M/F 8 (2 pz.)
- Strip F 2x3

[/code]

The library for ENC28J60

 

The original library from which we derived can be downloaded from the site https://github.com/jcw/ethercard ; from our site you can download the library itself but with a higher number of application examples.

Here you will find a sketch example to build a Web Server, in particular, in the current web page you will see the hours: minutes: seconds elapsed from the ignition of Arduino.

 


// This is a demo of the RBBB running as webserver with the Ether Card
// 2010-05-28 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php

#include <EtherCard.h>

// ethernet interface mac address
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
// ethernet interface ip address
static byte myip[] = { 192,168,0,188 };
// gateway ip address
static byte gwip[] = { 192,168,0,1 };

byte Ethernet::buffer[500];
BufferFiller bfill;

void setup () {
  if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
    Serial.println( "Failed to access Ethernet controller");
  ether.staticSetup(myip);
}

static word homePage() {
  long t = millis() / 1000;
  word h = t / 3600;
  byte m = (t / 60) % 60;
  byte s = t % 60;
  bfill = ether.tcpOffset();
  bfill.emit_p(PSTR(
    "HTTP/1.0 200 OK\r\n"
    "Content-Type: text/html\r\n"
    "Pragma: no-cache\r\n"
    "\r\n"
    "<meta http-equiv='refresh' content='1'/>"
    "<span class="hiddenSpellError" pre="">RBBB</span> server" 
    "<h1>$D$D:$D$D:$D$D</h1>"),
      h/10, h%10, m/10, m%10, s/10, s%10);
  return bfill.position();
}

void loop () {
  word len = ether.packetReceive();
  word pos = ether.packetLoop(len);

  if (pos)  // check if valid tcp data is received
    ether.httpServerReply(homePage()); // send web page data
}

 


Download ZIP File

Library Ethernet shield with ENC28J60 

Download ZIP File

Gerber File

Store

About Boris Landoni

Boris Landoni is the technical manager of Open-Electronics.org. Skilled in the GSM field, embraces the Open Source philosophy and its projects are available to the community.
  • Ashwani

    Hi,

    This will really help in controlling stuff from internet like wireless ac/dc switches.

    Regards,
    Ashwani Sihag

  • http://Itux.oc.za Peter

    Are you willing to share the eagle/kicad files?

    Peter

  • http://www.open-electronics.org Boris Landoni

    I’m sorry but I haven’t the Eagle file.
    If it’s fine for you I can share the gerber file of course.

  • Pingback: Cerix's Blog » Arduino Ethernet shield economico()

  • Matt

    Is there a parts list you’d share with us?
    I’d really like to try and make my own.

  • http://www.open-electronics.org Boris Landoni

    @ Matt
    Sorry I forgot the BOM.
    Now is on line ;-)

  • http://www.open-electronics.org Boris Landoni

    And I add the Gerber files

  • http://Itux.co.za peter

    Thanks for the gerbers, what CAD package did you use to design it? ny chance of sharing the source files?

    Peter

  • http://www.open-electronics.org Boris Landoni

    I used Easy PC (number One system).
    http://www.numberone.com/
    It isn’t a free sfw.
    I can share the source without problem.
    Do you can open it?

  • Pingback: .NET i jiné ... : Odkazy z prohlížeče – 19.7.2012()

  • NMS

    How comes that in the ENC28J60 DATASHEET they say to use coils in TPIN and TPOUT ports and you don’t use them in this shield? their picture (http://i48.tinypic.com/mlio00.png)

    Btw nice project! Thanks.

  • gordon

    Why we need the 3.3 voltage regulator? for arduino old versions?

    the arduino uno already have 3v3.

    I’m very interested in build this, I’ll do it on my vacations.

    TIP: Microchip can send you a couple of free sample of ENC28J60…

  • ankush tripathi

    can we replace the LD1086-V33 integrated regulator with LD11173.3V

  • http://www.open-electronics.org Boris Landoni

    @NMS
    hi we use an RJ45 port with coils inside

  • http://www.open-electronics.org Boris Landoni

    @gordon
    The arduino 3.3V regulator can provide
    “DC Current for 3.3V Pin 50 mA”
    The ENC28J60 required
    “IDD Operating Current — 250 mA, VDD = 3.45V, FCLK = 10 MHz, SO = Open”

  • http://www.open-electronics.org Boris Landoni

    @ankush tripathi
    Yes of course.
    Check the Pin out

  • Mat

    I’ve managed to put one of these together on a breadboard but I’m finding the connection is quite sporadic. Running ping continuously from Windows gives about 50% packet loss, with the packets that are returned usually coming in small groups (2-3 packets). Might you have any guesses at where the problem could be? The major difference between my board and your diagram is the RJ45 port, mine is a Stewart SI-60002-F (http://goo.gl/Q1ExQ) and I’ve only wired TPIN+/- and TPOUT+/- to pins 1/3 and 4/6 on the jack respectively, all other contacts are open. The other difference is that I’ve used a complete oscillator unit instead of a crystal, but the controller datasheet claims this is ok. Any help would be greatly appreciated, I’m new to all this!

    • Mat

      I believe I’ve fixed the issue – resoldered my connector with shorter wires … think I might have been subject to signal degradation due to transmission on untwisted pairs.

      • BorisLandoni

        Hi Mat.
        Good news, probaly using a breadboard you find this problem.

  • Pingback: Android + Arduino + ethernet (TCP/IP)()

  • bing

    Is it work with Mega???

  • SMcn34

    I built the circuit and my code compiles with no problem, I am trying similar code but it is DHCP. My code seems to get stuck on
    if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)

    when I am running it. Nothing happens after that point. Any ideas?

  • SMcn34

    Having trouble finding RJ45 that fits the dimensions for this pcb. Can anyone give me a serial number for an RJ45 that fits?

  • LPS

    Hi,

    I have a few questions:

    — Is it possible to use the Arduino Ethernet library directly?

    — Whats more or less the price diference?

    • BorisLandoni

      There is a link for the library. The library is not the same of the original Arduino ethernet shield.
      The price is about the halt

  • Lutz

    Am I right that it is online possible to run this shield if you power it over the power connector? USB only isn’t possible, is it?

    • BorisLandoni

      You have to power the Arduino with an external power supply. The USB isn’t enough

      • Lutz

        Ah ok. Thanks. Is it possible that I power the Arduino with 5V? So the shield also get’s 5V?

        • BorisLandoni

          No problem for the shield, but Arduino need not less then 7V

          • Lutz

            Ok. Will power the arduino and shield with 12V. Hope it’ll be suitable for both.

  • Pingback: ENC28J60 Ethernet Module | เว็บบล็อกคนพันธุ์ตรรกะ เพราะชีวิตมีมากกว่า 0 และ 1()

  • Luko28

    Hmm, 3.3V is needed for ENC and RJ45, here you are using LD1086-V33 witch is 1.5A, but it shouldn’t be problem to use LD111V33 witch is only 800mA, or I am wrong?

    • BorisLandoni

      800 mA is good, don’t worry

      • Luko28

        Thx for the reply, I just wanted to make sure :)

  • noob

    Hi!
    I ask you to excuse me for the stupid question of a newbie…
    I am trying to make my first electronic card. I have dowloaded the two copper layer (bottom and top) I have made the card, and I am about to solder the components. I noticed that some copper paths are positionned just under the RJ45 connector! So my question is, how am I supposed to solder?
    Any help or advice?

    FG

    • BorisLandoni

      Normaly you hate to use a two layer PCB, with vias.

  • noob

    perhaps someone has an eagle file of this project?

    • BorisLandoni

      I’m sorry, not available

  • I Need Help Please

    Can anyone give me the schematic of this Board Please :)

    • BorisLandoni

      ?
      In this post

  • john

    Hi everyone, i made the schematic but i can’t make it work properly, any help please….

    • BorisLandoni

      be sure to connect the spi pins

      • john

        I have connected them but still not working

        • BorisLandoni

          Could you send me a photo?

          • Noob

            Can you please send me the picture of a bare pcb please, both sides?

          • BorisLandoni

            In this post there are a lot of photos…

  • Mike

    can I get the bare pcb from you?

  • Noob

    Can someone confirm me that all the components have to be soldered on the face where “8955” is written on the pcb?

  • Matthew Smith

    Anyone know why such large caps are used on either side of the 3.3V regulator? The spec sheet for that model says that 10uF or more on the output side is needed for stability but 470uF seems insane! Was wondering if experience led to that…

    • BorisLandoni

      We use 470, more is better than less :-)

      • Matthew Smith

        I was wondering if real-world experience lead to that increase or was that just chosen from the start…

  • Pingback: Links and References()