You are on page 1of 4

International Journal on Recent and Innovation Trends in Computing and Communication

Volume: 4 Issue: 3

ISSN: 2321-8169
256 - 259

_______________________________________________________________________________________

Ethernet Enabled Digital Home Automation System


Amit B. Sanghai
Dept of E&TC
Government College of Engg.
Jalgaon, Maharashtra
iamitsanghai@gmail.com

Prof. Mangala R. Dhotre


Dept of E&TC
Government college of Engg.
Jalgaon, Maharashtra
mangala_dev@rediffmail.com

AbstractThis paper presents very intelligible and economical method to provide Ethernet connectivity to microcontroller based controlled
embedded systems. This system uses TCP/IP stack as a very essential element of the system software and also uses ATmega328p as a host
microcontroller to store the main application source code, web pages. An Ethernet controller chip, ENC 28J60 is used to handle the Ethernet
communications which is interfaced with the host microcontroller using SPI pins. There are many I/O pins available at the microcontroller which
is used to interface with relays for controlling operations remotely.
Nowadays, most of the internet connections use Ethernet as media for data transfer. Most of the time we need to control different home
appliances using microcontrollers. If we enable Ethernet interface to such systems then we can communicate with them remotely over the
internet with wired by means of wired or wirelessly.
Keywords- TCPI/P stack; ATmega328p; Ethernet controller; serial peripheral interface (SPI).

__________________________________________________*****_________________________________________________
I. INTRODUCTION
Early, Ethernet was available only to desktop
computers and other large computers. To exchange
information with other computers embedded systems had
limited interfaces with low speed, limited range, or lack of
standard application protocols. There is misconception that
ethernet is available for processors only.
In recent times, developments in technology now
make it feasible for embedded systems to communicate in
local Ethernet networks as well as on the Internet. Network
communication enabled embedded system are now more
powerful and easier to monitor and control [1].
The Internet has been widely used to connect
personal computers so far, but shortly all kinds of appliances
with embedded advanced controller will exchange
information over the Internet. Many numbers of
microcontrollers are available in todays devices which can
have ability to link with the Internet.
In this paper, we present the principles and to
design a system for Internet-based controlled system by
using ATmega328p as a host microcontroller and ethernet
controller chip. Web access functionality is embedded in a
system to enable low cost widely accessible and enhanced
user interface functions. Through a device web page, a web
server in the device provides access to the user interface
functions for the device. An embedded web server in any
appliance is connected to the Internet so the appliance can
be controlled from remote places through the browser in a
computer.
The aim of this project is to control the devices
especially home appliances from the remote place through a
web page. The devices which are to be controlled are
connected to the relays on the circuit board. The web-server
circuit is connected to LAN. The client or a person on the
PC is also connected to same LAN or Internet. By entering
the IP-addressof system on the web browser, the user gets a
web page on screen and this predesigned webpage contains
all the controlling information of the devices. The user can

control the devices interfaced to the web server by pressing


a function key provided in the web page.
II.

SYSTEM COMPONENTS

This proportion gives knowledge about various


components related to the system and various options
available for accessing them. Some of the important
components are listed below.
Ethernet
Ethernet controller Chip
SPI interface
I/O system
A. Ethernet
Ethernet is standardized as IEEE 802.3. The
combination of the twisted pair versions of Ethernet for
connecting systems to the network, along with the fiber
optic versions for site backbones, is the most widespread
wired LAN technology.
Ethernet is a data link and physical layer protocol
defined by the IEEE 802.3 specification [2]. Ethernet is
capable to transfer any kind of data, from short messages to
large files. Ethernet is used to achive many purposes.An
Ethernet communication can take advantage of higher-level
protocols such as TCP and IP. Ethernet doesn't require a
super computer. With additional use Ethernet controller
W5100 chip, even an 8-bit microcontroller can communicate
by means of Ethernet.
Ethernet is a major and most widely used family of
frame-rooted networking technologies for local area
networks. The name ethernet is based on the physical
concept of the ether. It defines a number of signaling and
wiring standards for the physical layer, Media Access
Control (MAC) and a common addressing format are used
for network access. Ethernet stations communicate to each
other on top of the physical layer. It is done by sending each
data packets, small blocks of data that are individually sent
and delivered in multiplexed fashion.
256

IJRITCC | March 2016, Available @ http://www.ijritcc.org

_______________________________________________________________________________________

International Journal on Recent and Innovation Trends in Computing and Communication


