Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU0071)

Post Reply
admin
Site Admin
Posts: 748
Joined: Sun Aug 05, 2012 4:02 pm

Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU0071)

Post by admin » Fri May 24, 2013 2:45 pm

Image

Image

Image
Image above shows ethernet shield connected to an Arduino compatible Uno (Uno not included)


Description:

This is the latest (revision 3) version of our Arduino compitible eithernet shield. This latest version includes improvements over the our 2012 version including the addition of the Arduino standardised 1.0 pinout and a PoE Upgrade option.

This Ethernet Shield is based on the Wiznet W5100 Ethernet Chip and gives you an easy way to get your Arduino online. It is directly supported by the official Arduino Ethernet Library. It also includes an additional micro-SD card slot, which can be used to store files for serving over the network. It is compatible with the Arduino Duemilanove (168 or 328), Uno as well as Mega (1280/2560) and can be accessed using the SD and Ethernet libraries.

The Wiznet W5100 provides a network (IP) stack capable of both TCP and UDP. It supports up to four simultaneous socket connections. Use the Ethernet library to write sketches which connect to the internet using the shield.




Example Sketch:

Code: Select all

/* FILE:    ARD_Ethernet_Shield_HCARDU0071_Example
   DATE:    24/05/13
   VERSION: 0.1

This is an example of how to use the HobbyComponents R3 Arduino Ethernet shield
(HCARDU0071). This Ethernet shield is based on the W5100 Ethernet controller and 
is compatible with the standard Aduino Ethernet libraries. It requires no additional
libraries to work.

This program will serve a basic webpage at the ip address specified below. As an 
example of content, the webpage contains the current status of the 6 analogue input 
pins.

REVISIONS:

You may copy, alter and reuse this code in any way you like, but please leave 
reference to HobbyComponents.com in your comments if you redistribute this code. 
This software may not be used directly for the purpose of selling products that 
directly compete with Hobby Components Ltd's own range of products. 

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER 
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES, 
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY 
REASON WHATSOEVER.

*/


#include <SPI.h>

/* Include the standard Ethernet library */
#include <Ethernet.h>


/* MAC address of the Ethernet shield. If you are using this on your 
own network, then the MAC address below will be fine, but remember if 
you use more than one shield on your network they will need to be assigned
unique MAC addresses */
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

/* The IP address of the shield. Make sure this matches the IP 
   address range of your network and is not in use by any other 
   device on it */    
IPAddress ip(192, 168, 1, 55 );

/* The port number the shield will respond to. Use port 80 
   for standard HTTP requests */
EthernetServer server(80);


/* Start the Ethernet interface */
void setup()
{  
  //pinMode(53, OUTPUT); //Uncomment this line if using a Mega
  Ethernet.begin(mac, ip);
  server.begin();
}


void loop()
{
  /* All client requests are terminated with a blank line. This flag will 
    signify if the current line received from this client is a blank line */
  boolean bBlankLineFlag = true;
  
  /* Used to hold the current byre received from the client */
  char cCurrentByte;
  
  /* Loop counter used for reading the 6 analogue inputs */
  int k;
  
  /* Wait for a request from a client */
  EthernetClient ethernet = server.available();
  
  if (ethernet) 
  {
    /* Continue to read data from the client one byte at a time until 
       there is no more data */ 
    while (ethernet.connected()) 
    {
      /* Is there still data available to be read? ethernet class 
         ethernet.connected() returns the number of bytes available */
      if (ethernet.available()) 
      {
        /* If data is available read the next byte */ 
        cCurrentByte = ethernet.read();

        /* If the next byte read is a new line termination ? */      
        if (cCurrentByte == '\n')
        { 
          /* If so was it a blank line? */
          if (bBlankLineFlag) 
          {
            
            /* If it was then we can now send a response to the client’s http request... */
            ethernet.println("HTTP/1.1 200 OK");
            ethernet.println("Content-Type: text/html");
            ethernet.println();

            /* ...and add some useful content by reading the 6 
               analogue inputs and returning their status */
          
            ethernet.println("<body>");
            ethernet.println("<big><span style=\"font-weight: bold;\">www.hobbycomponents.com Ethernet Shield Example</span></big><br>");
            ethernet.println("****************************************************<br>");
          
            for (k = 0; k < 6; k++)
            {
              ethernet.println("Analogue input ");
              ethernet.print(k);
              ethernet.print(": ");
              ethernet.print(analogRead(k));
              ethernet.print("<br>");
            }
          
            ethernet.println("****************************************************<br>");
            ethernet.println("</body>");

            /* Disconnect from the client */
            ethernet.stop();
          }
        
          /* The last received byte was the start of a new line so flag as no 
             data received for this line yet */
          bBlankLineFlag = true;
        
        /* If the last byte received wasn't a new line then it must be data... */  
        } else if (cCurrentByte != '\r')
        {  
          /* ...and so flag this as not a blank line. */
          bBlankLineFlag = false;
        }
      }
    }
  }
}


