Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Control LED on Inernet using Arduino & ENC28J60 Ethernet Module
IoT Projects

Control LED on Inernet using Arduino & ENC28J60 Ethernet Module

Mamtaz AlamBy Mamtaz AlamUpdated:August 22, 20225 Comments3 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Control LED on Inernet using Arduino & ENC28J60
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Introduction:

In this article, we will learn how to Control LED on the Internet using Arduino & ENC28J60 Ethernet Module to establish communication between computer to Arduino in a LAN or Wireless Network. We are interfacing the ENC28J60 Ethernet controller to Arduino so that our Arduino will be the one of a member of that network. Once it will be done the Arduino can Control LED on the Internet using Arduino & ENC28J60 Ethernet Module. Interfacing ENC28J60 Ethernet Module with Arduino and will further give us the freedom of using the internet on Arduino.

Check this previous project on ENC28J60: Interface ENC28J60 Ethernet Module with Arduino Webserver


ENC28J60 Ethernet Module:

Introduction to ENC28J60:

The ENC28J60 Ethernet Module utilizes the Microchip ENC28J60 Stand-Alone Ethernet Controller IC featuring a host of features to handle most of the network protocol requirements. The board connects directly to most microcontrollers with a standard SPI interface with a transfer speed of up to 20MHz.

This Ethernet Breakout-Module is the simplest way to add LAN connectivity to your microcontroller-based products and projects.

  1. Use this module to enable an Ethernet interface for your product. It works with any microcontroller operating at 3. 3V or 5V.
  2. This module works at 3.3V and is compatible with 5V interface lines.
  3. Use the SPI process to interface with it.
  4. Host web server, ping the module or add it to home automation via internet.
  5. The heart of this module is the ENC28J60 Ethernet controller from Microchip.
  6. The use of RJ45 with Integrated magnetics has made it possible to reduce the size of the board.

Features:

  1. Ethernet LAN Module for Arduino/AVR/LPC/STM3
  2. ENC28J60 Ethernet chips
  3. Can be easily mounted with the MCU
  4. Network Interface: HR911105A
  5. Supply Voltage: 3.3 V (5V Tolerant DIO)
  6. 25Mhz crystal oscillator
  7. Size (L x W x H): Approx. 2.3 x 1.3 x 0.7 inch / 58 x 34 x 17 mm

Block Diagram & Connections:

This is the simple block diagram that explains how an Arduino & ENC28J60 module can be interfaced with Router and Computer so that LED can be controlled for switching on & off.

Control LED on Inernet using Arduino & ENC28J60
Figure: Block Diagram



The Router should be connected with LAN and should have multiple input-output ports. From the router, one ethernet cable is connected to Computer System and another ethernet cable should be connected to the ENC28J60 Module. Similarly, the ENC28J60 Module is connected to Arduino. The connection between Arduino & ENC28J60 is given below.


Control LED on the Internet using Arduino & ENC28J60 Ethernet Module:

  1. Download the Library for ENC28J60 from here: ENC28J60 Library

  2. Add the library files to your Arduino IDE library:

  3. Copy the code from below and paste it to Arduino IDE.

  4. Compile & then upload the code to Arduino UNO Board:

  5. Click on Serial Monitor and copy the IP Address:

  6. Open Google Chrome or any other web browser and paste the code and hit enter:



  1. Copy the syntax code. Modify the syntax code by editing it with your IP adress number. Then hit enter:

  2. Edit the code with ON & OFF command to switch on & switch off the LED:

Control LED on Inernet using Arduino & ENC28J60


Source Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#include <EtherCard.h>
 
#define STATIC 0 // set to 1 to disable DHCP (adjust myip/gwip values below)
 
// mac address
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
// ethernet interface ip address
static byte myip[] = { 192,168,0,200 };
// gateway ip address
static byte gwip[] = { 192,168,0,1 };
 
// LED to control output
int ledPin10 = 9;
 
byte Ethernet::buffer[700];
 