Volume: 4 Issue: 3

ISSN: 2321-8169
256 - 259

_______________________________________________________________________________________
B. Ethernet Controller Chip
The ENC2SJ60 is a stand-alone Ethernet controller
with capability of Serial Peripheral Interface (SPI).The chip
consists of on-chip 10 Mbps Ethernet Physical Layer (PHY)
and Medium Access Controller (MAC), providing reliable
data transmission and reception based on standard Ethernet
protocol.
The PHY contains analog circuitry on the twisted
pair interface used to encode and decode the data. The MAC
contains digital circuitry to control different tasks such as
when to transmit, handle automatic retransmission when a
collision is detected, calculates and validates CRCs
(Cyclical Redundancy Check).A total of 8 kilobytes of
RAM is present on the device.

Figure2. Serial Peripheral Interface


III.HARDWARE ARCHITECTURE
This system uses microcontroller interfaced with a
Stand-Alone Ethernet Controller IC which handles most of
the network protocol requirements. This ethernet controller
IC communicates directly to the microcontroller using a
standard SPI interface. The system hardware includes an
Ethernet controller IC ENC28J60,Ethernet transformer RJ45
socket
with link-activity
indicator
lights,
host
microcontroller (ATmega328p) and input/output devices
like relays for controlling purpose. This system enables user
to connect a particular embedded device (with SPI support)
on to a network. By using this Ethernet enabled system,
applications like Embedded Web server can be easily
developed.
A. RJ-45 Connector socket
Ethernet uses a bus (coaxial cable) or star topology
(standard UTP cable). The majorityof the Ethernet networks
use unshielded twisted pair (UTP) cable. Category 5 cable
widely used, but other distinctions are available.RJ-45
connectors are specified by EIA/TIA and properly named as
8P8C-(ISO 8877) for unshielded twisted pair cable. A LAN
cable can be attached here using RJ-45 connector.

Figure1. ENC 28J60 Ethernet controller IC


C. SPI (Serial Peripheral Interface) Standard
The SPI is an interface has a 4-wire serially
connected synchronous interface. Data communication is
enabled through low active Slave Select (SS). Device status
information is transmitted with a 3- wire interface
consistingof wires for serial data input (MOSI),output
(MISO),serial data and serial clock (SCK).
SPI
MASTER

SCLK
MOSI
MISO
SS

SCLK
MOSI
MISO
SS

B. Ethernet transformer
On the TPIN+/TPIN- and TPOUT+/TPOUT- pins
of ENC28J60, 1:1 center taped pulse transformers, used for
Ethernet operations, are required. When the Ethernet module
isactivated, current is continually sunk through both
TPOUTpins. When the PHY is effectively transmitting, a
distinctive voltage is produced on the Ethernet cable by
varying the relative current sunk by TPOUT+ compared to
TPOUT-.

SPI
SLAVE

257
IJRITCC | March 2016, Available @ http://www.ijritcc.org

_______________________________________________________________________________________

International Journal on Recent and Innovation Trends in Computing and Communication


Volume: 4 Issue: 3

ISSN: 2321-8169
256 - 259

_______________________________________________________________________________________
It is not recommended to place a common-mode choke
on the TPOUT interface, between the TPOUT pins and the
Ethernet transformer. It should be placed between the
Ethernet transformer and pins I and 2 of the RJ-45 connector
if a common-mode choke is used to reduce EMI emissions,.
Many Ethernet transformer modules include common-mode
chokes inside the same device package [5].
C. ENC28J60
The ENC28J60 is a stand-alone Ethernet controller
with an industry standard Serial Peripheral Interface (SPI). It
is designed to fulfill as an Ethernet network interface for any
controller equipped with SPI. The ENC28J60 meets all of the
IEEE 802.3 level specifications. It consists of a number of
packet filtering schemes to limit incoming packets.For fast
data throughput and hardware assisted checksum calculation
an internal DMA module is used.An interrupt pinand the SPI
is used to communicate with the host controller, with clock
rates of up to 20 MHz. For LED link and network activity
indication two dedicated pins are used [5]. A typical
application using the device (lC) is shown in Figure 4. With
the ENC28J60, two pulse transformers and a few passive
components are required to connect a microcontroller to an
Ethernet network.
D. MCU ATmega328p
The ATmega328 is 28 pin microcontroller from
Atmel AVR family. It has 32 Kbytes of flash memory which
is sufficient to accommodate our configured TCP/IP stack
(explained later) as well as our main application source code.
It is 8-bit microcontrollerbased on the AVR enhanced RISC
architecture with low-power CMOS design [4]. By executing
powerful instructions in a single clock cycle, the
ATmega328p have throughputs nearly 1 MIPS per MHz
allowing the system designer to optimize power consumption
versus processing speed.
E. I/O Control system
This is a simple circuitry to control
differentparameters and devices on the field. It is interfaced
withmicrocontroller using different I/O ports. Driving
circuitryconsist of relay drivers, signal conditioners etc. At
the end ofthe system, relays are used to switch ONor OFF
different devices connected to them. Differentsensors can be
used to sense the physical data such astemperature, light etc.

