66
CERTIFICATE This is to certify that project work titled ‘’HOME AUTOMATION SYSTEM”, that is being submitted by Anuj Gupta (10BEC0298) is in partial fulfillment of the requirements for the award of Bachelors of Technology (Electronics and communication Engineering), is a record of bonafide work done under my guidance. The contents of this project work, in full or in parts, neither been taken from any other source nor have been submitted to any other institute or University for award of any degree or diploma and the same is certified. GUIDE (Prof Gerardine Immaculate Mary)

home automation report.doc

Embed Size (px)

Citation preview

Page 1: home automation report.doc

CERTIFICATE

This is to certify that project work titled ‘’HOME AUTOMATION SYSTEM”,

that is being submitted by Anuj Gupta (10BEC0298) is in partial fulfillment of the

requirements for the award of Bachelors of Technology (Electronics and

communication Engineering), is a record of bonafide work done under my

guidance. The contents of this project work, in full or in parts, neither been taken

from any other source nor have been submitted to any other institute or University for

award of any degree or diploma and the same is certified.

GUIDE

(Prof Gerardine Immaculate Mary)

The thesis is satisfactory / unsatisfactory

Internal Examiner External Examiner

Approved by

Program Chair

Page 2: home automation report.doc

ABSTRACT

This project involves the design and construction of an individual control home

automation system using a microcontroller. Home automation is the automatic or

semi-automatic control and monitoring of household appliances and residential house

features like doors, gate and even the windows even monitor temperature and light.

This project is a demonstration of how to design and build a multipurpose remotely

controlled system that can switch OFF and ON any electrical household appliance

(including the security light), controls a relay for the automatic switching on and off

of the appliance. The results of this project show that a microcontroller is a very

powerful device for building smart electronic devices that can automatically control

electrical appliances, with little circuitry complexities and components.

Page 3: home automation report.doc

ACKNOWLEDGEMENT

I express my sincere gratitude and indebtedness to the project guide Professor

Gerardine Immaculate Mary, for her initiative in this field of research, for her

valuable guidance, encouragement and affection for the successful completion of this

work. Her sincere sympathies and kind attitude always encouraged us to carry out the

present work firmly. We express our thankfulness to Dr. Arulmozhivarman, Program

chair of Electronics and Communication Engineering ,VIT University, Vellore

for providing us with best facilities in the Department and their valuable guidance in

our project and all our friends and well-wishers who were involved directly or

indirectly in successful completion of the present work

Place: Vellore

Date: ANUJ GUPTA (10BEC0298)

Page 4: home automation report.doc

CONTENTS

Chapter Page

CERTIFICATION...................................................................................i

ABSTRACT..............................................................................................ii

ACKNOWLEDGEMENT.....................................................................iii

CHAPTER ONE....................................................................................................1INTRODUCTION.................................................................................................1AUTOMATION.....................................................................................................3OFFICE AUTOMATION......................................................................................4 BUILDING AUTOMATION…….............................................................................................4 POWER AUTOMATION.....................................................................................5 HOME AUTOMATION.......................................................................................6 PROJECT AIM......................................................................................................6 PROJECT OBJECTIVE.........................................................................................7 PROJECT SCOPE AND LIMITATION................................................................7 PROJECT JUSTIFICATION.................................................................................7 REPORT LAYOUT...............................................................................................8

CHAPTER TWO.....................................................................................................9LITERATURE REVIEW.........................................................................................9HISTORY OF HOME AUTOMATION..................................................................9HOME AUTOMATION SYSTEMS........................................................................9HOME AUTOMATION STANDARDS.................................................................10INSTEON STANDARDS........................................................................................12EUROPEAN HOME SYSTEMS (EHS) PROTOCOL............................................14ZIGBEE STRANDADS...........................................................................................14HOME AUTOMATION IMPLEMENTATION PLATOFORM……..……..……17VON-NEUMANN ARCHITECTURE....................................................................17HARVARD ARCHITECTURE...............................................................................18

CHAPTER THREE..................................................................................................20METHODOLOGY .................................................................................................20

Page 5: home automation report.doc

PRELIMINARY CONSIDERATIONS...............................................................................................20SELECTION OF HARDWARE COMPONENT....................................................20SYSTEM DESIGN..................................................................................................22ATMEGA8 BLOCK DIAGRAM............................................................................25CENTRAL PORCESSING UNIT (CPU)...............................................................26RANDOM ACCESS MEMORY (RAM)................................................................26READ ONLY MEMORY (ROM)...........................................................................27INPUT AND OUTPORT PORTS (I/O)..................................................................27

