Description
This module allows any MCU to establish a wired Ethernet connection to a network using SPI interface.
PACKAGE INCLUDES:
- Ethernet Module W5500
KEY FEATURES OF ETHERNET MODULE W5500:
- WIZnet W5500 Ethernet controller
- Compatible withWIZ850io
- Magjack RJ-45 CAT network connector
- Acts as client or server
- TCP/IP protocols include TCP, UDP, ICMP, IPv4 ARP, IGMP, PPPoE
- 10BaseT/100BaseTX Ethernet PHY embedded
- Up to 8 simultaneous socket connections
- Supports auto negotiation (full and half duplex, 10 and 100-based)
- Internal 32Kb Tx/RX buffers
- Supports power down mode
- Supports wake on LAN over UDP
- Does not support IP fragmentation
- Does not support Auto MDI-X (auto cable cross-over)
- Link and Activity LEDs
- SPI Interface with maximum 80MHz
- Good library support
- Very small package for project integration
- I/O is 5V tolerant
- 3.3V Operation
This Ethernet module uses the WIZnet W5500 network interface chip to provide a cabled connection to a network.
The W5500 has very good library support for most microcontrollers. The Arduino, Teensy and other Arduino compatibles can use the standard Ethernet.h library included with the IDE
The module operates at 3.3V, but the I/O is fully 5V tolerant, so it can be directly interfaced with 3.3V or 5V MCUs without the requirement for additional level shifting hardware.
SPI Interface
The module is interfaced to using the SPI bus.
MOSI, MISO and SCK can be found on digital pins 11, 12 and 13 on the Uno and pins 50, 51 and 52 on the Mega. On both boards, pin 10 is used to select the W5500 chip. The Teensy 4.0 used in our example also uses the same 11, 12, 13 and 10 pins as the Uno.
The SPI interface is rated for up to 80MHz, but operation is guaranteed up to 33MHz.
LED Indicators
The RJ45 magjack on the module has two built-in LED indicators.
- LINK – Green LED indicates the presence of a network link
- ACTIVITY – Yellow LED flashes when the module transmits or receives data.
There is also a red power LED on the bottom of the module when 3.3V power is applied.
OUR EVALUATION RESULTS:
These modules work quite well for establishing wired Ethernet connections. They are very compact, breadboard compatible and are easy to mount on a prototype perf board for permanent projects. Their small size allows them to be embedded into almost any project. The module is a clone of the WIZ850io module.
Thought the module does not support auto MDI-X (auto straight-thru vs cross-over cable connection), if the other end of the cable is plugged into a device that does support MDI-X, it will still auto connect correctly on that end, so this is usually not an issue.
Testing Your Ethernet Module W5500
The test program here is based on the Webserver example that comes with the Arduino IDE. It sets up the module as a webserver, takes the readings of analog inputs A0 – A5 and sends the readings to a window open in your web browser. If there is nothing attached to those inputs, you will see floating values. You can easily attach a pot or simply connect one of the analog inputs to 3.3V or ground if you want to show the value change in the web browser.
In our example here, we are using it with the Teensy 4.0 microcontroller, but an Uno would work exactly the same.
Steps to setup
- Insert the Ethernet Module W5500 into a breadboard.
- Connect the MISO, MOSI, SCK and CS pins between the MCU and the module. No level shifting required.
- Connect 3.3V power and ground to the module. There are multiple power and ground pins, but only one of each needs to be connected.
- Connect USB from PC to the MCU.
- Connect a network CAT cable from the RJ-45 jack to a router. You should see the green LED light up to show that a link is detected.
- Download the program
- Open a browser window and point it to the Ethernet module which is now acting as a webserver. In our example here, we type 10.0.0.12 in the address bar of web browser.
- Open the Serial Monitor window and set to 9600 baud if you want to see the output.
The MAC address used can typically be arbitrary and the one in the program will work.
The IP address used needs to match the address range of your network.
To find that information, open the network settings / properties window for your PC. In our example we are using a wireless connection and need to open our wireless network properties window.
You will find a item IPv4 address: which is the IP address of your computer on your local network. In our example to the right the IP address is 10.0.0.120
You will want to set the W5500 module address to match the same first 3 numbers (10.0.0) in our example. The 4th number can be set to anything but needs to be unique on your network. We chose to use 12, just because we could.
Open a browser window and point it to the W5500 module by typing in its address which is 10.0.0.12 in our example.
Once you get everything up and running, you should see something similar to this in your browser window. In this case, I have connected A5 to 3.3V to give a known valid reading. Since the ADC is 10-bit, it should give a reading up around 1023. The rest of the inputs are all floating.
If the Serial Monitor is opened, you should see something similar to this:
Ethernet Module W5500 Test Program
/* W5500 Ethernet Module Test A simple test program based on the Webserver demo Setup: * Connect SPI bus MOSI/MISO/SCK/CS between MCU and W5500 module * Connect USB to MCU * Connect Ethernet cable from W5500 module to router * Analog inputs attached to pins A0 through A5 (optional) * Update IP address below if needed to match network * Download software * Open Serial Monitor window * Open browser window and point to IP address: 10.0.0.12 in this example */ #include <SPI.h> #include <Ethernet.h> // Enter a MAC address. Can usually be arbitrary byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // The IP address will be dependent on your local network // First 3 numbers must match router, last must be unique IPAddress ip(10, 0, 0, 12); // Initialize the Ethernet server library with the IP address and port // to use. (port 80 is default for HTTP): EthernetServer server(80); //=============================================================================== // Initialization //=============================================================================== void setup() { Serial.begin(9600); Serial.println("Ethernet Test"); // start the Ethernet connection and the server: Ethernet.begin(mac, ip); // Check for Ethernet hardware present if (Ethernet.hardwareStatus() == EthernetNoHardware) { Serial.println("Ethernet module was not found - Stopping Test"); while (true) { delay(1); // do nothing, no point running without Ethernet hardware } } // start the server server.begin(); Serial.print("server is at "); Serial.println(Ethernet.localIP()); } //=============================================================================== // Main //=============================================================================== void loop() { // listen for incoming clients EthernetClient client = server.available(); if (client) { Serial.println("new client"); // an http request ends with a blank line boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { char c = client.read(); Serial.write(c); // if you've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so you can send a reply if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println("Connection: close"); // the connection will be closed after completion of the response client.println("Refresh: 5"); // refresh the page automatically every 5 sec client.println(); client.println("<!DOCTYPE HTML>"); client.println("<html>"); // output the value of each analog input pin for (int analogChannel = 0; analogChannel < 6; analogChannel++) { int sensorReading = analogRead(analogChannel); client.print("analog input "); client.print(analogChannel); client.print(" is "); client.print(sensorReading); client.println("<br />"); } client.println("</html>"); break; } if (c == '\n') { // you're starting a new line currentLineIsBlank = true; } else if (c != '\r') { // you've gotten a character on the current line currentLineIsBlank = false; } } } // give the web browser time to receive the data delay(1); // close the connection: client.stop(); Serial.println("client disconnected"); } }
Before they are shipped, these modules are:
- Inspected
- Tested using the test program.
- Repackaged in quality recloseable ESD bags for safe storage.
Notes:
- None
Technical Specifications
Operational | Operating Voltage | 2.97 – 3.63V (3.3V typ) |
I/O Voltage | 3.3V / 5V tolerant up to 5.5V | |
Maximum Current Draw | 150mA typical | |
Dimensions | PCB Board (L x W) | 25 x 23 mm (1 x 0.9″) |
Module (L x W x H (excluding pins)) | 28 x 23 x 18.5 mm (1.1 x 0.9 x 0.73″) | |
Pin Spacing (row-to-row) | 20.32mm (0.8″) | |
Country of Origin | China | |
Datasheet | WIZnet | WIZnet W5500 |
FURTHER READING
WIZwiki: https://wizwiki.net/wiki/doku.php/products:wiz850io:start