Você está na página 1de 14

School of Electronics Engineering (SENSE)

PROJECT BASED LEARNING (PBL) - REPORT


COURSE CODE / NAME ECE308COMPUTER COMMUNICATION
PROGRAM / YEAR B.Tech (ECE)/III Year
LAST DATE FOR
02/05/2017
REPORT SUBMISSION
DATE OF SUBMISSION 5/4/2017

REGISTER NO. NAME


14BEC1129 PRASHANTH REDDY GNANI
TEAM MEMBERS
14BEC1185 G TARUN KUMAR
DETAILS
14BEC1204 AMAL SHAJ

HOME AUTOMATION OVER WIRED


PBL TITLE LAN AND WIRELESS LAN

COURSE HANDLERS
Prof. Berlin Hency
NAME
REMARKS

COURSE HANDLERS
SIGN
Table of Content
Abstract.........................................................................................
1. Introduction..............................................................................
1.1 Home Automation & components........................................
2. Block Diagram & Architecture................................................
2.1 Flow Diagram......................................................................
3. Real Time Implementation.......................................................
3.1 Web Server...........................................................................
3.2 HardWare Required.............................................................
3.3 Procedure for Configuration ...............................................
4. Coding......................................................................................
5. Results and Inference...............................................................
6. Conclusion...............................................................................
7. References................................................................................
ABSTRACT:
Home automation gives you access to control devices in your home from a mobile device anywhere in
the world. The term may be used for isolated programmable devices, like thermostats and sprinkler
systems, but home automation more accurately describes homes in which nearly everything -- lights,
appliances, electrical outlets, heating and cooling systems -- are hooked up to a remotely controllable
network. From a home security perspective, this also includes your alarm system, and all of the doors,
windows, locks, smoke detectors, surveillance cameras and any other sensors that are linked to it.
INTRODUCTION:
Home automation gives you access to control devices in your home from a mobile device anywhere in
the world. The term may be used for isolated programmable devices, like thermostats and sprinkler
systems, but home automation more accurately describes homes in which nearly everything -- lights,
appliances, electrical outlets, heating and cooling systems -- are hooked up to a remotely controllable
network. From a home security perspective, this also includes your alarm system, and all of the doors,
windows, locks, smoke detectors, surveillance cameras and any other sensors that are linked to it.

Home Automation Developments


Until fairly recently, automated central control of building-wide systems was found only in larger
commercial buildings and expensive homes. Typically involving only lighting, heating and cooling
systems, building automation rarely provided more than basic control, monitoring and scheduling
functions and was accessible only from specific control points within the building itself.

Home automation is a step toward what is referred to as the "Internet of Things," in which everything
has an assigned IP address, and can be monitored and accessed remotely.

The first and most obvious beneficiaries of this approach are "smart" devices and appliances that can be
connected to a local area network, via Ethernet or Wi-Fi. However, electrical systems and even
individual points, like light switches and electrical outlets, were also integrated into home automation
networks, and businesses have even explored the potential of IP-based inventory tracking. Although the
day is still far off when you'll be able to use your mobile browser to track down a lost sock, home
networks are capable of including an increasing number of devices and systems.

Automation
Automation is, unsurprisingly, one of the two main characteristics of home automation. Automation
refers to the ability to program and schedule events for the devices on the network. The programming
may include time-related commands, such as having your lights turn on or off at specific times each day.
It can also include non-scheduled events, such as turning on all the lights in your home when your
security system alarm is triggered.

Once you start to understand the possibilities of home automation scheduling, you can come up with any
number of useful and creative solutions to make your life better. Is that west-facing window letting in
too much light? Plug your motorized blinds into a "smart" outlet and program it to close at noon each
day. Do you have someone come by at the same time each day to walk the dog? Program your home
automation system to unlock the front door for them, and lock it up again when they're done.

Remote Control
The other main characteristic of cutting-edge home automation is remote monitoring and access. While a
limited amount of one-way remote monitoring has been possible for some time, it's only since the rise in
smartphones and tablets that we've had the ability to truly connect to our home networks while we're
away. With the right home automation system, you can use any Internet-connected device to view and
control the system itself and any attached devices.
Monitoring apps can provide a wealth of information about your home, from the status of the current
moment to a detailed history of what has happened up to now. You can check your security system's
status, whether the lights are on, whether the doors are locked, what the current temperature of your
home is and much more. With cameras as part of your home automation system, you can even pull up
real-time video feeds and literally see what's going on in your home while you're away.

Even simple notifications can be used to perform many important tasks. You can program your system to
send you a text message or email whenever your security system registers a potential problem, from
severe weather alerts to motion detector warnings to fire alarms. You can also get notified for more
mundane events, such as programming your "smart" front door lock to let you know when your child
returns home from school.