CHAPTER FOUR....................................................................................................34DESIGN AND IMPLEMENTATION....................................................................34

CHAPTER FIVE....................................................................................................41CONCLUSION …………………………………...................................................41

Page 6: home automation report.doc

LIST OF FIGURES

Block diagram of the project ………………………………………………………...22

Atmega8 Architecture…………………………………………….…………………25

Atmega8 Pin Diagram……………………………………………………………… 28

Software figure……………………………………………..……….………………..39

Pin Diagram of Operational Amplifier……………….………………………………30

Intensity Vs Resistivity in LDR …………………………..………..………………..32

Power Supply…..……………………………………………….……………………33

Circuit Diagram ………………………………………………………...……………34

Power Supply Circuit……………...….……………………………….……………..35

Temperature sensor……………………………………………………..……………36

LDR circuit diagram…………….……………………………………………………37

IR circuit diagram……...……………………………………………………………..38

Page 7: home automation report.doc

CHAPTER 1

INTRODUCTION

Imagine how helpful it will be to be able to switch on your air

conditioning system ten minutes before you get home on a hot afternoon

in January. How about having a security system that will detect smoke,

excessive electrical power usage, burglar attempts and unauthorized

movements in your house and alert you? This is what home automation is

about and there is no end to its application. In fact, sophisticated home

automation systems are now being developed that can maintain an

inventory of household items, record their usage through an RFID (Radio

Frequency Identification) tag, and prepare a shopping list or

automatically order replacements. Home automation has made it

possible to have what is often referred to as a 'smart home', a home that

can detect and identify you, automatically adjust the lighting to your

predefined taste, open doors automatically, play your favourite music,

water your flowers in the morning, switch on the security lights at night

and switch them off in the morning, heat water for bathe and tea, stream

to you anywhere in the world via the internet a live video of what is

happening in and around your house. It makes it possible to link lighting

Page 8: home automation report.doc

1

entertainment, security, telecommunications, heating, and air

conditioning into one centrally controlled system. This allows you to

make your house an active partner in managing your busy life.

Nowadays, you can hardly find a house without a home automation

System which can range from the remote for the television, burglar alarm

and hi-tech security gates, to an automated air conditioning system that

maintains the temperature at a predefined value.

Page 9: home automation report.doc

2AUTOMATION

Automation is the use of control systems and information technology to

control equipment, industrial machinery and processes, reducing the need

for human intervention. In the scope of industrialization, automation is a

step beyond mechanization. Mechanization provided human operators

with machinery to assist them with the physical requirements of work

while automation greatly reduces the need for human sensory and mental

requirements as well. Automation plays an increasingly important role in

the global economy and in daily experience. Engineers strive to combine

automated devices with mathematical and organizational tools to create

complex systems for a rapidly expanding range of applications and

human activities. Many roles for humans in industrial processes presently

lie beyond the scope of automation. Human-level pattern recognition,

language recognition, and language production ability are well

beyond the capabilities of modern mechanical and computer systems.

Tasks requiring subjective assessment or synthesis of complex sensory

data, such as scents and sounds, as well as high-level tasks such as strategic planning,

currently require human expertise. Automation has had a notable impact in a wide

range of highly visible industries beyond manufacturing. Once ubiquitous telephone

operators have been replaced largely by automated telephone switchboards and

Page 10: home automation report.doc

3answering machines . Medical processes such as primary screening in

electrocardiograph or Radiography and laboratory analysis of human

genes, blood plasmas, cells, and tissues are carried out at much greater

speed and accuracy by automated systems. Automated teller machines

have reduced the need for bank visits to obtain cash and carry out

transactions. In general, automation has been responsible for the shift in

the world economy from agrarian to industrial in the 19th century and

from industrial to services in the 20th century.

OFFICE AUTOMATION

Office automation refers to the varied computer machinery and software

used to digitally create, collect, store, manipulate, and relay office

information needed for accomplishing basic tasks and goals. Raw data

storage, electronic transfer, and the management of electronic business

information comprise the basic activities of an office automation system,

office automation helps in optimizing or automating existing office

procedures.

BUILDING AUTOMATION

Building automation describes the functionality provided by the control

