home automation using cloud computing
DESCRIPTION
Home Automation Using Cloud ComputingTRANSCRIPT
-
5/28/2018 Home Automation Using Cloud Computing
1/28
Home Automation Using Cloud Computing
Abstract: Today, we are entering post-PC era where mobile devices (e.g.
Smartphones, Smartphones and Handheld tablets) are handling daily tasks that
traditional desktop and laptop computers once handled. Several reports show
that personal computers are no longer on the leading the edge of computing and
the use of mobile devices are quickly taking over. Accompanying the shift from
PCs to multi-touch mobile devices is the use and implementation of Cloud
Networking. With the availability of products which integrate mobile devices and
cloud networking rapidly increasing, many users can see how new technology
can impact their everyday lives. In this paper we have developed a HomeAutomation system that employs the integration of multi-touch mobile devices,
cloud networking, wireless communication, and power-line communication to
provide the user with remote control of various lights and appliances within their
home. This system uses a consolidation of a mobile phone application, handheld
wireless remote, and PC based program to provide a means of user interface to
the consumer. The home automation system differs from other systems by
allowing the user to operate the system without the dependency of a mobile
carrier or Internet connection via the in-home wireless remote. This system isdesigned to be low cost and expandable allowing a variety of devices to be
controlled.
-
5/28/2018 Home Automation Using Cloud Computing
2/28
1 Problem Definition
Many people are always on the move from place to place due to business
demands. Some people can spend a couple of days away from their home leaving
all their household appliances without any kind of monitoring and control. Some
devices are left plugged into power sockets whereas others are supposed to be
plugged into and out of power sockets at different intervals depending on the
time of the day. All this requires an individual to manually attend to each of the
devices independently from time to time. All such monitoring and control can be
done without necessarily being around or inside the home. Some devices if not
controlled properly consume a lot of energy which leads to extra expenditure on
electricity. Therefore I propose to design an internet based home automation
system which will enable one to remotely manage his/her appliances from
anywhere, anytime.
-
5/28/2018 Home Automation Using Cloud Computing
3/28
2 Literature Survey
Home automation: Home automation is the residential extension of building
automation. It is the automation of the home, housework or household activity.
Internet : The Internet, sometimes called simply "the Net," is a worldwide
system of computer networks - a network of networks in which users at any one
computer can, if they have permission, get information from any other computer
(and sometimes talk directly to users at other computers). The Internet is now
widely used as a connectivity tool for educational, commercial, and personal
applications. The Internet is an exciting portal that makes it possible for users toaccess virtually an infinite supply of information.
Microcontroller: A microcontroller is an application specific integrated circuit
(ASIC) that fetches and executes instructions based on input from some user
program. These devices do not have a fixed function, but rather are controlled by
software.
Remote control:Remote control is the control of an activity, process, or machine
from a distance, as by radioed instructions or coded signals
-
5/28/2018 Home Automation Using Cloud Computing
4/28
3.1 Introduction
Modern advances in electronics and communications Technologies have lead to
the miniaturization and improvement of the performance of computers, sensors
and networking. These changes have given rise to the development of several
home automation technologies and systems. According to, home automationcan be useful to those who need to Access home appliances while away from
their home and can incredibly improve the lives of the disabled. Many of the
home automation systems that are commercially available can be separated into
two categories: locally controlled systems and remotely controlled systems.
Locally controlled systems use an in-home controller to achieve home
automation. This allows users complete use of their automation system from
within their home via a stationary or wireless interface. Remotely controlled
systems use an Internet connection or integration with an existing home security
system to allow the user completes control of their system from their mobiledevice, personal computer, or via telephone from their home security provider.
There are a number of issues involved when designing a home automation
system. Should also provide a user- friendly interface on the host side, so that the
devices can be easily setup, monitored, and controlled. Furthermore the overall
system should be swift enough to realize the true power of wireless technology.
Lastly the system should be cost Effective in order to justify its application in
home Automation. To minimize the shortcomings of each system and to
overcome the design issues previously mentioned, this project integrates locally
and remotely controlled systems with the use of Cloud data network. This allowsthe system to operate without the dependence of a mobile provider, allows the
system to be used with various mobile phone platforms, and allows the system to
operate locally when phone or computer access is not available. Cloud
networking and data infrastructure allow individuals to monitor, manage, and
control their personal data points through the Internet. Each data stream is given
a unique feed identification number to differentiate itself from all other data
Streams on the Network.
Home Automation as a Service (HAaaS)can simplify this scenario by connectingeach sub-system of a home automation system directly to the cloud, and thus
not only reduce the setup and maintenance cost by eliminating the need of
specialized gateway and web server in each household , but also enable HAaaS
providers to deliver advanced automation services to the home automation
-
5/28/2018 Home Automation Using Cloud Computing
5/28
system.Multi-user HAaaS must be necessarily based on the standard cloud
computing model, in which services are made available to the general public over
the Internet as long as they use the specified web application programming
interface (API).Cloud computing refers to the online services provided over the
Internet together with the hardware and software infrastructure of the datacenters that offer those services. The services offered by existent cloud
providers can be broadly categorized as Software as a Service(SaaS), Platform as
a Service (PaaS) and Infrastructure as a Service (IaaS).
To endorse the expediency of HAaaS, we designed and actualized a cloud
connected ad-hoc wireless home automation system as a virtuous case in point
of HAaaS and tested the Quality of Service (QoS) of different sub-systems
working simultaneously. We also devised our own cloud so as to empower the
employment of specialized shared resources and demonstrate the upright
functioning of the entire ecosystem while calling attention to the advantages ofHAaaS over traditional home automation systems
HAaaS refers to the cloud services provided over the Internet together with the
household appliances that are automated through those services. We regard
HAaaS as a development of PaaS, where computer hardware, operating
systems, data storage and network bandwidth are outsourced, while application
and data are managed by the HAaaS provider. HAaaS users are in control of their
automated home appliances and systems by using the cloud services.
-
5/28/2018 Home Automation Using Cloud Computing
6/28
To realize the amalgamation of cloud and home automation, the bridge to link
cloud services with home automation systems needs to be efficient and
effective. The link is essentially the Internet and the following are the two main
approaches to linking:
A. Internet Gateway
Conventionally, smart homes use an Internet gateway to connect to the Internet ,where the Internet gateway is largely a dedicated computer unit which allows
coupled devices to access the Internet. In HAaaS, home automation systems and
appliances may also be connected to the cloud through such an Internet
gateway. Figure shows how different household appliances can be connected to
the cloud by linking to a residential Internet gateway.
B. Internet of Things
The Internet of Things (IoT) refers to distinctively recognizable objects (things)
and their virtual representations in an Internet-like structure . In HAaaS,
individual home automation systems and appliances may be directly connectedto the cloud as distinct objects and as a result avoid protocol conversion
-
5/28/2018 Home Automation Using Cloud Computing
7/28
3.1.1 Project Scope
-
5/28/2018 Home Automation Using Cloud Computing
8/28
As mentioned the proposed home automation system consists of three main
modules, the server, the hardware interface module, and the software
package.As shown in figer. Serial port used by server and hardware interface
module to communicate with each other. User may use the Internet to login to
the server web based application., so remote users can access server web basedapplication through the internet using compatible web browser.
The system is designed keeping in mind the following key requirements:
3.1.2 User Classes and CharacteristicsThe proposed home automation system is designed as a tool for the casual user.
A casual user; shall be defined as one possessing general knowledge of the
Microsoft Windows operating system and general knowledge of using the
Internet by employing a standard browser such as Microsoft Internet
Explorer General user; who will have the most use of the system functionality.
Administrator; who will control the access and permissions policy of the system,
and can add and delete user accounts, anything that a general user can perform,
the administrator can also perform.
3.1.4 Design and Implementation Constraints
The Proposed home automation system is implemented using JSP, HTML and
CSS. The server application is implemented in jsp and java , and the embedded
hardware interface application shall be implemented using C Processing
Language.
Software design concept
Software of the proposed home automation system is divided to server
application software, and Microcontroller (Arduino) firmware.
-
5/28/2018 Home Automation Using Cloud Computing
9/28
The server application software package for the proposed home automation
system, is a web based application built using JSP ,java Netbeans IDE application
software runs on windows OS, requires Glass Fish server, and JVM being
installed. The server application software can be accessed from internal network
or from internet if the server has real IP on the internet using any internetnavigator supports jsp technology. Server application software is responsible of
setup, configuration, maintain the whole home automation system. Server use
database to keep log of home automation system components, we choose to use
XML files to save system log. The Arduino software, built using C language, using
IDE comes with the microcontroller itself. Arduino software is responsible for
collecting events from connected sensors, then apply action to actuators and
pre-programed in the server. Another job is to report the and record the history
in the server DB.
Clients should be able to quickly and seamlessly connect to anddisconnect from the system Change in the status of an appliance should be propagated to all
Clients in real-time.
Customizable time-based profiles to automatically activate andDeactivate appliances based on the time of day
Hardware should be widely compatible with different PCconfigurations.
Server should run in the background without disturbing regularactivities on the desktop PC
Provide a simple and user-friendly interface on the client side.3.1.5 Assumptions and Dependencies
The component of the system will always be connected Each User must have a User ID and password There is only one Administrator. Server must always run under windows system There should be Internet connection available. Proper browsers should be installed Proper Hardware Components are available User is capable of using a computer
-
5/28/2018 Home Automation Using Cloud Computing
10/28
3.3 External Interface Requirement.
3.3.1 User Interfaces
The primary goals of the home automation system user interfaces are
accessibility, universality and reachability.The user interface is comprised of
input and output devices. The input devices shall have the following components:
Touch Screen: The touch screen interface must be unscrachable, fingercontrollable and multi touchable.
Mobile Device: The mobile device interface must be small,attachable,andCompatible across different device
3.3.2 Hardware Interfaces
Basically Home Automation System has a physical USB interface to get data
and actuators to give a physical service. To handle getting data and make a
service, HAM has a main computer called Home servers and to provide an user
interface
Sensors: Smoke, thermal, CO-detector: These sensors detect fire.
Actuators:
Light switch: Based on user location and behavior, light system can besmart.The system turn on/off lights through the light switch.
Alarm: if system detects safety, security or emergency situation thesystem alert it through the audible and visible alarm actuators.
3.3.3 Software Interfaces
The system should use an xml file format for communication with rest of the
home
3.3.4 Communication Interfaces
-
5/28/2018 Home Automation Using Cloud Computing
11/28
The system shall be connected to internet. The system has a connection with an emergency protocol which is conned
to a hospital, police and fire station.
3.6 Analysis Models
DESIGN DIAGRAMS
Data Flow Diagrams:
The mobile device connects to the server PC through through the internet. The
user sends commands to the server from the mobile device. The microcontroller
is connected to the server via USB. On receiving commands from the mobile
device, the server sends commands to the microcontroller over the USB
connection. The microcontroller is directly connected to the relays and it can
-
5/28/2018 Home Automation Using Cloud Computing
12/28
enable or disable them. The relays are connected to the electrical system of the
building so that they can control the plug points.
SEQUENCE DIAGRAMS
-
5/28/2018 Home Automation Using Cloud Computing
13/28
USE CASE DIAGRAMS
The server module receives control commands either from clients or directly
from its own interface. The time-based profiles are configured on the server
interface. It internally checks whether its time to activate a time-based profile. It
propagates the status of the appliances to all connected clients
-
5/28/2018 Home Automation Using Cloud Computing
14/28
The client interface allows the user to control the appliances. It receives statusupdates from the server.
The microcontroller only receives commands from the server via USB
-
5/28/2018 Home Automation Using Cloud Computing
15/28
The component diagram shows all the physical components of the entire
system and how they are interfaced with each other
-
5/28/2018 Home Automation Using Cloud Computing
16/28
3.7 System Implementation Plan
The system is comprised of five different modules in total; three of which
are client modules for different platforms.
Cloud server Embedded Program for Microcontroller, and Hardware Circuit Internet Client for any mobile phones or desktop
-
5/28/2018 Home Automation Using Cloud Computing
17/28
4. System Design:
4.1. System Architecture:
-
5/28/2018 Home Automation Using Cloud Computing
18/28
5. Technical Specification:
This system consists of three independently developed sub systems. Different
technologies were used in developing each sub system. These sub systems are;
Client application. Central Server (Cloud Server)
Home System(communicating with hardware)
Client application:
The main objective of the Client application is providing user the basic interface
to communicate with the home. It provides an illustrative view of the home and
status of equipments and lets the user control them and closely monitor them
with ease. In addition to that it sends alerts when theres a change in the status of
equipments or in the environment being monitored.There were two possible approaches for implementing the Client application.
They are
1. Device based application:As we know that there are many devices available in market with different
platform so develop and client application for every platform is not possible .for
example consider a android and windows base devices so to actually enable or
client to communicate with home automation system application should support
both the platform.2. Web based application: web application can be accessed through any platform
using any browser interface and as we are using cloud server for home
automation web application will help connecting any client from any platform
Central Server (Cloud Server)
The central server is focused in providing services to the other three modules.
Central server acts as the brain and data repository of the system. It provides
three interfaces to the three sub modules; mobile, web configuration tool and
home system. The server analyzes the data it receives from home and sendupdates to the mobile and vice versa. At the same time it takes intelligent
decisions about each system, such as whether theres a failure in the home
system and informs the user. A database is maintained by the server and it is
updated according to the changes in the home. Since this acts as the heart of the
entire system, careful analysis was needed before implementing this system.
-
5/28/2018 Home Automation Using Cloud Computing
19/28
During this analysis it was identified that implementing services on top of an
existing server is
more appropriate and efficient than developing the entire server from the
scratch. Hence when implementing this subsystem, it was necessary to decide on
three major components. They are The database
Server
Scripting language to define services
Communication mechanism between the server and the other components
Several tools and technologies available for the implementation of each
component were carefully analyzed when selecting the most appropriate
methodology. 11 The Glassfish server was selected as the most suitable server
due to several reasons. One major reason is its high reliability and ability to
handle a very large number of simultaneous requests without a failure.And also it is free software thus results in reducing the cost of this system.
MySQL database is selected as the database of this system. Since mysql server is
freely available and its supported with WAMP, it is identified as the most suitable
database for this application. This will result in reducing the cost of system
further while maintaining the quality of the product unharmed. Similarly JSP is
selected as the scripting language and with the use of JSP the services were
defined. Since JSP scripts run very fast and time is a critical factor for a system
like this it is selected over the other scripting languages.
Cloud computing is often defined as a large-scale distributed computingparadigm that is driven by economies of scale (reductions in unit cost as the
magnitude of usage levels increase), in which a pool of abstracted, virtualized,
Dynamically scalable, managed computing power, storage, platforms, and
services are delivered on demand to users or customers, over the Internet .
Classification of cloud services:
1. Software as a Service
SaaS is a software delivery model in which application software are hosted by a
service provider or vendor and made accessible to clients over a network, usually
the Internet.Software as a service is becoming the dominant software distribution model as
core technologies that support web services mature and the use of new
developmental methodologies (like HTML5 and AJAX) become widespread.Correspondingly, expansion of broadband services to more areas facilitates user
access from around the world.
-
5/28/2018 Home Automation Using Cloud Computing
20/28
2.Platform as a Service
PaaS is a method to outsource computer hardware, operating systems, data
storage and network bandwidthover a network, usually the Internet. PaaS
distribution model permits the customer to rent virtualized servers and
accompanying services to run application software or develop and evaluate newapplications.PaaS is an extension of Software as a service, and offers numerous
benefits for developers and designers.
3.Infrastructure as a Service:IaaS is a delivery model in which a business or institute leases the tools used to
undertake certain tasks, including computer hardware, data storage, networking
hardware and network bandwidth. The vendor possesses the equipment and is
responsible for operation and maintenance.
Home System (communicating with hardware):
The home system mainly consists of two parts. Main controller of the home is
one end. This Main controller works between the central server and equipments
which are fixed at the home. Other ends of the home system are a set of
controllers which enable network level access to gadgets and the Main controller.
The main objective of the home system is to provide the user with a convenient
interface to configure the equipments. And also it acts as the communicationbase in users home. This lets the user add or remove equipments to the system
with ease while communicating status changes in home with the central server
and responding to requests send by the central server. Hence this system
facilitates in improving the extensibility of the system. When designing home
system initially there were two options available. They are;
Implementing it as a standaloneapplication
Implementing it as a web application
Security is the major concern of this system and it is very important preserve the
confidentiality of the equipments being added to the system by each user. Thehome system is used during the installation phase of the system and when
communicating the changes of home equipments to the server
thereafter. Therefore it was identified that it is more convenient and secure to
provide a standalone application. This application needs to run in the home
computer and poll the central server at a constant rate. Therefore this system
-
5/28/2018 Home Automation Using Cloud Computing
21/28
should be implemented in a technology which is independent of the platform
running in users home computer. Hence Java was selected as the most suitable
programming language of this system. The home system acts as a mediator
between the server and equipments at home. Thus the home system needs to be
linked to the server as well as the equipments at home. There exists severalpossible media for the communication between the home system and
equipments. Hence it is very important to identify the features of them and select
the most appropriate medium. They can be categorized as wired and wireless
media. Wireless media are discussed in former sections of this chapter. The wired
media are discussed below.
1. Communication via the serial port
In computing, a serial port is a serial communication physical interface through
which information transfers in or out one bit at a time. But in most of the
occasions only one of the equipments can be controlled through this mechanism.This is a major weakness in serial port communication. Another limitation of this
mechanism is the requirement to connect a hardware device to the other end in
orderto synchronizes the communication. This is another drawback in serial port
communication.
2. Communication via the parallel port
This is similar to the serial port but this mechanism does not require additional
hardware for the synchronization of communication because data sent through
these ports are already synchronized. But there is a limitation on the number of
equipments that can be connected to this port. And also the parallel ports cannottolerate uncontrolled inputs. This is another major weakness of this mechanism.
3. Communication via the network
In this mechanism communication is done via the network with the use of
network cables and a switch. This medium is accurate since equipments can be
distinguished with unique ip addresses assigned to them and also it does not
impose any limitation on the number of equipments that can be connected.
Though this mechanism requires wiring of equipments to the home computer
this can be avoided with the use of Ethernet over power (EOP) mechanism.
Power line Ethernet runs over residential power lines using a Carrier SenseMultiple Access with Collision Avoidance (CSMA/CA) protocol to arbitrate the
shared medium; a Physical layer designed for transmission over electrical wiring.
Hence with the use of this mechanism it is possible to avoid wiring of equipments
to the home system.
Device to map controlling signal
-
5/28/2018 Home Automation Using Cloud Computing
22/28
The Arduino Uno is a microcontroller board based on the ATmega328 .
It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an
ICSP header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power itwith a AC-to-DC adapter or battery to get started.The Uno differs from all
preceding boards in that it does not use the FTDI USB-to-serial driver chip.
Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed
as a USB-to-serial converter.
1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two othernew pins placed near to the RESET pin, the IOREF that allow the shields to adapt
to the voltage provided from the board. In future, shields will be compatible withboth the board that uses the AVR, which operates with 5V and with the Arduino
Due that operates with 3.3V. The second one is a not connected pin, that is
reserved for future purposes.
Stronger RESET circuit. Atmega 16U2 replace the 8U2.
-
5/28/2018 Home Automation Using Cloud Computing
23/28
"Uno" means one in Italian and is named to mark the upcoming release of
Arduino 1.0. The Uno and version 1.0 will be the reference versions of Arduino,
moving forward.
Summary:
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage
(recommended)7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory32 KB (ATmega328) of which 0.5 KB used by
bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
-
5/28/2018 Home Automation Using Cloud Computing
24/28
Power
The Arduino Uno can be powered via the USB connection or with an external
power supply. The power source is selected automatically.External (non-USB)
power can come either from an AC-to-DC adapter (wall-wart) or battery. The
adapter can be connected by plugging a 2.1mm center-positive plug into the
board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less
than 7V, however, the 5V pin may supply less than five volts and the board may
be unstable. If using more than 12V, the voltage regulator may overheat anddamage the board. The recommended range is 7 to 12 volts.
The power pins are as follows:
VIN.The input voltage to the Arduino board when it's using an external powersource (as opposed to 5 volts from the USB connection or other regulated power
-
5/28/2018 Home Automation Using Cloud Computing
25/28
source). You can supply voltage through this pin, or, if supplying voltage via the
power jack, access it through this pin.
5V.This pin outputs a regulated 5V from the regulator on the board. The boardcan be supplied with power either from the DC power jack (7 - 12V), the USB
connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5Vor 3.3V pins bypasses the regulator, and can damage your board. We don't advise
it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum currentdraw is 50 mA.
GND.Ground pins. IOREF.This pin on the Arduino board provides the voltage reference with which
the microcontroller operates. A properly configured shield can read the IOREF
pin voltage and select the appropriate power source or enable voltage translators
on the outputs for working with the 5V or 3.3V.
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB
of SRAM and 1 KB of EEPROM (which can be read and written with theEEPROM
library).
Input and Output
Each of the 14 digital pins on the Uno can be used as an input or output,
usingpinMode(),digitalWrite(), anddigitalRead()functions. They operate at 5volts. Each pin can provide or receive a maximum of 40 mA and has an internal
pull-up resistor (disconnected by default) of 20-50 kOhms. In addition, some pins
have specialized functions:
Serial: 0 (RX) and 1 (TX).Used to receive (RX) and transmit (TX) TTL serial data.These pins are connected to the corresponding pins of the ATmega8U2 USB-to-
TTL Serial chip.
External Interrupts: 2 and 3.These pins can be configured to trigger an interrupton a low value, a rising or falling edge, or a change in value. SeetheattachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11.Provide 8-bit PWM output withtheanalogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).These pins support SPIcommunication using theSPI library.
http://www.arduino.cc/en/Reference/EEPROMhttp://www.arduino.cc/en/Reference/EEPROMhttp://arduino.cc/en/Reference/PinModehttp://arduino.cc/en/Reference/DigitalWritehttp://arduino.cc/en/Reference/DigitalReadhttp://arduino.cc/en/Reference/AttachInterrupthttp://arduino.cc/en/Reference/AnalogWritehttp://arduino.cc/en/Reference/SPIhttp://arduino.cc/en/Reference/SPIhttp://arduino.cc/en/Reference/AnalogWritehttp://arduino.cc/en/Reference/AttachInterrupthttp://arduino.cc/en/Reference/DigitalReadhttp://arduino.cc/en/Reference/DigitalWritehttp://arduino.cc/en/Reference/PinModehttp://www.arduino.cc/en/Reference/EEPROMhttp://www.arduino.cc/en/Reference/EEPROM -
5/28/2018 Home Automation Using Cloud Computing
26/28
LED: 13.There is a built-in LED connected to digital pin 13. When the pin is HIGHvalue, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10
bits of resolution (i.e. 1024 different values). By default they measure fromground to 5 volts, though is it possible to change the upper end of their range
using the AREF pin and theanalogReference() function. Additionally, some pins
have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using theWire library
There are a couple of other pins on the board:
AREF.Reference voltage for the analog inputs. Used withanalogReference(). Reset.Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.
See also themapping between Arduino pins and ATmega328 ports.The mapping
for the Atmega8, 168, and 328 is identical.
Communication
The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL(5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX).
An ATmega16U2 on the board channels this serial communication over USB and
appears as a virtual com port to software on the computer. The '16U2 firmware
uses the standard USB COM drivers, and no external driver is needed.
However, on Windows, a .inf file is required. The Arduino software includes a
serial monitor which allows simple textual data to be sent to and from the
Arduino board. The RX and TX LEDs on the board will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the computer (but
not for serial communication on pins 0 and 1).ASoftwareSerial library allows for serial communication on any of the Uno's
digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus; see
thedocumentation for details. For SPI communication, use theSPI library.
http://arduino.cc/en/Reference/AnalogReferencehttp://arduino.cc/en/Reference/AnalogReferencehttp://arduino.cc/en/Hacking/PinMapping168http://arduino.cc/en/Guide/Windows#toc4http://www.arduino.cc/en/Reference/SoftwareSerialhttp://arduino.cc/en/Reference/Wirehttp://arduino.cc/en/Reference/SPIhttp://arduino.cc/en/Reference/SPIhttp://arduino.cc/en/Reference/Wirehttp://www.arduino.cc/en/Reference/SoftwareSerialhttp://arduino.cc/en/Guide/Windows#toc4http://arduino.cc/en/Hacking/PinMapping168http://arduino.cc/en/Reference/AnalogReferencehttp://arduino.cc/en/Reference/AnalogReference -
5/28/2018 Home Automation Using Cloud Computing
27/28
Programming
The Arduino Uno can be programmed with the Arduino software (download).
Select "Arduino Uno from the Tools > Boardmenu (according to the
microcontroller on your board). For details, see thereference andtutorials.
The ATmega328 on the Arduino Uno comes preburned with abootloader thatallows you to upload new code to it without the use of an external hardware
programmer. It communicates using the original STK500 protocol (reference,C
header files).
You can also bypass the bootloader and program the microcontroller through the
ICSP (In-Circuit Serial Programming) header; seethese instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available . The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be
activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near themap of Italy) and then resetting the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line toground, making it easier to put into DFU mode.
You can then useAtmel's FLIP software (Windows) or theDFU programmer (Mac
OS X and Linux) to load a new firmware. Or you can use the ISP header with an
external programmer (overwriting the DFU bootloader). Seethis user-
contributed tutorial for more information.
Automatic (Software) Reset
Rather than requiring a physical press of the reset button before an upload, the
Arduino Uno is designed in a way that allows it to be reset by software running on
a connected computer. One of the hardware flow control lines (DTR) of
theATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100
nanofarad capacitor. When this line is asserted (taken low), the reset line drops
long enough to reset the chip. The Arduino software uses this capability to allow
you to upload code by simply pressing the upload button in the Arduinoenvironment. This means that the bootloader can have a shorter timeout, as the
lowering of DTR can be well-coordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either a
computer running Mac OS X or Linux, it resets each time a connection is made to
it from software (via USB). For the following half-second or so, the bootloader is
running on the Uno. While it is programmed to ignore malformed data (i.e.
http://arduino.cc/en/Main/Softwarehttp://arduino.cc/en/Reference/HomePagehttp://arduino.cc/en/Tutorial/HomePagehttp://arduino.cc/en/Tutorial/Bootloaderhttp://www.atmel.com/dyn/resources/prod_documents/doc2525.pdfhttp://www.atmel.com/dyn/resources/prod_documents/avr061.ziphttp://www.atmel.com/dyn/resources/prod_documents/avr061.ziphttp://arduino.cc/en/Hacking/Programmerhttp://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886http://dfu-programmer.sourceforge.net/http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285962838http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285962838http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285962838http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285962838http://dfu-programmer.sourceforge.net/http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886http://arduino.cc/en/Hacking/Programmerhttp://www.atmel.com/dyn/resources/prod_documents/avr061.ziphttp://www.atmel.com/dyn/resources/prod_documents/avr061.ziphttp://www.atmel.com/dyn/resources/prod_documents/doc2525.pdfhttp://arduino.cc/en/Tutorial/Bootloaderhttp://arduino.cc/en/Tutorial/HomePagehttp://arduino.cc/en/Reference/HomePagehttp://arduino.cc/en/Main/Software -
5/28/2018 Home Automation Using Cloud Computing
28/28
anything besides an upload of new code), it will intercept the first few bytes of
data sent to the board after a connection is opened. If a sketch running on the
board receives one-time configuration or other data when it first starts, make
sure that the software with which it communicates waits a second after opening
the connection and before sending this data.The Uno contains a trace that can be cut to disable the auto-reset. The pads on
either side of the trace can be soldered together to re-enable it. It's labeled
"RESET-EN". You may also be able to disable the auto-reset by connecting a 110
ohm resistor from 5V to the reset line; seethis forum thread for details.
USB Over current Protection
The Arduino Uno has a resettable polyfuse that protects your computer's USB
ports from shorts and overcurrent. Although most computers provide their own
internal protection, the fuse provides an extra layer of protection. If more than500 mA is applied to the USB port, the fuse will automatically break the
connection until the short or overload is removed.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1213719666/allhttp://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1213719666/all