The real hands-on control comes in when you start interacting with the home automation system from
your remote app. In addition to arming and disarming your security system, you can reprogram the
scheduling, lock and unlock doors, reset the thermostat and adjust the lights all from your phone, from
anywhere in the world. As manufacturers are creating more and more "smart" devices and appliances all
the time, the possibilities for home automation are virtually limitless.

Home Automation Components

What kinds of things can be part of a home automation system? Ideally, anything that can be connected
to a network can be automated and controlled remotely. In the real world (outside of research labs and
the homes of the rich and famous), home automation most commonly connects simple binary devices.
This includes "on and off" devices such as lights, power outlets and electronic locks, but also devices
such as security sensors which have only two states, open and closed.

Where home automation becomes truly "smart" is in the Internet-enabled devices that attach to this
network and control it. The classic control unit is the home computer, for which many of the earlier
home automation systems were designed. Today's home automation systems are more likely to distribute
programming and monitoring control between a dedicated device in the home, like the control panel of a
security system, and a user-friendly app interface that can be accessed via an Internet-enabled PC,
smartphone or tablet.

Manufacturers have produced a wide variety of "smart" devices, many of which are full of innovative
features but few of which offer the kind of integration needed to be part of a complete home automation
system. Much of the problem has been that each manufacturer has a different idea of how these devices
should be connected and controlled. So while you may have a "smart" TV, washing machine,
refrigerator, thermostat, coffee maker or any of the other Internet-ready household devices on the
market, the end result is usually a separate control scheme for each device.

In the near future, home automation may be standardized to let us truly take advantage of all of these
additional possibilities. For the time being, the home security providers that specialize in home
automation have focused on the most critical and useful parts of a connected home. At a basic level, this
means the doors and windows and environmental devices (thermostat, smoke detectors, temperature,
humidity, fire and carbon dioxide sensors) that keep you safe and comfortable. For additional real-time
security, convenience and control, home automation systems from security providers should also include
options for video cameras. With the best systems, you'll also be able to include lights and individual
electrical outlets into your home automation package.

BLOCKDIAGRAM /ARCHITECTURE:
Client/server architecture is a computing model in which the server hosts, delivers and manages most of
the resources and services to be consumed by the client. This type of architecture has one or more client
computers connected to a central server over a network or Internet connection.

FLOW DIAGRAM:
IMPLEMENTATION (REAL TIME):

Web Server
In this you will use your Ethernet Shield and your Arduino or Genuino board to create a simple Web
server. Using the Ethernet library, your device will be able to answer a HTTP request with your
Ethernet shield. After opening a browser and navigating to your Ethernet shield's IP address, your
Arduino will respond with just enough HTML for a browser

Hardware Required
Arduino or Genuino Board

Arduino Ethernet Shield

The Ethernet shield allows you to connect a WizNet Ethernet controller to the Arduino or Genuino
boards via the SPI bus. It uses pins 10, 11, 12, and 13 for the SPI connection to the WizNet. Later
models of the Ethernet shield also have an SD Card on board. Digital pin 4 is used to control the
slave select pin on the SD card.

The shield should be connected to a network with an ethernet cable. You will need to change the
network settings in the program to correspond to your network.
Procedure for configuration of arduino and router

1.Configure the Arduino as a Web Server


The Arduino is set up as an HTTP web server that hosts a web page

2. Connect to the Arduino Web Server using Router Port


Forwarding
It is assumed that you are using an ADSL router or similar device as you Internet connection. Port
forwarding must be enabled on the router so that your Arduino can be "seen" on the Internet.

You will need to log into your router using a web browser and then set up and enable port forwarding. After
setting up port forwarding, you will be able to load your Arduino web page from a device connected to the
Internet and external to your own network.
3. Handle Dynamic DNS using an External Service
Most ISPs (Internet Service Providers) will assign you a dynamic IP (Internet Protocol) address when you
log in with your ADSL router. This means that they will change the IP address every so often. The IP address
will also change if you switch the router off and then on again later.

After enabling port forwarding on your router, you will be accessing your Arduino using the IP address that
your ISP assigns to you. Every time that the dynamic IP address is changed, you will need to find out what it
is and then surf to it to see your Arduino web server on the Internet.

External services (such as NoIP and others) can be used for free to give your Arduino a domain name (e.g.
myduino123.somednsservice.com) and take care of the dynamic IP address at the same time by associating
the new IP address with the same domain name every time that it changes.

The next section in this tutorial shows how to complete the above steps to connect your Arduino to the
Internet.

Configure and Enable Port Forwarding


The following instructions are for a router for a different router read the router documentation or search on
the Internet to complete the steps below.

In the web browser after logging into the router, click the advanced tab at the top of the page. Here you will
be able to see the dynamic IP address that your ISP issued you when your router connected to the Internet.
This is shown as xxx.xxx.xxx.xxx in the image below.

The dynamic IP address will be used to access the Arduino. If you can't find the IP address in your router
setting, Google "what's my IP"