of a building. The control system is a computerized, intelligent network

of electronic devices, designed to monitor and control the mechanical and

lighting systems of a building. A building automation system is an

example of a distributed control system.

Page 11: home automation report.doc

4

The building automation system

(BAS) core functionality keeps the building climate within a specific

range, provides lighting based on an occupancy schedule, and monitors

system performance and device failures and provides email and/or text

notifications to building engineering staff. The BAS functionality reduces

building energy and maintenance costs when compared to a non-

controlled building.

POWER AUTOMATION

Power automation is the automated control and monitoring of power

plants, substations and transformers for effectiveness, efficiency and fault

detection. It has made it possible to have a reliable municipal or national

electricity system, which often comprises remote and hard-to-reach

transformers and power sub-system units. It makes it possible to monitor

different power units, relay their status and health information, and even

carry out fault detection and correction without human interference.

Example of power automation system is the Supervisory Control and

Data Acquisition (SCADA) system.

Page 12: home automation report.doc

5HOME AUTOMATION

Home automation may designate an emerging practice of increased

automation of household appliances and features in residential dwellings,

particularly through electronic means that allow for things impracticable,

overly expensive or simply not possible in recent decades. Home

automation includes all that a building automation provides like climate

controls, door and window controls, and in addition control of multimedia

home theatres, pet feeding, plant watering and so on. But there

exists a difference in that home automation emphasizes more on comforts

through ergonomics and ease of operation.

Page 13: home automation report.doc

6PROJECT AIM

The aim of this project is to design and construct a home automation

4system that will automatically switch on or off any household appliance

connected to it, using a microcontroller.

PROJECT OBJECTIVE

The objective of this project is to implement a low cost, reliable and

scalable home automation system that can be used to remotely switch on

or off any household appliance, using a microcontroller to achieve

hardware simplicity.

PROJECT SCOPE AND LIMITATION

This project work is complete on its own in automatically

switching on and off of any electrical appliance not limited to household

appliances, and sends a feedback message indicating the new present

state of the appliance. It does not implement control of multiple

appliances or automatic detection of faults in the controlled appliance.

PROJECT JUSTIFICATION

This project is of contributory knowledge to the development and

implementation of home automation systems in Nigeria using low cost,

locally available components like microcontroller

Page 14: home automation report.doc

7REPORT LAYOUT

The entire project is composed of five chapters, each covering a section of the work as summarized below:

• Chapter one gives an introduction to automation as a whole and thedifferent types of automation.

• Chapter two covers an extensive literature review of previous works onhome automation systems, the different established standards andprotocols, and the platforms over which home automation can beimplemented.

• Chapter three highlights the project methodology, giving reasons for choiceof specific platforms and components, and also, comprehensive details onboth hardware components and communication services used.

• Chapter four is on the project design and implementation with clearpractical details of the project design, construction, testing, microcontroller coding and debugging. Special emphasis is also made on the flexibility andscalability of the project work with real life illustration.

• Chapter five is on the conclusion based on theproject work with emphasis on the reliability, maintainability andflexibility of the design.

Page 15: home automation report.doc

8CHAPTER 2

LITERATURE REVIEW

HISTORY OF HOME AUTOMATION

Home automation has been around since the world war 1 (1914), in fact,

the television remote (a simple home automation system) was patented in

1893 (Wikipedia, 2009). Since then different home automation systems

have evolved with a sharp rise after the second World War. It's growth

has been through various informal research and designs by technology

enthusiasts who want a better way of getting things done at home without

much effort on their part. The systems evolved from one that can

automatically do routine chores like switch on and off security lights, to

more sophisticated ones that can adjust lighting, put the television

channel to favorite station and control doors.

HOME AUTOMATION SYSTEMS

Home automation systems may designate electronic systems in homes

and residential buildings that make possible the automation of household

appliances. The new stream of home automation systems has developed

into a vast one and the current market is flooded with a flurry of home

automation systems and device manufacturers.

The types of home automation systems based on their control systems

Are:

Page 16: home automation report.doc

9INDIVIDUAL CONTROL SYSTEMS

These types were the first to hit the market in the early years, here

each device like the heater or the air conditioner will have an

independent control dedicated to it

DISTRIBUTED CONTROL SYSTEMS

The main feature of these type of systems is emergency shut-down.

With this system you can preset or change the control parameters of

several similar devices, for example, the thermostat of several air