IV. SOFTWARE REQUIREMENT


Ethernet controller chip and its driver module in the
ethernet network formthe interface to the network.
Communications between the controller chip and a network
protocol stack is managed by the Ethernet driver module. It
also contains program code [1]. A Transmission Control
Protocol/Internet Protocol (TCP/IP) software load is
necessary for internet communication over Ethernet. This
stack resides on the Host microcontroller unit.
The TCP-IP stack, need to be configured according
to the host microcontroller used in the system. A driver for
the ENC28J60 and a TCP/IP stack including an HTTP web
server is available at Microchip.
Web pages that are designedfor user need to be
stored in external or internal EEPROM. These web pages
can be accessed by accessing the IP address assigned to the
system. The system IP address and server IP address can be
configured by making changes in the program. This
assembly is written in C (Compatible with Microchip CI8
compiler).
A. TCP/IP Download and support
Microchip offers a TCP/IP stack designed for the
PIC 18, PIC24, dsPIC and PIC32 microcontroller families at
zero expenses.The stack needs to be configured as we are
using AVR ATmega328p microcontroller. There are at least
three files that will need to be edited and modified. The first
is config.h file, second is the particular hardware
configuration file for our system hardware and third is main
application source code. The stack is divided into multiple
layers. Each layer in the stack accesses services from one or
more layers located directly below of the layer.Per
specifications, many of the TCP/IP layers are configured as
live, in the significance that they act when a service is
requested and also when events like timeout or new packet
arrival occurs.
The stack design is module based design and is
written in the 'C' programming language. Productive
implementations can be achieved in roughly 25-30 KB of
code, depending on modules used, leaving plenty of code
space on host microcontroller for the user application.
B. IDE for microcontrollers program development
Here for developing and debugging embedded,
Atmel AVR applicationsAtmel AVRStudio is the Integrated
Development Environment (IDE) is utilised [3]. The AVR
Studio IDE gives a flawless and do-it-yourself environment
to write, assemble, and debug C/C++ and assembly code.
V. CONCLUSION AND FUTURE SCOPE

Figure 4. Circuit diagram

Ethernet enabled digital I/O control system is


designed for multiple input and output arrangements for
non-industrial applications mainly for home automation.
The system arrangement is simple, small and flexible which
can execute different input/output operations remotely over
Ethernet.
This system can be extended for sensing different
parameters of the machines and making corrective and
adaptive decisionsover it. Wireless Ethernet enabled
interface can also be developed with some advancement in
258

IJRITCC | March 2016, Available @ http://www.ijritcc.org

_______________________________________________________________________________________

International Journal on Recent and Innovation Trends in Computing and Communication


Volume: 4 Issue: 3

ISSN: 2321-8169
256 - 259

_______________________________________________________________________________________
existing system. There is no limit for future scope in the
control and monitoringoperation. Home automation is no
longer limited by the walls of the accessing appliance
facility. Further advanced thinking in automation is being
handled and implemented via remote communication. This
Ethernet Embedded system ways to numerous applications
to be developed in the area of monitoring and automation.
REFERENCES
[1] Andrew Tanenbaum, "Computer Networks", 4th Edition,
2003.
[2] Richard H. Barnett, Larry O'CuII, Sarah Cox, "Embedded C
Programming and The Amel AVR", 2007. pp. 249-253.
[3] Microchip Technology Inc.,"ENC 28J60 Data Sheet", 2008.
[4] www.microchip.com
[5] AVR
Studio
4,
for
AVR
micro
controllers
http://www.atme1.com/dyn/products/tools_card.asp?tool_id=
2725

259
IJRITCC | March 2016, Available @ http://www.ijritcc.org

_______________________________________________________________________________________

You might also like