Click the Port Forwarding / Port Triggering menu item. Now set port forwarding as follows:

1. Make sure that the Port Forwarding radio button is selected.


2. Select HTTP(TCP:80) from the Service Name drop down menu.
3. Enter the Arduino IP address from the Arduino sketch into the Server IP Address fields.
4. Click the +Add button.

Test that the Arduino can be Reached on the Internet

With the above setting done, the Arduino web server should be able to be reached from the Internet at the IP
address that your ISP provided to your ADSL router.
Enter the IP address into the address bar of a web browser from a device that is not connected to your local
network, e.g. use a smart-phone with cellular data connection.

You should now be able to see your Arduino on the Internet. If you have a static IP address, then you can
always find the Arduino at this address as long as the Arduino and router are powered up.

If you have a dynamic IP address, then every time that your IP address is changed, you will need to find the
new IP address to connect to your Arduino web server.

CODING:
#include <SPI.h>

#include <Ethernet.h>

#include <Servo.h>

int led = 4;

Servo microservo;

int pos = 0;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address

byte ip[] = { 192, 168, 1, 178 }; // ip in lan (that's what you need to use in your browser.
("192.168.1.178")

byte gateway[] = { 192, 168, 1, 1 }; // internet access via router

byte subnet[] = { 255, 255, 255, 0 }; //subnet mask

EthernetServer server(80); //server port

String readString;

void setup() {

// Open serial communications and wait for port to open:

Serial.begin(9600);
while (!Serial) {

; // wait for serial port to connect. Needed for Leonardo only

pinMode(led, OUTPUT);

microservo.attach(7);

// start the Ethernet connection and the server:

Ethernet.begin(mac, ip, gateway, subnet);

server.begin();

Serial.print("server is at ");

Serial.println(Ethernet.localIP());

void loop() {

// Create a client connection

EthernetClient client = server.available();

if (client) {

while (client.connected()) {

if (client.available()) {

char c = client.read();

//read char by char HTTP request

if (readString.length() < 100) {

//store characters to string

readString += c;

//Serial.print(c);

}
//if HTTP request has ended

if (c == '\n') {

Serial.println(readString); //print to serial monitor for debuging

client.println("HTTP/1.1 200 OK"); //send new page

client.println("Content-Type: text/html");

client.println();

client.println("<HTML>");

client.println("<HEAD>");

client.println("<meta name='apple-mobile-web-app-capable' content='yes' />");

client.println("<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent' />");

client.println("<link rel='stylesheet' type='text/css' href='http://randomnerdtutorials.com/ethernetcss.css'


/>");

client.println("<TITLE>Random Nerd Tutorials Project</TITLE>");

client.println("</HEAD>");

client.println("<BODY>");

client.println("<H1>Random Nerd Tutorials Project</H1>");

client.println("<hr />");

client.println("<br />");

client.println("<H2>Arduino with Ethernet Shield</H2>");

client.println("<br />");

client.println("<a href=\"/?button1on\"\">Turn On LED</a>");

client.println("<a href=\"/?button1off\"\">Turn Off LED</a><br />");

client.println("<br />");

client.println("<br />");

client.println("<a href=\"/?button2on\"\">Rotate Left</a>");

client.println("<a href=\"/?button2off\"\">Rotate Right</a><br />");

client.println("<p>Created by Rui Santos. Visit http://randomnerdtutorials.com for more projects!</p>");

client.println("<br />");
client.println("</BODY>");

client.println("</HTML>");

delay(1);

//stopping client

client.stop();

//controls the Arduino if you press the buttons

if (readString.indexOf("?button1on") >0){

digitalWrite(led, HIGH);

if (readString.indexOf("?button1off") >0){

digitalWrite(led, LOW);

if (readString.indexOf("?button2on") >0){

for(pos = 0; pos < 180; pos += 3) // goes from 0 degrees to 180 degrees

{ // in steps of 1 degree

microservo.write(pos); // tell servo to go to position in variable 'pos'

delay(15); // waits 15ms for the servo to reach the position

if (readString.indexOf("?button2off") >0){

for(pos = 180; pos>=1; pos-=3) // goes from 180 degrees to 0 degrees

microservo.write(pos); // tell servo to go to position in variable 'pos'

delay(15); // waits 15ms for the servo to reach the position

//clearing string for next read


readString="";

}}}

RESULTS& INFERENCES:
The server hosted successfully over wired lan successfully

There are some configuration problems with gateway while configuring router

APPLICATION ORIENTED LEARNING:


We have configured the router;
Some knowledge about both static and dynamic ip configuration
NAT PORT forwarding configuration

CONCLUSION:
This field is only in testing stage it has to figure out how to deal with large databases
when they are implement.

..

REFERENCES:
www.arudino.com
www.cisco.com

Você também pode gostar