You are currently viewing ENC28J60 Ethernet Module: Arduino Web Server in Proteus with Simplified  Setup – Part1
Arduino Web Server - PART 1

ENC28J60 Ethernet Module: Arduino Web Server in Proteus with Simplified Setup – Part1

The ENC28J60 Ethernet module is a small circuit board that you can connect to your Arduino or Raspberry Pi. It acts as a bridge between your small controller and the Ethernet network. It contains a special chip called the ENC28J60, which is designed to handle the communication between your device and the network.

ENC28J60 Ethernet Module in Proteus

Currently, Proteus offers two models of Ethernet cards: the Realtek RTL8019AS and the Microchip ENC28J60. These models will not function unless your computer has a physical Ethernet card. Please verify that you have such a card installed and that any necessary drivers are both installed and enabled.

Unveiling the Upgraded ENC28J60 Ethernet Module Design

In this post, I’ll be sticking to the ENC28J60 Ethernet module I personally designed. You might be wondering about the difference between the Proteus ENC28J60 and mine, but truth be told, they’re pretty much the same in terms of functionality. However, the one I crafted has some extra perks. It’s got a sleeker look with enhanced graphics and a cleaner interface, which matches the hardware module’s aesthetics. What’s more, I’ve even added LEDs to the module, so you can easily see if the Ethernet port is active or linked up.

ENC28J60 Ethernet Module
ENC28J60 Ethernet Module

Network Setup

Before building your circuit and starting the simulation, you need to set up some necessary components on your Windows system. This includes installing a packet capture library and a virtual network driver.

Packet capture library

Proteus recommends installing the WinPcap library, but it is no longer actively maintained. Therefore, you should use Npcap instead.

Npcap is a packet sniffing library and driver for Windows operating systems. It is an open-source project based on the well-known WinPcap library but with additional features and improvements. Npcap allows users to capture and analyze network traffic on Windows machines. It provides support for various network protocols and offers features like loopback traffic capturing, raw 802.11 packet capturing, and kernel-level packet filtering.

You can download this package from the Npcap website, and the installation process is straightforward. After agreeing to their license agreement, it provides a one-click install.

Virtual Network Driver

Suppose your PC doesn’t have a network card, or if it does, it’s already in use, or consider you are using a laptop that doesn’t have an Ethernet connection. In this case, you can use a virtual network driver, which can provide you with a dummy network adapter. This allows you to easily simulate the ENC28J60 Ethernet Module in Proteus.

There are multiple ways to obtain a virtual network adapter. If you’re using VMWare Workstation or VirtualBox software, you already have a virtual network adapter in your system, which you can utilize. Alternatively, if you’re not using either of these, you can utilize the Microsoft KM-Test Loopback adapter, accessible through your Computer Management settings.

Network Adapters
Network Adapters

As you can observe in the image above, Ethernet 3 represents my default PC network card adapter, while Ethernet 5 and others are provided by VirtualBox and VMWare Workstation software, respectively.

How to install Microsoft Loopback Adapter

Here is the installation method for the Microsoft Loopback Adapter. 

Loopback Adapter Installation
Loopback Adapter Installation

Now, you can choose whichever method suits you best.

Proteus Setup for ENC28J60 Ethernet Module

The ENC28J60 Ethernet Module is designed to interface directly with the Serial Peripheral Interface (SPI) port available on many microcontrollers. Therefore, we will use Arduino SPI pins to connect the ENC28J60.

ENC28J60 Ethernet Module Connection with Arduino
ENC28J60 Ethernet Module Connection with Arduino

Arduino Web Server Code

EtherCard Library

EtherCard is a library for Arduino that helps it communicate with the ENC28J60 Ethernet module, making it easier for Arduino to connect to Ethernet networks and perform tasks like sending and receiving data or serving web pages. You can find the EtherCard library for Arduino on the Arduino IDE Library Manager or on GitHub.

Arduino Code

This Arduino code creates a simple web server and serves a static welcome page to any HTTP requests it receives.

IP Address

The above code uses the static IP address for the ENC28J60 Ethernet Module, which is 169.254.199.140. The gateway IP, 169.254.199.139, is the IP address of the adapter I’m using. Therefore, for the gateway IP address, use the IP address of the network adapter you want to use. In this case, I’m using the Microsoft Loopback adapter, so you can check the IP address of this adapter from the connection details window. For the Ethernet Interface IP address, you can change the host ID to your own preference.

IP Address - ENC28J60 Ethernet Module
IP Address – ENC28J60 Ethernet Module

Now, in Proteus, open the properties window of the ENC28J60 Ethernet Module. You will find the field for the IP address. In this field, write the same IP address as your adapter’s.

Proteus Simulation

Write the code in the Arduino IDE and compile it. Copy the path of the resulting hex file and paste it into the Arduino Model in Proteus. Then, run the simulation. When you type the IP address into the browser and press Enter, Arduino shows the HTML web page.

Arduino Webserver with ENC28J60 Ethernet Module
Arduino Webserver with ENC28J60 Ethernet Module in Proteus

Download Library

Simply click on the button to download the library. You can refer to this post for instructions on how to install the library in Proteus 8. How to Download and install Library in Proteus (electronicstree.com)

Please wait 120 seconds: after that, your download will begin

ZIP Password : electronicstree.com

In the next post, we will send data from the Arduino pins to the webpage using the EtherCard Library and ENC28J60 Ethernet Module. If you have any requests for Arduino Module Libraries in Proteus, please leave a comment or message us using the contact form. Ⓜ️

If you have any requests for Arduino Module Libraries in Proteus, please leave a comment or message us using the contact form.

Leave a Reply