FAQ:

The main chip (Wiznet W5100) on my shield has solder bridges on some of the pins, is it faulty?

This is quite normal and is just where two or more adjacent pins (normally unused or ground pins) share the same pad area which effectively shorts these pins together. As a result the solder naturally flows between these pins making it appear that the short is not intentional. You can reference the image below of a working shield to confirm your board is ok.

Image

alf_sito
Posts: 7
Joined: Thu Dec 12, 2013 7:11 am

Re: Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU00

Post by alf_sito » Mon Mar 03, 2014 6:09 pm

Hi, I'm testing your sketch FILE: ARD_Ethernet_Shield_HCARDU0071_Example
and I am not able to make it work. This connected to an Arduino Mega 2560.
I have uncommented the line "pinMode (53, OUTPUT);"
I do ping from the pc but not receive a response.
In Ethernet_Shield the LEDs light up as follows:
100M = Green
Link = red
ON = Green
TX = off
RX = flashing red
I have reset several times and the result is the same.
Any help is welcome.
Thank you.

andrew
Site Admin
Posts: 913
Joined: Sun Aug 05, 2012 4:15 pm

Re: Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU00

Post by andrew » Tue Mar 04, 2014 9:00 am

From your description it sounds like the shield is connected to your router ok. However this done automatically by the shield and requires no software interaction. So the problem is most likely related to software or communication between your mega and the shield. Can you confirm that you have changed the IP address in the sketch to match the subnet of your own network? Also check that the shield is firmly seated in the mega.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

alf_sito
Posts: 7
Joined: Thu Dec 12, 2013 7:11 am

Re: Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU00

Post by alf_sito » Tue Mar 04, 2014 10:04 am

If this IP in my network. This perfectly connected to Arduino.
Yesterday at the last minute trying IDE 1.0.5 Example of managed ethernet ping.
Testing the example: "Repeating Web client" shows me the IP 0.0.0.0 monitor??

andrew
Site Admin
Posts: 913
Joined: Sun Aug 05, 2012 4:15 pm

Re: Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU00

Post by andrew » Tue Mar 04, 2014 6:24 pm

Testing the example: "Repeating Web client" shows me the IP 0.0.0.0 monitor??
This mean that either your shield and mega are not connecting to your router at the IP level, or that your router's DHCP is failing to administer IP settings (less likely). The example in the first post is a simplified sketch that removes as many posible problems as possible. It was written to work with our shields but should work with any W1500 shield that is compatible with the Arduino library. Using this sketch if you are unable to ping the shield or see the generated webpage from a web browser this will point towards a problem between your Mega and the shield. One other thing I would suggest to check is if you have a network device such as a laptop, try testing the ethernet cable and network connection you are currently using with that to help rule out any problems with your network. Failing this it could be a faulty shield I'm afraid.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

alf_sito
Posts: 7
Joined: Thu Dec 12, 2013 7:11 am

Re: Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU00

Post by alf_sito » Tue Mar 04, 2014 8:21 pm

I'm afraid the problem, as you said, can be the connection between Arduino and ethernet. Today after disconnecting and reconnecting everything, answers table and example: Repeating Web client answering me "My IP address: 192.168.1.5"
It seems as if a false welding. Now if there is connection ... now there.
I will be if I find out chekeandola the problem.
I will inform my test.
Thank you.

andrew
Site Admin
Posts: 913
Joined: Sun Aug 05, 2012 4:15 pm

Re: Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU00

Post by andrew » Wed Mar 05, 2014 7:51 am

If it is a bad solder connection it is most likely to one of the pads on the the shields ISCP connector. Try gently squeezing the two boards together with your finger and thumb at this point, reset the boards and see if you get a connection.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

alf_sito
Posts: 7
Joined: Thu Dec 12, 2013 7:11 am

Re: Arduino Compatible Rev 3 Ethernet W5100 Shield (HCARDU00

Post by alf_sito » Wed Mar 05, 2014 1:26 pm

ICSP finds welds reviewing them. Thank you very much for your feedback.

Post Reply