Stufin
Home Quick Cart Profile

ENC28J60 Ethernet LAN Module

Buy Now on Stufin

Low power consumption

typical 180mA (receive mode), 230mA (transmit mode)

Supports power-down mode for reduced power consumption

  • Operating Environment:

Operating temperature range

0C to 70C

Storage temperature range

-40C to 125C

  • Physical Characteristics:

Compact size

25mm x 40mm x 14mm (1.0" x 1.6" x 0.55")

RJ-45 connector for Ethernet connection

PCB-mountable with through-hole or surface-mount options

Applications

The ENC28J60 Ethernet LAN Module is suitable for a wide range of applications, including

IoT devices and sensors

Embedded systems and robotics

Industrial automation and control systems

Home automation and security systems

Medical devices and equipment

Documentation and Resources

datasheet

ENC28J60 datasheet (Microchip)

documentation

ENC28J60 Ethernet LAN Module user manual (manufacturer's documentation)

libraries and examples

available for various microcontrollers, including Arduino and Raspberry Pi

Revision History

Rev 1.0Initial release
Rev 1.1Updated documentation and resources
Rev 1.2Corrected typographical errors

Note

The information provided is based on the manufacturer's documentation and is subject to change. It is recommended to consult the manufacturer's website or documentation for the most up-to-date information.

Pin Configuration

  • ENC28J60 Ethernet LAN Module Pinout
  • The ENC28J60 Ethernet LAN Module is a popular IoT component used for adding Ethernet connectivity to microcontrollers and other embedded systems. Here is a detailed explanation of each pin on the module:
  • 1. VCC (Power Supply)
  • Function: Power supply pin for the module
  • Voltage: 3.3V or 5V (depending on the specific module and application)
  • Connection: Connect to a stable power source (e.g., a 3.3V or 5V voltage regulator output)
  • 2. GND (Ground)
  • Function: Ground pin for the module
  • Connection: Connect to the system ground (GND)
  • 3. CLKOUT (Clock Output)
  • Function: Output clock signal for the ENC28J60 chip
  • Frequency: 25 MHz (typically)
  • Connection: Can be connected to the microcontroller's clock input (if required) or left unconnected
  • 4. CLKIN (Clock Input)
  • Function: Input clock signal for the ENC28J60 chip
  • Frequency: 25 MHz (typically)
  • Connection: Connect to a stable clock source (e.g., a crystal oscillator or a dedicated clock generator)
  • 5. SI (Serial Input)
  • Function: Serial data input for the ENC28J60 chip
  • Connection: Connect to the microcontroller's SPI (Serial Peripheral Interface) data output (MOSI)
  • 6. SO (Serial Output)
  • Function: Serial data output from the ENC28J60 chip
  • Connection: Connect to the microcontroller's SPI data input (MISO)
  • 7. SCK (Serial Clock)
  • Function: Serial clock input for the ENC28J60 chip
  • Connection: Connect to the microcontroller's SPI clock output (SCK)
  • 8. CS (Chip Select)
  • Function: Chip select input for the ENC28J60 chip
  • Connection: Connect to the microcontroller's output pin that controls the ENC28J60 chip select (typically an active-low signal)
  • 9. INT (Interrupt)
  • Function: Interrupt output from the ENC28J60 chip
  • Connection: Connect to a microcontroller input pin to detect interrupts (e.g., packet reception or transmission completion)
  • 10. RST (Reset)
  • Function: Reset input for the ENC28J60 chip
  • Connection: Connect to a microcontroller output pin that controls the ENC28J60 chip reset (typically an active-low signal)
  • 11. TX+ (Transmit Plus)
  • Function: Differential transmit output (positive) for the Ethernet interface
  • Connection: Connect to a suitable Ethernet transformer or magnetic module (e.g., a RJ45 connector with an internal transformer)
  • 12. TX- (Transmit Minus)
  • Function: Differential transmit output (negative) for the Ethernet interface
  • Connection: Connect to a suitable Ethernet transformer or magnetic module (e.g., a RJ45 connector with an internal transformer)
  • 13. RX+ (Receive Plus)
  • Function: Differential receive input (positive) for the Ethernet interface
  • Connection: Connect to a suitable Ethernet transformer or magnetic module (e.g., a RJ45 connector with an internal transformer)
  • 14. RX- (Receive Minus)
  • Function: Differential receive input (negative) for the Ethernet interface
  • Connection: Connect to a suitable Ethernet transformer or magnetic module (e.g., a RJ45 connector with an internal transformer)
  • When connecting the ENC28J60 Ethernet LAN Module to a microcontroller, ensure that the following connections are made:
  • VCC to a stable power source
  • GND to the system ground
  • CLKOUT to the microcontroller's clock input (if required) or left unconnected
  • SI to the microcontroller's SPI data output (MOSI)
  • SO to the microcontroller's SPI data input (MISO)
  • SCK to the microcontroller's SPI clock output (SCK)
  • CS to the microcontroller's output pin that controls the ENC28J60 chip select
  • INT to a microcontroller input pin to detect interrupts
  • RST to a microcontroller output pin that controls the ENC28J60 chip reset
  • TX+, TX- to a suitable Ethernet transformer or magnetic module
  • RX+, RX- to a suitable Ethernet transformer or magnetic module
  • Note: The specific pin connections may vary depending on the microcontroller and the application. Always refer to the microcontroller's datasheet and the ENC28J60 datasheet for detailed information on pin connections and programming.

Code Examples

ENC28J60 Ethernet LAN Module Documentation
Overview
The ENC28J60 is a popular Ethernet LAN module that provides a simple and cost-effective way to add Ethernet connectivity to microcontrollers and other devices. This module is based on the Microchip ENC28J60 IC, which is a 28-pin, 10/100 Base-TX Ethernet controller. It supports both half-duplex and full-duplex modes, and can operate at speeds of up to 10 Mbps.
Pinouts and Connections
The ENC28J60 module has the following pinouts:
VCC: 3.3V power supply
 GND: Ground
 SCK: SPI clock input
 SO: SPI data output
 SI: SPI data input
 CS: SPI chip select input
 INT: Interrupt output
 RST: Reset input
 TX+: Ethernet transmit+
 TX-: Ethernet transmit-
 RX+: Ethernet receive+
 RX-: Ethernet receive-
Code Examples
### Example 1: Basic Ethernet Connection using Arduino
This example demonstrates how to use the ENC28J60 module with an Arduino board to connect to a network and send a simple HTTP request.
```c
#include <EtherCard.h>
// Define the ENC28J60 pins
#define ENC_CS  5
#define ENC_CLK 6
#define ENC_MOSI 7
#define ENC_MISO 8
// Initialize the Ethernet library
 EtherCard eth(ENC_CS, ENC_CLK, ENC_MOSI, ENC_MISO);
void setup() {
  // Initialize the Ethernet module
  eth.begin();
// Set the IP address and subnet mask
  eth.setIP("192.168.1.100");
  eth.setSubnet("255.255.255.0");
// Set the default gateway
  eth.setGateway("192.168.1.1");
}
void loop() {
  // Send an HTTP request
  eth.sendRequest("GET / HTTP/1.1
Host: www.example.com

");
// Wait for the response
  delay(1000);
// Print the response
  while (eth.available() > 0) {
    char c = eth.read();
    Serial.print(c);
  }
}
```
### Example 2: UDP Communication using Raspberry Pi and Python
This example demonstrates how to use the ENC28J60 module with a Raspberry Pi to send and receive UDP packets using Python.
```python
import socket
# Define the Ethernet module's IP address and port
IP_ADDR = "192.168.1.100"
PORT = 5000
# Create a UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Bind the socket to the IP address and port
sock.bind((IP_ADDR, PORT))
while True:
  # Receive a UDP packet
  data, addr = sock.recvfrom(1024)
# Print the received data
  print("Received:", data)
# Send a response packet
  sock.sendto("Hello from ENC28J60!", addr)
```
### Example 3: Web Server using ESP8266 and MicroPython
This example demonstrates how to use the ENC28J60 module with an ESP8266 board running MicroPython to create a simple web server.
```python
import machine
import network
# Define the Ethernet module's IP address and subnet mask
IP_ADDR = "192.168.1.100"
SUBNET_MASK = "255.255.255.0"
# Initialize the Ethernet interface
eth = network.ENC28J60(machine.Pin(5), machine.Pin(6), machine.Pin(7), machine.Pin(8))
# Set the IP address and subnet mask
eth.ifconfig((IP_ADDR, SUBNET_MASK, "192.168.1.1", "255.255.255.255"))
# Create a web server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("0.0.0.0", 80))
s.listen(5)
while True:
  # Accept an incoming connection
  conn, addr = s.accept()
# Handle the HTTP request
  request = conn.recv(1024)
  conn.send("HTTP/1.1 200 OK

Hello from ENC28J60!")
  conn.close()
```
These examples demonstrate the basic functionality of the ENC28J60 Ethernet LAN module and can be used as a starting point for more complex projects.