conditioners and their ON/OFF timings.

CENTRAL CONTROL SYSTEMS

These are computerized systems programmed to handle all functions

of multiple utilities like air conditioning system, home entertainments,

doors, windows, refrigerators and cooking systems, all at the same

time regardless of whether you are at home or away. You can connect

to the control system through telephone or internet from anywhere in

the world. The types of home automation systems based on the carrier

mode are:

1. POWER LINE CARRIER SYSTEMS

The least expensive type of home automation system operates over the

home's existing wiring, or power line carrier. These can range from

X10- based lamp timers, to more sophisticated systems that require installation by

a trained professional.

Page 17: home automation report.doc

10WIRELESS SYSTEMS

Also available are wireless home automation systems that utilize

radiofrequency technology. They are often used to operate lights,

sometimes in conjunction with a hardwired lighting control system.

Wired, or “hardwired” home control systems are the most reliable and

expensive. These systems can operate over high-grade

communications cable, or their own

proprietary “bus” cable. That is why it is best to plan for them when a

house is being constructed. Hardwired systems can perform more

tasks at a time and do them quickly and reliably, making them ideal

for larger homes. They can also integrate more systems

in the home, effectively tying together indoor and outdoor lighting,

audio and video equipment, security system, even the heating and

cooling system into one control package that will be easy and intuitive

to operate.

INTERNET PROTOCOL CONTROL SYSTEMS

Internet Protocol (IP) control automation system uses the internet,

gives each device under its control an Internet Protocol address, and

creates a local area network (LAN) in the home. Hence, the home can

be interacted with over the internet with possibility of live video streaming and

real-time control

Page 18: home automation report.doc

11HOME AUTOMATION STANDARDS

There are many established industry standards for home automation

systems and are implemented over the various carrier modes ranging

from power line to wireless. The popular and major standards are

INSTEON, European Home Systems (EHS), ZigBee, KNX, Z-Wave,

X10, Lon Works, ONE-NET and Universal Power line Bus (UPB).

INSTEON STRANDARD

INSTEON standard is a dual-band mesh topology employing ac-

Power lines and a radio frequency (RF) protocol to communicate with

and automate home electronic devices and appliances, which normally work

independently.

It is a home automation networking technology invented by SmartLabs

Inc. INSTEON was developed, based on the X10 model, for control and

sensing applications in the home. INSTEON is designed to enable simple

devices to be networked.

Page 19: home automation report.doc

12

Together using the powerline and/or radio frequency (RF). All INSTEON

devices are peers, meaning each device can transmit, receive, and repeat

any message of the INSTEON protocol, without requiring a master

controller or complex routing software. INSTEON is not only an effective

system for connecting lighting switches and loads without extra wiring,

but it also forms the basis for a more sophisticated home automation

network.

The following are the possible applications of INSTEON:

• Scene and remote control lighting

Security alarm interfaces and sensors,

• Home sensors (e.g. water, humidity, temperature),

• Access control (e.g. door locks),

• Heating, ventilating and air cooling (HVAC) control,

• Audio-video control, and

• Appliance management.

Page 20: home automation report.doc

13

EUROPEAN HOME SYSTEMS (EHS) PROTOCOLS

The European home systems (EHS) protocol was aimed at home

appliances control and communication using power line

communication (PLC). Developed by EHSA (European Home Systems

Association) it was merged with two V W R G4other protocols to form

the KNX protocol, which complies with CENELEC norm EN 50090

standard and had a chance to be a basis for the first open standard for

home and building control (Wikipedia, 2009).

The areas of application of EHS are:

• Heating, ventilating and air cooling (HVAC) control,

• Scene and remote control lighting, and

• Appliance management.

ZIGBEE STRANDARDS

ZigBee is a specification for a suite of high level communication

protocols using small, low-power digital radios based on the IEEE

802.15.4 - 2003 standard for wireless personal area networks (WPANs),

such as wireless headphones connecting with cell phones via short-range

radio. The technology defined by the ZigBee specification is intended to

be simpler and less expensive than other WPANs such as Bluetooth. ZigBee is

targeted at radio frequency (RF) applications that require a low data rate, long battery

life, and secure networking (Wikipedia, 2009). ZigBee is a low-cost, low-power,

wireless mesh networking standard.

Page 21: home automation report.doc

14

The low cost allows the technology to be widely deployed in wireless

control and monitoring applications, the low power-usage allows longer