char const page[] PROGMEM =
“HTTP/1.0 503 Service Unavailable\r\n”
“Content-Type: text/html\r\n”
“Retry-After: 600\r\n”
“\r\n”
“<html>”
“<head><title>”
“Service Temporarily Unavailable”
“</title></head>”
“<body>”
“<h3>This page is used behind the scene</h3>”
“<p><em>”
“Commands to control LED are transferred to Arduino.<br />”
“The syntax:  or ON”
“</em></p>”
“</body>”
“</html>”
;
 
void setup () {
pinMode(ledPin10, OUTPUT);
 
Serial.begin(9600);
Serial.println(“Trying to get an IP…”);
 
Serial.print(“MAC: “);
for (byte i = 0; i < 6; ++i) {
Serial.print(mymac[i], HEX);
if (i < 5)
Serial.print(‘:’);
}
Serial.println();
 
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
{
Serial.println( “Failed to access Ethernet controller”);
}
else
{
Serial.println(“Ethernet controller access: OK”);
}
;
 
#if STATIC
Serial.println( “Getting static IP.”);
if (!ether.staticSetup(myip, gwip)){
Serial.println( “could not get a static IP”);
blinkLed(); // blink forever to indicate a problem
}
#else
 
Serial.println(“Setting up DHCP”);
if (!ether.dhcpSetup()){
Serial.println( “DHCP failed”);
blinkLed(); // blink forever to indicate a problem
}
#endif
 
ether.printIp(“My IP: “, ether.myip);
ether.printIp(“Netmask: “, ether.netmask);
ether.printIp(“GW IP: “, ether.gwip);
ether.printIp(“DNS IP: “, ether.dnsip);
}
 
void loop () {
 
word len = ether.packetReceive();
word pos = ether.packetLoop(len);
 
// IF LED10=ON turn it ON
if(strstr((char *)Ethernet::buffer + pos, “GET /?LED10=ON”) != 0) {
Serial.println(“Received ON command”);
digitalWrite(ledPin10, HIGH);
}
 
// IF LED10=OFF turn it OFF
if(strstr((char *)Ethernet::buffer + pos, “GET /?LED10=OFF”) != 0) {
Serial.println(“Received OFF command”);
digitalWrite(ledPin10, LOW);
}
 
// show some data to the user
memcpy_P(ether.tcpOffset(), page, sizeof page);
ether.httpServerReply(sizeof page – 1);
}
 
void blinkLed(){
while (true){
digitalWrite(ledPin10, HIGH);
delay(500);
digitalWrite(ledPin10, LOW);
delay(500);
}
}


Video Explanation & Demonstration:

How to control LED using Internet ENC28J60 & Arduino Webserver
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleUV Sensor ML8511 & Arduino for UV Ray Intensity Meter
Next Article Blind Walking Stick Using Arduino & Ultrasonic Sensor HC-SR04

Related Posts

ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

Updated:June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

Updated:June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

Updated:May 10, 20262K
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

Updated:May 2, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

Updated:April 27, 20261K
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

Updated:April 27, 20262K
View 5 Comments

5 Comments

  1. Ravi Keerthi on August 26, 2019 3:40 PM

    Hello,
    Thank You very much for wonderful code.
    Its working exactly as coded. But if i leave system idle for some time, i wont be able to access any more.
    I have to make arduino reset and use.
    What will be fix to solve this issue.
    Thank You.

    Reply
  2. nen on February 5, 2020 3:50 PM

    ethern

    Reply
  3. sam on February 20, 2020 7:40 PM

    embeddedadventures.com is a fake web site. they are fraud. you pay but you can’t get your item.

    Reply
  4. Asutosh Padhy on August 24, 2022 2:01 AM

    error: expected ‘)’ before numeric constant
    ether.httpServerReply(sizeof page – 1);
    ^
    exit status 1
    stray ‘\342’ in program

    Reply
  5. danieltzonkov on January 22, 2023 4:38 AM

    This is a problem with Unicode. Delete “-1” and reenter again “- 1”.

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • Half Wave Rectifier Basics, Circuit, Working & Applications
    Half Wave Rectifier Basics, Circuit, Working & Applications
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.