Stufin
Home Quick Cart Profile

M5Stack LAN Module with W5500

Buy Now on Stufin

Chipset

W5500

Ethernet Speed

10/100 Mbps

Supported Protocols

TCP/IP, UDP, ICMP, HTTP, DHCP

Operating Temperature Range

-40C to 85C

Power Consumption

180mA (typical)

IO Interface

GPIO

RJ45 ConnectorStandard

Dimensions

25.4 x 19.8 x 9.5 mm

Applications

The M5Stack LAN Module with W5500 is suitable for a wide range of applications, including

IoT devices and applications

Industrial automation

Robotics

Home automation

Building automation

Medical devices

Consumer electronics

Conclusion

The M5Stack LAN Module with W5500 is a compact, high-performance Ethernet module that provides an easy-to-use and reliable solution for enabling Ethernet connectivity in a wide range of devices and applications. With its low power consumption, compact design, and ease of integration, this module is an ideal choice for developers and designers looking to add Ethernet connectivity to their projects.

Pin Configuration

  • M5Stack LAN Module with W5500 Pinout Documentation
  • The M5Stack LAN Module with W5500 is a popular Internet of Things (IoT) component that provides Ethernet connectivity to devices. The module is based on the W5500 chip, a hardwired TCP/IP embedded Ethernet controller. Here is a detailed explanation of the module's pins, along with connection guidelines:
  • Pinout Diagram:
  • ```
  • +---------------+
  • | LAN Module |
  • | with W5500 |
  • +---------------+
  • |
  • |
  • v
  • +---------------+
  • | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
  • | GND| 3V3| RXD| TXD| RTS| CTS| INT| RST|
  • +---------------+
  • ```
  • Pin Descriptions:
  • 1. GND (Ground):
  • Function: Ground pin for the module
  • Connection: Connect to the ground pin of your microcontroller or breadboard
  • 2. 3V3:
  • Function: 3.3V power supply for the module
  • Connection: Connect to a 3.3V power source (e.g., from a microcontroller or a power supply module)
  • 3. RXD (Receive Data):
  • Function: Receive data pin for serial communication
  • Connection: Connect to the TX (transmit) pin of your microcontroller or serial communication device
  • 4. TXD (Transmit Data):
  • Function: Transmit data pin for serial communication
  • Connection: Connect to the RX (receive) pin of your microcontroller or serial communication device
  • 5. RTS (Request to Send):
  • Function: Flow control pin for serial communication
  • Connection: Connect to the RTS pin of your microcontroller or serial communication device (if necessary)
  • 6. CTS (Clear to Send):
  • Function: Flow control pin for serial communication
  • Connection: Connect to the CTS pin of your microcontroller or serial communication device (if necessary)
  • 7. INT (Interrupt):
  • Function: Interrupt pin for the W5500 chip (optional)
  • Connection: Connect to an interrupt pin on your microcontroller (if necessary)
  • 8. RST (Reset):
  • Function: Reset pin for the W5500 chip
  • Connection: Connect to a reset button or a digital output pin on your microcontroller (if necessary)
  • Additional Connections:
  • Ethernet Port: Connect an RJ-45 Ethernet cable to the LAN module's Ethernet port to establish a network connection.
  • Power: Ensure a stable 3.3V power supply to the module. You can connect the 3V3 pin to a power source or a power module.
  • Important Notes:
  • When using the LAN module with a microcontroller, ensure that the serial communication pins (RXD, TXD, RTS, and CTS) are properly connected and configured according to the microcontroller's documentation.
  • The INT pin is optional and only required if you need to use interrupt-based communication with the W5500 chip.
  • The RST pin is optional and can be connected to a reset button or a digital output pin on your microcontroller to reset the W5500 chip.
  • By following these connection guidelines, you can successfully integrate the M5Stack LAN Module with W5500 into your IoT project and establish a reliable Ethernet connection.

Code Examples

M5Stack LAN Module with W5500 Documentation
Overview
The M5Stack LAN Module with W5500 is a compact and versatile Ethernet module designed for IoT applications. It is based on the W5500 chip, a high-performance Ethernet controller with a built-in TCP/IP stack. This module provides a reliable and efficient way to connect your IoT devices to the internet or local networks.
Hardware Specifications
Microcontroller: W5500
 Ethernet: 10/100Mbps
 Protocol: TCP/IP, UDP, ICMP, ARP, HTTP, DHCP, DNS, etc.
 Interface: SPI
 Power Supply: 3.3V
 Dimensions: 38.5 x 26.5 x 12.5 mm
Software Features
API: Supports Arduino, Python, and UIFlow programming languages
 Network protocols: TCP, UDP, HTTP, DHCP, DNS, etc.
 Socket API: Allows developers to create custom network applications
Code Examples
### Example 1: Simple Web Server using Arduino
This example demonstrates how to create a simple web server using the M5Stack LAN Module with W5500 and Arduino.
```cpp
#include <M5Stack.h>
#include <WiFi.h>
#include <Ethernet.h>
// Set the MAC address and IP address
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 100);
EthernetServer server(80); // Create a web server on port 80
void setup() {
  M5.begin();
  Serial.begin(115200);
// Initialize the Ethernet module
  Ethernet.begin(mac, ip);
// Start the web server
  server.begin();
  Serial.println("Web server started");
}
void loop() {
  EthernetClient client = server.available();
if (client) {
    Serial.println("Client connected");
// Read the request from the client
    String request = client.readStringUntil('
');
// Send the response
    client.println("HTTP/1.1 200 OK");
    client.println("Content-Type: text/html");
    client.println();
    client.println("<h1>Welcome to M5Stack LAN Module!</h1>");
// Close the connection
    client.stop();
    Serial.println("Client disconnected");
  }
}
```
### Example 2: Send HTTP Request using Python
This example demonstrates how to send an HTTP GET request using the M5Stack LAN Module with W5500 and MicroPython.
```python
import machine
import network
import socket
# Initialize the Ethernet module
eth = network.Ethernet(machine.Pin(5), machine.Pin(18))
eth.active(True)
# Set the IP address and subnet mask
eth.ifconfig(('192.168.1.100', '255.255.255.0', '192.168.1.1', '8.8.8.8'))
# Create a socket object
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect to the server
sock.connect(("www.example.com", 80))
# Send the HTTP request
sock.send(b"GET / HTTP/1.1
Host: www.example.com

")
# Receive the response
response = sock.recv(1024)
print(response.decode())
# Close the socket
sock.close()
```
These examples demonstrate the basic usage of the M5Stack LAN Module with W5500 in various contexts. You can explore more advanced features and applications by referring to the official documentation and API references.