life with smaller batteries, and the mesh networking provides high

reliability and larger range.

ZigBee operates in the industrial, scientific and medical (ISM) radio

bands; 868 MHz in Europe, 915 MHz in the USA and Australia, and

2.4 GHz in most jurisdictions worldwide. ZigBee chip vendors typically

sell integrated radios and microcontrollers with between 60K and 128K

flash memory, such as the Freescale MC13213, the EmberEM250 and the

Texas Instruments CC2430. Radios are also available as stand-alone to

be used with any processor or microcontroller. Generally,

he chip vendors also offer the ZigBee software stack, although

independent ones are also available. The ZigBee Alliance is a group of companies that

maintain and publish the ZigBee standard.

Page 22: home automation report.doc

15

• Home Entertainment and Control — Smart lighting, advancedtemperature control, safety and security, movies and music,

• Home Awareness — Water sensors, power sensors, smoke and firedetectors, smart appliances and access sensors,

• Mobile Services — m-payment, m-monitoring and control, securityand access control, m-healthcare and tele-assist,

• Commercial Building — Energy monitoring, HVAC, lighting,access control, and

• Industrial Plant — Process control, asset management,environmental management, energy management, industrial devicecontrol.

16

Page 23: home automation report.doc

HOME AUTOMATION IMPLEMENTATION PLATFORMS

Home automation can be implemented over a number of platforms

namely, microcontroller, power supply , infrared circuit, light

dependent resistor, Temperature sensor. The microcontroller has two

general architecture types that define its mode of operation and design.

VON-NEUMANN ARCHITECTURE

This architecture has a single, common memory space where both

Program instructions and data are stored. There is a single data bus which

fetches both instructions and data. And each time the CPU fetches a

program instruction it may have to perform one or more read/write

operations to data memory space. It must wait until these subsequent

operations are complete before it can fetch and decode the next program

instruction. The advantage to this architecture lies in its

simplicity and economy. On some Von Neumann machines the program

can read from and write to CPU registers, including the program counter. This

can be dangerous as you can point the processor to memory blocks

outside program memory space and careless processor manipulation

can cause errors which require a hard reset.

Page 24: home automation report.doc

17

HARVARD ARCHITECTURE

This Architecture implements separate memory areas for program

instructions and data. There are two or more internal data buses which

allow simultaneous access to both instructions and data. The CPU

fetches instructions on the program memory bus. If the fetched

instruction requires an operation on data memory, the CPU can fetch

the next program instruction while it uses the data bus for its data

operation. This speeds up execution time at the cost of more hardware complexity. Most modern microcontrollers have the harvard

architecture.

Page 25: home automation report.doc

18POWER SUPPLY

Power supply system actually Convert 9 volt to constant 5 volt.

It is basically apply on the 7805 IC is a 3 pin voltage regulator. The Input voltage from 7volt to 25volt. Using 2 capacitor for fast charging and discharging.

INFRARED SENSOR

It actually detect the object which will come across it. It is a 3 pin

module connected to 5volt, ground , and output pin, we use this in

many application burglar alarm , object detection and itc

TEMPERATURE SENSOR

it is also a 3 pin device module operated between 2.7 volt to 5.5 volt.

First pin is connected to 5 volt and second to ground and third one to

Output data, third one pin will give the digital value.

Page 26: home automation report.doc

19

CHAPTER 3

METHODOLOGY

In designing a home automation system, one or more suitable

platforms are used in order to build a reliable and flexible system that

can be easily operated and adapted for a new household appliance.

Therefore, for the purpose of this project some specific deliberate

choices were made on the type of platforms, hardware components

and mode of operation of the home automation system.

PRELIMINARY CONSIDERATIONS

Before the actual design of the project work, specific deliberate choices in

selection of appropriate implementation platforms and hardware

components were made. Priority was given to low cost availability,

reliability, flexibility and simplicity in all these selections.

SELECTION OF HARDWARE COMPONENTS

There are many platforms over which a home automation system can be

Implemented.

Hardware are following as- 7805 IC , Leds, IR led,photodiode,capacitors,358

opamp operational amplifier,ATMEGA8 microcontroller by

ATMEL,LDR(light dependent resistor),temperature sensor

Page 27: home automation report.doc

(LM35),infrared module, Power supply I use in our project work .

20

SYSTEM DESIGN

Her instead of using 8051 we are using ATMEL’s atmega8 microcontroller.

here

Page 28: home automation report.doc

Instead of Using relay device we are using led for prototyping.

21

ATMEGA8 MICROCONTROLLER

8-bit Atmel with 8KBytes In-System

Programmable Flash

The Atmel®AVR® core combines a rich instruction set with 32 general purpose

working registers. All the 32 registers are directly connected to the Arithmetic Logic

Unit (ALU), allowing two independent registers to be accessed in one single

instruction executed in one clock cycle. The resulting architecture is more code

efficient while achieving throughputs up to ten times faster than conventional CISC

microcontrollers .The ATmega8 provides the following features: 8 Kbytes of In-

System Programmable Flash with Read-While-Write capabilities, 512 bytes of

EEPROM, 1 Kbyte of SRAM, 23 general purpose I/O lines, 32 general purpose

working registers, three flexible Timer/Counters with compare modes, internal and

external interrupts, a serial programmable USART, a byte oriented Two wire Serial

Interface, a 6-channel ADC (eight channels in TQFP and QFN/MLF packages) with

10-bit accuracy, a programmable Watchdog Timer with Internal Oscillator, an SPI

serial port, and five software selectable power saving modes. The Idle mode stops the

CPU while allowing the SRAM, Timer/Counters, SPI port, and interrupt system to

continue functioning. The Power down mode saves the register contents but freezes

the Oscillator, disabling all other chip functions until the next Interrupt or Hardware

Reset. In Power-save mode, the asynchronous timer continues to run, allowing the

user to maintain a timer base while the rest of the device is sleeping. The ADC Noise

Reduction mode stops the CPU and all I/O modules except asynchronous timer and

ADC, to minimize switching noise during ADC conversions. In Standby mode, the

Page 29: home automation report.doc

22

The ADC Noise Reduction mode stops the CPU and all I/O modules except

asynchronous timer and ADC, to minimize switching noise during ADC conversions.

In Standby mode, the crystal/resonator Oscillator is running while the rest of the

device is sleeping. This allows very fast start-up combined with low-power

consumption .The device is manufactured using Atmel’s high density non-volatile

memory technology. The Flash Program memory can be reprogrammed In-System

through an SPI serial interface, by a conventional non-volatile memory programmer,

or by an On-chip boot program running on the AVR core. The boot program can use

any interface to download the application program in the Application Flash memory.

Software in the Boot Flash Section will continue to run while the Application Flash

Section is updated, providing true Read-While-Write operation. By combining an 8-

bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the

Atmel ATmega8 is a powerful microcontroller that provides a highly-flexible and

cost-effective solution to many embedded control applications. The ATmega8 is

supported with a full suite of program and system development tools, including C

compilers, macro assemblers, program simulators, and evaluation kits.

Page 30: home automation report.doc

23

Page 31: home automation report.doc

24

CENTRAL PROCESSING UNIT (CPU)

The CPU is responsible for all the computing, it fetches, decodes and

executes program instructions and directs the flow of data to and from

memory. It performs the calculations required by program instructions

and places the results of these calculations, if required, into memory

space. Most CPUs are synchronous, meaning that they depend on the

cycles of a processor clock, this clock generates a high-frequency square

wave usually driven by a crystal, a RC (resistor capacitor) or an external

source. The clock is sometimes referred to as an oscillator. The clock

speed, or oscillation rate, is measured in megahertz (MHz) which

represents one million cycles/second.

RANDOM ACCESS MEMORY (RAM)

The RAM, random access memory, is used to write and read data values

as a program runs. RAM is volatile meaning that if the power supply to

the microcontroller is removed, its contents are lost. All variables used in

a program are allocated from the RAM. The time to retrieve information

from RAM does not depend upon the location of the information because

RAM is not sequential, hence the term random access. Most small PIC

microcontrollers provide very little RAM which forces you to write

applications that use RAM wisely. Manipulating large data

structures and using pointers, re-entrant or recursive functions use large

Page 32: home automation report.doc

25amounts of RAM and are techniques which are generally avoided on

microcontrollers.

READ ONLY MEMORY (ROM)

The ROM, read only memory, is non-volatile memory used for program

information and permanent data. The microcontroller uses ROM memory

space to store program instructions it will execute when it is started or

reset. Program instructions must besaved in non-volatile memory so that they are not

affected by loss of power, the microcontroller usually cannot write data to program

memory space.

INPUT AND OUTPUT PORT (I/O)

Without some means of getting information and signals in and out, the

microcontroller will have little or no use. Hence, the input and output

ports are used to pass data in and out of the microcontroller in a

controlled manner, often according to a standard protocol. The PIC

microcontroller ports are of two types namely, serial and

parallel ports. They can operate in two main modes namely, synchronous

and asynchronous modes. The parallel I/O ports require a data line for

each bit in a byte, while the serial I/O uses a single data line for all the

bits in the data stream by transferring the bits in sequence. The synchronous mode involves synchronizing the data transfer with a clock

while the asynchronous mode does not. PIC microcontrollers most often

have parallel I/O capability built in and the serial I/O as a peripheral

feature.

Page 33: home automation report.doc

26PIN DIAGRAM

8 channel implies that there are 8 ADC pins

10 bit resolution implies that there are 2^10 = 1024 steps

8K Bytes InSystem

Programmable Flash

27

Page 34: home automation report.doc

ATMEGA8 PROGRAMMING

I use

1. Avr studio 4.0 2. Avr dude for hex file upload in microcontroller 3. Programming is done in simple c language.

28

Page 35: home automation report.doc

LM358 OPAMP CHIP

These devices consist of two independent, high-gain frequency-compensated

operational amplifiers designed to operate from a single supply over a wide

range of voltages. Operation from split supplies also is possible if the

difference between the two supplies is 3 V to 32 V (3 V to 26 V for the

LM2904), and VCC is at least 1.5 V more positive than the input common-

mode voltage. The low supply-current drain is independent of the magnitude

of the supply voltage.

Applications include transducer amplifiers, dc amplification blocks, and all the

conventional operational amplifier circuits that now can be implemented more

easily in single-supply-voltage systems. For example, these devices can be

operated directly from the standard 5-V supply used in digital systems and

easily can provide the required interface electronics without additional ±5-V

supplies.

29

Page 36: home automation report.doc

TEMPERATURE SENSOR

The LM35 is an integrated circuit sensor that can be used to measure temperature with

an electrical output proportional to the temperature (in oC)

It has an output voltage that is proportional to the Celsius temperature.

The scale factor is .01V/oC

The LM35 does not require any external calibration or trimming and maintains an accuracy of  +/-0.4 oC at room temperature and +/- 0.8 oC over a range of 0 oC to +100 oC.

Another important characteristic of the LM35DZ is that it draws only 60 micro amps from its supply and possesses a low self-heating capability. The sensor self-heating causes less than 0.1 oC temperature rise in still air.

LIGHT DEPENDENT RESISTOR

Light dependent resistor (LDR) Whenever the light falls on the LDR,

the Resistivity of the LDR become low.

1.Light intensity increases resistivity Decreases and vice-versa

2.One end of the LDR is connected with ADC0 pin no. 23 and another to

the ground. And one 1 K ohm R1 from input LDR pin side to ground.

Page 37: home automation report.doc

30

INTENSITY Vs RESISTIVITY IN LDR

Page 38: home automation report.doc

31POWER SUPPLY

Power supply system actually Convert 9 volt to constant 5 volt.

It is basically apply on the 7805 IC is a 3 pin voltage regulator. The Input voltage from 7volt to 25volt. Using 2 capacitor for fast charging and discharging.

Page 39: home automation report.doc

32

CHAPTER 4

DESIGN AND IMPLEMENTATIONThe design of this project involved coupling several hardware components.

CIRCUIT DIAGRAM

Page 40: home automation report.doc

33

POWER SUPPLY CIRCUIT

Convert 9 volt to constant 5 volt.

1. 7805 IC is a 3 pin voltage regulator.

Page 41: home automation report.doc

2. Input voltage from 7volt to 25volt.

3. Using 2 capacitor for fast charging and discharging.

34TEMPERATURE SENSOR

Page 42: home automation report.doc

1.Operated between 2.7 to 5.5 volt on first pin.

2.Second pin Analog voltage output Connected to the ADC1 pin No. 24

of atmega8 uc.

3. Third pin to Ground.

It converts the analog value obtained from the environment into digital

values. The output LED starts glow which is on pin no. 14 of the

microcontroller when the temperature between 25 to 29 degree Celsius,

its like in summer if temperature is in between the respective

temperatures fan will goes on itself if temperature is less than that

parameter or high , fan will not work.

35LDR CIRCUIT DIAGRAM

Light dependent resistor (LDR)

Page 43: home automation report.doc

When ever the light falls on the LDR, the Resistivity of the LDR

become low.

1.Light intensity increases resistivity Decreases and vice-versa

2.One end of the LDR is connected with ADC0 pin no. 23 and another to

the ground. And one 1 kohm R1 from input LDR pin side to ground.

IR CIRCUIT DAGRAM

1.IR LED is connected in Forward bias And Grounded with 1kohm(R3) resistor.

2. Photodiode is in Reverse bias.

3.In operational Amplifier ,positive terminal is connected between

photodiode positive terminal and 10 kohm resistor(R2) which is grounded

4.Output which is on pin number 1 of op-amp connected to the ADC5

28th pin of atmega8 uc.

5. Pin number 4 is grounded

6. Pin number 8 is in 5 volt.

7. because of sensitivity we make photodiode in the reverse bias.

36

Page 44: home automation report.doc

37

Page 45: home automation report.doc

PROGRAMMING IN MICROCONTROLLER - PROGRAM

#include <avr/io.h> #include <avr/interrupt.h>

#include<util/delay.h>#include"lcd.h"#include"lcd.c"#define F_CPU 1000000ULchar buffer[5];char ligh[5];char incom[5];int ReadADC(uint8_t ch){//Select ADC Channel ch must be 0-7ch=ch&0b00000111;ADMUX|=ch;//Start Single conversionADCSRA |= (1<<ADSC);//Wait for conversion to completewhile(!(ADCSRA&(1<<ADIF))); //ADC Interrupt Flag-//Clear ADIF by writing one to it//Note you may be wondering why we have write one to clear it//his is standard way of clearing bits in io as said in datasheets.//The code writes '1' but it result in setting bit to '0' !!!

ADCSRA|=(1<<ADIF);

return(ADC);

void main(){lcd_init(LCD_DISP_ON);lcd_clrscr();lcd_puts("tem:");initADC();int k,t,m,n;int x,s;//int left_sensor=0, right_sensor=0;DDRB = 0xFF;while(1){initADC();lcd_gotoxy(0,0)

38

Page 46: home automation report.doc

lcd_puts("tem:");lcd_gotoxy(4,0);x=ReadADC(1);t=(int)(1000.0*5.0*(((float)x)/1023.0));k=(int)t/10;sprintf(buffer,"%4d",k);lcd_puts(buffer);if(k>=24&&k<29)PORTB=0b00000001;initADC();lcd_gotoxy(0,1);lcd_puts("lig:");lcd_gotoxy(4,1);s=ReadADC(0);m=(int)(1000.0*5.0*(((float)s)/1023.0));n=(int)m/100;sprintf(ligh,"%4d",n);lcd_puts(ligh);if(n>=0&&n<30)PORTB=0b00000010;elsePORTB=0b00000000;initADC();lcd_gotoxy(9,0);lcd_puts("IR:");lcd_gotoxy(11,0);int u=ReadADC(5);int v=(int)(1000.0*5.0*(((float)u)/1023.0));int w=(int)v/100;sprintf(incom,"%4d",w);lcd_puts(incom);if(w>=20&&w<=40)PORTB=0b00000100;

elsePORTB=0b00000000;

39

Page 47: home automation report.doc

CHAPTER 5

CONCLUSION

It is evident from this project work that an individual control homeautomation system can be cheaply made from low-cost locally available components and can be used to control multifarious home appliances ranging from the securitylamps, the air conditioning system and even the entire house lighting system. And better still, the components required are so small and few that they can be packaged into a small inconspicuous container.

The designed home automation system was tested a number of times andcertified to control different home appliances used in the lighting system, air conditioning system, heating system, home entertainment system and many more

Finally, this home automation system can be also implemented overBluetooth, Infrared and WAP connectivity without much change to the design and yet still be able to control a variety of home appliances. Hence, this system is scalable and flexible.

REFERENCES

http://en.wikipedia.org/wiki/Home_automation http://www.atmel.com/devices/atmega8.aspx http://www.ijarcsse.com/docs/papers/Volume_3/4_April2013/V3I4-0192.pdf http://www.ijarcce.com/upload/2013/july/32-o-sweatha%20swamy%20-

advance%20home%20automation%20using%20fpga.pd http://www.enggjournals.com/ijet/docs/IJET13-05-02-176.pdf

40