Sie sind auf Seite 1von 51

MAJOR PROJECT REPORT

ON
IOT BASED HOME
AUTOMATION SYSTEM
SUBMITTED TO

SUBMITTED BY

DR.BALJIT SINGH KHEHRA

KAMANPREET SINGH (1302173)


KAMALPREET SINGH (1302171)
KARANJIT SINGH (1302174)
HARMANPREET SINGH(1302157)

CHAPTER ONE
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,
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
2

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.

PROJECT DESCRIPTION
The main aim of the project is to control multiple electrical loads
remotely over internet falling under the basic principles of Internet of
Things-IOT. For this realtime scenario we can develop a webpage with
user configurable front end (GUI).The data sent from the webpage upon
buttons are sent through allotted IP fed to it, to IOT module which is
then received by a GPRS module interfaced to a Microcontroller of
ATmega8 series. Relays are then driven as per the command received at
the controller end to handle electrical loads.
The real time data is also seen at the sending
end upon a LCD display interfaced to the microcontroller that displays
the status of the loads too.The power supply consists of a step down
transformer 230/12V, which steps down the voltage to 12V AC. This is
converted to DC using a Bridge rectifier and it is then regulated to +5V
using a voltage regulator 7805 which is required for the operation of the
microcontroller.
Basic idea of Home automation using Telnet is conceived from router
configuration. As we use a remote terminal to access router instead of
console to configure it, we have used the same way to control our
controller instead of router to control our Home Appliances. The
controller atmega8 which is programmed such as that when it receives

the command through Telnet it processes on it and turns ON or OFF the


appliance as per command receive.
Telnet server is used for interfacing. Server
connects controller with telnet remote PC through serial port i.e. DB9
and connects controller with remote pc through internet medium i.e. TCP/IP.

Diagram:-

Representation Diagram:-

About Project:-Home automation system, or smart home


technologies, are system and devices that can control element of
your home environment-lighting, appliances, telephones, home
security and mechanical, entry and safety system.
Home automation system can be operated
by electricity or a computer chip using a range of different types
of switches. A single device that can be activated by signal from
Motion detector, or can be part of computerized home
automation system. As a part of very basic definition, we tends
to home automation as anything that gives your remote of your
automatic things around the home.

Pin Diagram:-

Advantage of home automation system:1. Adding Convenience to your Daily Life


When you convert your home into a smart home, youll have all of your products
programmed to your specific needs. Additionally being able to control your home,
no matter where you are, can be extremely beneficial.
2. Customization
There are many smart products on the market right now and you certainly dont
need to buy all of them at once. As the consumer its up to you to decide which
product you want most, determine if you like it, and then add on to your collection
of smart home products as you go.
A good product to start with would be a thermostat or home security system if
youre in the market for either of those.
6

3. Security
Smart home security systems allow you to view your home no matter where you
are. You can have cameras installed, motion detectors, locks, etc., and you will be
notified immediately if something is out of the ordinary. Many of these systems
will even let you know of any unexpected temperature changes so that youre
alerted if there is a possible fire.
4. Ease of Use
Almost all smart home products can be installed without much hassle, many of
them dont even require you to bring someone into your home. Additionally if
youre already someone whos tech savvy, learning how to use most of these
products is a breeze.
5. Save Money and the Environment
Smart homes feature products like thermostats, air conditioners, and lighting.
Having the ability to put these things on a timer, or turn them on and off when
youre away from home will likely help you save money on your electricity bills.
Many of these products allow you to track your energy usage and expenditures.

Disadvantage of home automation system:1. Cost


Most families are able to purchase smart home products, but that doesnt
mean it wont leave a dent in your wallet. You can purchase the products
one at a time and it wont seem like too much, $50 here, $300 there, but
by the time you have the smart home system you want, you will likely
have spent a larger sum than you would have if you had purchased nonsmart products.
2. Slight Learning Curve
7

I know I stated in the advantages that most smart home systems are
actually very easy to use, but at the same time there is still somewhat of
a learning curve for most people. For anyone already immersed in
technology, converting your smart home will be a breeze, but for anyone
not so tech savvy, it may make for a lot of time spent reading manuals.
If you think you might have trouble learning how
to use a smart home device, the answer may be simple. Ask for help!
Asking someone to show you how to run your smart home can far less
confusing than trying to make heads or tails of an instruction manual.
Reliability A smart home will be extremely reliant on your internet
connection. If your connection drops youll be left with a lot of smart
products that wont work. Additionally, wireless signals can possibly be
interrupted by other electronics in your home and cause some of your
smart products to function slowly or not at all.

PROJECT SCOPE:This project work is complete on its own in remotely and 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.

Home 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 ease of operation.

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, low cost short message service (SMS) for feedback
and voice dial from any phone to toggle the switch state.

CHAPTER TWO
LITERATURE REVIEW

2.1 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 Since then different home
automation systems have evolved with a sharp rise after
9

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.

2.2 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:
1. Individual 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.
2. Distributed Control Systems
The main feature of these type of systems is emergency
shut-down. With
10

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.
3. 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.

HARDWARE COMPONENT
1. Regulated Power Supply
Power supplies are designed to convert high voltage AC mains to a suitable low
voltage supply for electronic circuits and other devices. In our project the various
electronic modules are being used for which power supply requirement is +5V DC.
The Microcontroller unit needs a pure regulated +5V DC.A power supply can be
broken down into a series of blocks, each of which performs a particular function.
For example a 5V regulated supply:

11

Each of the blocks has its own function as described below:


1. Transformer steps down high voltage AC mains to low voltage AC.
The Step down transformer of 12-0-12, 750mA will be used in our
project.
2. Rectifier converts AC to DC, but the DC output is varying. The
ripple factor of Bridge rectifier is than the other rectifier circuits. So here
in our
Project we will use bridge rectifier to convert the AC into DC.
3. Smoothing smoothes the DC from varying greatly to a small ripple.
A
Electrolytic capacitor of 1000uF/50V will be used as a filter/smoothing
Circuit to get pure DC.
4. Regulator eliminates ripple by setting DC output to a fixed voltage.
There are two types of regulator series. First is positive voltage regulator
series (78XX) and second is negative voltage regulator series (79XX). In
our project we need positive voltage (+5V) so we will use 7805 to regulate
the Voltage.

Display Unit (Liquid Crystal Display)


Display unit used in our project will be Liquid crystal display (LCD)
which makes our project user friendly by displaying everything on the
display. Liquid crystal displays (LCD) are widely used in recent years as
compared to LEDs or seven segment displays. Because LCD can be
used to display alphanumeric as well as special characters (like * @ ! #
% & etc.). Also due to the declining prices of LCD, the ability to display
numbers, characters and graphics, incorporation of a refreshing
12

controller into the LCD, there by relieving the CPU of the task of
refreshing the LCD and also the ease of programming for characters and
graphics. HD 44780 based LCDs are most commonly used.
The LCD, which is used as a display in our project,
is LMB162A. The main features of this LCD are: 16 X 2 display,
intelligent LCD, used for alphanumeric characters & based on ASCII
codes. This LCD contains 16 pins, in which 8 pins are used as 8-bit data
I/O, which are extended ASCII. Three pins are used as control lines
these are Read/Write pin, Enable pin and Register select pin. Two pins
are used for Backlight and LCD voltage, another two pins are for
Backlight & LCD ground and one pin is used for contrast change.
It can display 32 characters at a time on the
display. There are two rows (lines) and 16 characters can be displayed in
each line. And it will be used in 8 bit mode i.e. its 8-bit data bus will be
used to transfer the data codes from MCU to LCD. Below is the picture
of our LCD:

Liquid crystal displays (LCD) are widely used in recent years as


compares to LEDs. This is due to the declining prices of LCD, the
ability to display numbers, characters and graphics, incorporation of a
refreshing controller into the LCD, their by relieving the CPU of the task
of refreshing the LCD and also the ease of programming for characters
and graphics. HD 44780 based LCDs are most commonly used. The
LCD, which is used as a display in the system, is LMB162A. The main
13

features of this LCD are: 16 X 2 display, intelligent LCD, used for


alphanumeric characters & based on ASCII codes. This LCD contains 16
pins, in which 8 pins are used as 8-bit data I/O, which are extended
ASCII. Three pins are used as control lines these are Read/Write pin,
Enable pin and Register select pin. Two pins are used for Backlight and
LCD voltage, another two pins are for Backlight & LCD ground and one
pin is used for contrast change.

LCD pin description

14

RS (register select)
There are two important registers inside the LCD. The RS pin is used for
their selection as follows. If RS=0, the instruction command code
register is selected, then allowing to user to send a command such as
clear display, cursor at home etc.. If RS=1, the data register is selected,
allowing the user to send data to be displayed on the LCD.

R/W (read/write)
The R/W (read/write) input allowing the user to write information from
it. R/W=1, when it read and R/W=0, when it writing.

EN (enable)
The enable pin is used by the LCD to latch information presented to its
data pins. When data is supplied to data pins, a high power, a high-tolow pulse must be applied to this pin in order to for the LCD to latch in
the data presented at the data pins.
15

D0-D7 (data lines)


The 8-bit data pins, D0-D7, are used to send information to the LCD or
read the contents of the LCDs internal registers. To displays the letters
and numbers, we send ASCII codes for the letters A-Z, a-z, and numbers
0-9 to these pins while
making RS =1. There are also command codes that can be sent to clear
the display or force the cursor to the home position or blink the cursor.
We also use RS =0 to check the busy flag bit to see if the LCD is ready
to receive the information. The busy flag is D7 and can be read when
R/W =1 and RS =0, as follows: if R/W =1 and RS =0, when D7 =1(busy
flag =1), the LCD is busy taking
care of internal operations and will not accept any information. When
D7 =0, the LCD is ready to receive new information.

Relay Driver using Opto coupler (Auto Electro Switching)


Relay is an electrically operated switch.
An Auto Electro Switching/Relay Driver circuit comprises of an opt
coupler which will isolate the controller from the outer spikes or
fluctuations or from the external hardware and at the same time it drives
a power transistor i.e. make it on when a signal from the controller pin is
applied to it. Opt coupler actually comprises of a diode and a
phototransistor. It comes in a DIP IC package. Thus signal from the
MCU is given to the LED part or the driving part. When LED begins to
glow then the phototransistor acts as on switch or short circuit. This
output is given to power transistor, which will Amplify the current of the
signal and then can be used to drive a relay. The I/P signal is connected
to the Relays common terminal and the O/P can be taken from the
16

relays NO terminal. When relay is ON then NO is connected to the


common terminal of the relay.

Relays allow one circuit to switch a second circuit which can be


completely separate from the first. For example a low voltage battery
circuit can use a relay to switch a 230V AC mains circuit. There is no
electrical connection inside the relay between the two circuits; the link is
magnetic and mechanical.

The coil of a relay passes a relatively large current, typically 30mA for a
12V
Relay, but it can be as much as 100mA for relays designed to operate
from lower voltages. Most ICs (chips) cannot provide this current and a
17

transistor is usually used to amplify the small IC current to the larger


value required for the relay coil. The maximum output current for the
popular 555 timer IC is 200mA so these devices can supply relay coils
directly without amplification.
The following designations are commonly encountered:

SPST - Single Pole Single Throw. These have two terminals which can
be connected or disconnected. Including two for the coil, such a relay
has four terminals in total. It is ambiguous whether the pole is normally
open or normally closed. The terminology "SPNO" and "SPNC" is
sometimes used to resolve the ambiguity.

SPDT Single Pole Double Throw. A common terminal connects to


either of two others. Including two for the coil, such a relay has five
terminals in total.

DPST Double Pole Single Throw. These have two pairs of terminals.
Equivalent to two SPST switches or relays actuated by a single coil.
Including two for the coil, such a relay has six terminals in total. The
poles may be Form A or Form B (or one of each).
18

DPDT Double Pole Double Throw. These have two rows of changeover terminals. Equivalent to two SPDT switches or relays actuated by a
single coil. Such a relay has eight terminals, including the coil.

Choosing a relay
You need to consider several features when choosing a relay:

Physical size and pin arrangement


If you are choosing a relay for an existing PCB you will need to ensure
that its dimensions and pin arrangement are suitable. You should find
this information in the supplier's catalogue.

Coil voltage
The relay's coil voltage rating and resistance must suit the circuit
powering the relay coil. Many relays have a coil rated for a 12V supply
but 5V and 24V relays are also readily available. Some relays operate
perfectly well with a supply voltage which is a little lower than their
rated value.

Coil resistance
The circuit must be able to supply the current required by the relay coil.
You can use Ohm's law to calculate the current:
Relay coil current = supply voltage coil resistance
For example: A 12V supply relay with a coil resistance of 400 passes a
19

Current of 30mA. This is OK for a 555 timer IC (maximum output


current 200mA), but it is too much for most ICs and they will require a
transistor to amplify the current.

Switch ratings (voltage and current)


The relay's switch contacts must be suitable for the circuit they are to
Control. You will need to check the voltage and current ratings. Note
that the voltage rating is usually higher for AC, for example: "5A at 24V
DC or 125V AC".

Switch contact arrangement (SPDT, DPDT etc)


Most relays are SPDT or DPDT which are often described as "single
pole changeover" (SPCO) or "double pole changeover" (DPCO).

Microcontroller
A microcontroller has a CPU (a microprocessor) in addition to the fixed
amount of RAM, ROM, I/O ports, and timers are all embedded together
on the chip: therefore, the designer cannot add any external memory,
I/O, or timer to it. Microcontroller Unit is the heart of our project. It
controls all the major activities of our project. The Microcontroller unit
used in our project is based on AVR family.

Microcontroller ATmega8
20

The ATmega8 microcontrollers are manufactured by ATMEL. The


ATmega8 is a low-power CMOS 8-bit microcontroller based on the AVR
RISC architecture. By executing powerful instructions in a single clock
cycle, the ATmega8 achieves throughputs approaching 1 MIPS per MHz,
allowing the system designed to optimize power consumption versus
processing speed.

In our project we will use ATmega8.


This microcontroller is a 28-pin device and is one of the popular
microcontrollers used in complex applications. The device offers 8192
8K Bytes of In-System Self programmable Flash program , 1K Byte
Internal SRAM, 512 Bytes EEPROM, 23 Programmable I/O Pins Two
8-bit Timer/Counters with Separate Prescaler, one compare circuit, and
internal and external interrupt facilities.

Regulated Power Supply


Transformer
Transformers convert AC electricity from one voltage to another with
little loss of power. Transformers work only with AC and this is one of
the reasons why mains electricity is AC. The two types of transformers
Step-up transformers increase voltage,
Step-down transformers reduce voltage.
21

Most power supplies use a step-down transformer to reduce the


dangerously high mains voltage (230V in UK) to a safer low voltage.
The input coil is called the primary and the output coil is called the
secondary. There is no electrical connection between the two coils,
instead they are linked by an alternating magnetic field created in the
soft-iron core of the transformer. The two lines in the middle of the
circuit symbol represent the core. Transformers waste very little power
so the power out is (almost) equal to the power in. Note that as voltage is
stepped down current is stepped up. The ratio of the number of turns on
each coil, called the turn ratio, determines the ratio of the
voltages. A step-down transformer has a large number of turns on its
primary (input) coil which is connected to the high voltage mains
supply, and a small number of turns on its secondary (output) coil to
give a low output voltage.
Turns Ratio =/=/
And Power Out = Power In
Vs *Is = Vp *Ip
Where
Vp = primary (input) voltage
Np = number of turns on primary coil
Ip = primary (input) current
Ns = number of turns on secondary coil
22

Is = secondary (output) current


Vs = secondary (output) voltage

Bridge Rectifier
A bridge rectifier can be made using four individual diodes, but it is also
available in special packages containing the four diodes required. It is
called a full-wave rectifier because it uses all AC wave (both positive
and negative sections). 1.4V is used up in the bridge rectifier because
each diode uses 0.7V when conducting and there are always two diodes
conducting, as shown in the diagram below.
Bridge rectifiers are rated by the maximum current
they can pass and the maximum reverse voltage they can withstand (this
must be at least three times the supply RMS voltage so the rectifier can
withstand the peak voltges). In this alternate pairs of diodes conduct,
changing over the connections so the alternating directions of AC are
converted to the one direction of DC.
Diagram:-

23

SMOOTHING
Smoothing is performed by a large value electrolytic capacitor
connected across the DC supply to act as a reservoir, supplying current
to the output when the varying DC voltage from the rectifier is falling.
The diagram shows the unsmoothed varying DC (dotted line) and the
smoothed DC (solid line). The capacitor charges quickly near the peak
of the varying DC, and then discharges as it supplies current to the
output. Note that smoothing significantly increases the average DC
voltage to almost the peak value (1.4 RMS value). For example 6V
RMS AC is rectified to full wave DC of about 4.6V RMS (1.4V is lost in
the bridge rectifier), with smoothing this increases to almost the peak
value giving 1.4 4.6 = 6.4V smooth DC. Smoothing is not perfect due
to the capacitor voltage falling a little as it discharges,

24

Giving a small ripple voltage. For many circuits a ripple which is 10%
of the supply voltage is satisfactory and the equation below gives the
required value for the smoothing capacitor. A larger capacitor will give
fewer ripples. The capacitor
Value must be doubled when smoothing half-wave DC.
Smoothing capacitor for 10% ripple, C = 5 Io
Vs f
Where
C = smoothing capacitance in farads (F)
Io = output current from the supply in amps (A)
Vs = supply voltage in volts (V), this is the peak value of the
unsmoothed DC
f = frequency of the AC supply in hertz (Hz), 50Hz in the UK.

REGULATOR

25

Voltage regulator ICs are available with fixed (typically 5, 12 and 15V)
or variable output voltages. They are also rated by the maximum current
they can pass. Negative voltage regulators are available, mainly for use
in dual supplies. Most regulators include some automatic protection
from excessive current (overload protection') and overheating (thermal
protection'). Many of the fixed voltage regulator ICs has 3 leads and
look like power transistors, such as the 7805 +5V 1A regulator shown on
the right. They include a hole for attaching a heat sink if necessary.

Working of Power Supply


Transformer

The low voltage AC output is suitable for lamps, heaters and special AC
motors. It is not suitable for electronic circuits unless they include a
rectifier and a smoothing capacitor.

Transformer + Rectifier

26

The varying DC output is suitable for lamps, heaters and standard


motors. It is not suitable for electronic circuits unless they include a
smoothing capacitor.

Transformer + Rectifier + Smoothing

The smooth DC output has a small ripple. It is suitable for most


electronic circuits

Transformer + Rectifier + Smoothing + Regulator

The regulated DC output is very smooth with no ripple. It is suitable for


all electronic circuits.

27

Light Emitting Diodes


When you need to add light to a model, an ordinary filament lamp is the
first thing that springs to mind. But if you dont need a high light output,
or you need light as an indicator, an LED has many advantages over a
lamp. LEDS are basically the single light display that include
incandescent and are treated as single binary points to be switched on
and off by programmer instructions. The individual light display
is easy to use. A port presents a bit or a character and then strobe the
device. Like a normal diode, an LED consists of a chip of
semiconducting material impregnated, or doped, with impurities to
create a p-n junction.
As in other diodes, current flows easily from the pside, or anode, to the n-side, or cathode, but not in the reverse direction.
Charge-carrierselectrons and holesflow into the junction from
electrodes with different voltages. When an electron meets a hole, it
a lower energy level, and releases energy in the form of a photon. The
wavelength of the light emitted, and therefore its color, depends on the
band gap energy of the materials forming the p-n junction. In silicon or
germanium diodes, the electrons and holes recombine by a nonradioactive transition which produces no optical emission, because these
are indirect band gap materials.
LED Symbol

Connecting and soldering

28

LEDs must be connected the correct way round, the diagram may be
labeled a or + for anode and k or - for cathode (yes, it really is k, not c,
for cathode!). The cathode is the short lead and there may be a slight flat
on the body of round LEDs. If you can see inside the LED the cathode is
the larger electrode (but this is not an official identification method).

LEDs can be damaged by heat when soldering, but the risk is small
unless you are very slow. No special precautions are needed for
soldering most LEDs.

Advantages of LEDs
Shapes and Sizes
LEDs are available in many shapes and sizes, some of which are shown
in the selection below. The 'standard' LED shape is the 5mm diameter
domed type, and the smaller 3mm domed type is also popular.
1. Tri-LED array
2. 10 segment bar displays
3. Domed LED sizes 3, 5, 8, 10mm
4. Panel mounting LED.
5. PCB mounting LED
6. 26mm red & green LED cluster

29

Colors:
LEDs have traditionally been red, orange, yellow, or green, but advances
in LED technology mean that blue and white LEDs are now available,
though at a much higher price. These LEDs are considerably brighter
than standard LEDs so they could be used for lighting, but you will find
the ones described as 'white' still have a blue tinge.

The table below shows typical technical data for some 5mm diameter
round LEDswith diffused packages (plastic bodies). Only three columns
are important and these are shown in bold. Please see below for
explanations of the explanation.
IF max
Maximum forward current, forward just means with the LED connected
correctly.
F typ
Typical forward voltage VL in the LED resistor calculation.
This is about 2V, except for blue and white LEDs for which it is about
4V.
VF max
30

Maximum forward voltage.


VRmax
Maximum reverse voltage .
You can ignore this for LEDs connected the correct way round.

Also available are LEDs described as 'bi-color' and 'tri-color'. Bi-color


LEDs typically incorporate one red and one green LED in the same
package. Since they have only two leads, only one LED can be on at any
31

time. Tri-color LEDs also have two LEDs in one package, but because
they have three leads, both LEDs can be switched on together, their light
combining to make a third color, typically orange. The central lead of
such a package is the common for both LEDs. Some
Manufacturers produce true 'tri-color' LEDs incorporating red, green,
and blue LEDs, so in theory it is possible to create light of any color.
The physical color of an LED package does not necessarily indicate the
color it will be when switched on. Some LEDs have a clear plastic
package, while others may have a diffused plastic package.

LED ON I/O PORTS


Since TTL an output is designed to feed multiple TTL inputs, they are
good at current sinking but poor at current sourcing. The Standard TTL
can sink up to 16mA and source 250uA. The LS logic family can sink
8mA and source 100uA.
The 8051 port pin can sink 1.6mA (3.2mA for port 0)
and source 60uA. Therefore, if you drive significant current, try to
arrange your circuits to use current sinking. Unlike diodes, Lightemitting diodes have a forward voltage drop from 1.7 to 2.5 volts and
most of them flow a forward current 20mA.

Poor circuit
Since the TTL output can't source above 1mA so the LED will be very
dim.

Fair circuit

32

The LED will conduct heavily at about 2V and the extra 3V has to be
dropped in the TTL circuitry. This causes high power dissipation in the
TTL or the LED fails.

Good circuit
The resistor limits the current. The resistance can be calculated by
assuming its voltage is about 2.5V and the TTL output is 0.9V. For 2.2V
LED, 1.9V is across the resistor so the 220ohm would limit the current
to 8.6mA (1.9/220). For 1.7V LED, 2.4V is across the resistor so it
would limit the current to 10.9mA (2.4/220). The resistor should not less
than 100ohm or the LED would fail

Interfacing of LED with 8051 Microcontroller


For interfacing a single Led to 89c51 microcontroller, we connect the
anode (+) end of LED to the designated port pin via a pull-up resistor.
While the cathode end of LED is connected to GND. Connection of 1
LED to 89c51 port pins. For glowing a LED, a high logic is required at
the anode (+), so port pin is set to high for glowing LED. One end of
single LED is connected to port pin of 89c51 via a pull up resistor and
other one is grounded.
33

Microcontrollers are used in


automatically controlled products and devices, such as
automobile engine control systems, remote controls,
office machines, appliances, power tools and toys. Hence,
microcontrollers due not function in isolation, they accept
input from one or more devices and provide output to
other devices within a given system. In fact, they are
responsible for the intelligence in most smart devices in
the consumer market.

Pin Diagram

34

Transistor
A transistor is a semiconductor device used to amplify and switch
electronic signals and power. It is composed of a semiconductor material
with at least three terminals for connection to an external circuit. A
voltage or current applied to one pair of the transistor's terminals
changes the current flowing through another pair of terminals. Because
the controlled (output) power can be higher than the controlling (input)
power, a transistor can amplify a signal.

35

Transistor as a Current Amplifier


A PNP transistor can be used as a current amplifier for driving the relay.
Since approx. 500-1000mA current can be passed from emitter to
collector in PNP transistor with a little base current (approx. 1-2mA).

Here a circuit shows interfacing of relay with PNP transistor. Here Vin
signal is given to transistor from microcontroller or other low current
digital devices. By using this driver circuit a relay can be derived from
microcontroller, but has a drawback i.e. whenever the relay gets off a
back spike is generated in the base of transistor which can harm the
controller or other digital devices. This problem can be solved by using
an optocoupler between controller and transistor's base as shown:

Power Transistor (BC 369)


High current gain
High collector current
Low collector-emitter saturation voltage
Complementary type: BC 368 (NPN)
36

CHAPTER TWO
SOFTWARE COMPONENT
IOT is basically a module design to remotely access the devices through
web server and cloud computing. There are mainly three server site
scripting languages used now-a-days i.e. JSP, ASP, PHP. We preferred to
use PHP because it is an open source scripting language, runs on various
platforms (Windows, Linux, Unix, Mac OS X, etc.), compatible with
almost all servers used today (Apache, IIS, etc.), supports a wide range
of databases, runs efficiently on the server side. There are basically two
ways in which we can manage our data i.e. in structured way or in
unstructured way.
Structured data is often managed using Structured
Query Language (SQL) a programming language created for managing
and querying data in relational database management systems.
Unstructured data is all those things that can't be so readily classified
and fit into a neat box: photos and graphic images, videos, streaming
instrument data, Webpages, PDF files, PowerPoint presentations, emails,
blog entries, wikis and word processing documents.
We uses MYSQL database for storing our data in a managed way.
IOT is mainly consists of two technologies i.e. Telemetry and
Teleremote.

Telemetry
It is the automated communications process by which measurements are
made and other data collected at remote or inaccessible points and

37

transmitted to receiving equipment for monitoring. Telemetry is a


concept in which device hit the URL and pass their current values
into the query string variable and that values are stored into the database
using PHP script and for that values respective graphs and tabular forms
are generated for the user.

Teleremote
is a concept in which user remotely operate/ manage the devices. Their
current state of the device is send to the server using PHP script. User
can access those devices through a PHP form and change the current
state of the particular device.

38

Software used to Create a webpage of the project:The main software is to create a webpage and linking with server is

XAMPP
is a free and open source cross-platform web server solution
stack package developed by Apache Friends, consisting mainly of
the Apache HTTP Server, MariaDB database, and interpreters for scripts
written in the PHP and Perl programming languages. XAMPP stands for
Cross-Platform (X), Apache (A), Maria DB (M), PHP (P) and Perl (P). It
is a simple, lightweight Apache distribution that makes it extremely easy
for developers to create a local web server for testing and deployment
purposes. Everything needed to set up a web server server application
(Apache), database (Maria DB), and scripting language (PHP) is
included in an extractable file. XAMPP is also cross-platform, which
means it works equally well on Linux, Mac and Windows. Since most
39

actual web server deployments use the same components as XAMPP, it


makes transitioning from a local test server to a live server extremely
easy as well.

Apache server to Run or execute the code of software part


Apache is developed and maintained by an open community of
developers under the auspices of the Apache Software Foundation. Most
commonly used on a Unix-like system (usually Linux), the software is
available for a variety of operating systems besides Unix,
including Microsoft Windows. Version 2.0 improved support for nonUnix, e.g. Windows and OS/2 (and eComStation).Old versions of
Apache were ported to run on e.g. OpenVMS,[9] and NetWare. Released
under the Apache License, Apache is free and open-source software.

Text editor used to write the source code


Notepad
Notepad is a simple text editor for Microsoft Windows and a basic textediting program which enables computer users to create documents. It
was first released as a mouse-based DOS program in 1983, and has been
included in all versions of Microsoft Windows since Windows 1.0 in
1985.

40

Notepad++
Notepad++ is a text editor and source code editor for use with Microsoft
Windows. Unlike Microsoft Notepad, the built-in Windows text editor, it
supports tabbed editing, which allows working with multiple open files
in a single window. The project's name comes from the Increment.
Notepad++ is distributed as free software. At first
the project was hosted on SourceForge.net, from where it has been
downloaded over 28 million times, and twice won the Source Forge
Community Choice Award for Best Developer Tool.[5] The project was
hosted on Tux Family (fr) from 2010 to 2015; since 2015 Notepad++
has been hosted on GitHub. Notepad++ uses the Scintilla editor
component.

41

Adobe Dreamweaver
Adobe Dreamweaver is a proprietary web development tool developed
by Adobe Systems. Dreamweaver was created by Macromedia in
1997, and was maintained by them until Macromedia was acquired by
Adobe Systems in 2005.
Adobe Dreamweaver is available for macOS and for Windows.
Following Adobe's acquisition of the Macromedia product
suite, releases of Dreamweaver subsequent to version 8.0 have been
more compliant with W3C standards.
Recent versions have improved support for Web technologies such
as CSS, JavaScript, and various server-side Scripting
languages and frameworks including ASP (ASP JavaScript, ASP
VBScript, ASP.NET C#, ASP.NET VB), ColdFusion, Scriptlet, and PHP.

42

MySQL (Connectivity to the database)


is an open-source relational database management system (RDBMS). Its
name is a combination of "My", the name of co-founder Michael
Widenius' daughter, and "SQL", the abbreviation for Structured Query
Language. The MySQL development project has made its source
codeavailable under the terms of the GNU General Public License, as
well as under a variety of proprietary agreements. MySQL was owned
and sponsored by a single for-profit firm, the Swedish company MySQL
AB, now owned by Oracle Corporation. For proprietary use, several paid
editions are available, and offer additional functionality.

MySQL is a central component of the LAMP open-source web


application software stack (and other "AMP" stacks). LAMP is an
acronym for "Linux, Apache, MySQL, Perl/PHP/Python". Applications
that use the MySQL database include: TYPO3,

43

Wamp server only for window to run or exeute a source code


of software part
WampServer refers to a software stack for the Microsoft Window
operating system, created by Romain Bourdon and consisting of
the Apache web server, OpenSSL for SSL support, MySQL database
and PHP programming language.

Source Code:?php
ob_start();
include_once("conndb.php");
44

$string = "";
$par_mode = "";
$par_num = "";
if(isset($_GET['kid']) && isset($_GET['par'])){
$kit_id = $_GET['kid'];
$para = explode("_",$_GET['par']);
$total_para = sizeof($para);
if($total_para > 2){
for($i=0 ; $i < $total_para ; $i++){
// echo "<br>";
if(!empty($para[$i])){
$val = $para[$i];
if($i == 1){
$par_mode = $val[0].$val[1];
$par_num = $val[2];
}else{
$par_num = $par_num.",".$val[0];
}
}
}
}
else{
45

foreach($para as $val){
if(!empty($val)){
$par_mode = $val[0];
$par_num = $val[1];
}
}
}
if($par_mode == 'r'){
$query = "select * from device_telemonitoring
where kit_id=$kit_id order by dtm_id DESC";
$result = mysql_query($query);
if(mysql_num_rows($result)){
$fetch = mysql_fetch_array($result);
$string = $par_num.$fetch['device'.
$par_num]."_".$fetch['entry_date']."_".
$fetch['entry_time']."<br>";
}
}else if($par_mode == 'mr'){
$par_num_arr = explode(",",$par_num);
$tarr = sizeof($par_num_arr);
$query = "select * from device_telemonitoring
where kit_id=$kit_id order by dtm_id DESC";
$result = mysql_query($query);
if(mysql_num_rows($result)){
$fetch = mysql_fetch_array($result);
46

for($ii=0 ; $ii <$tarr ; $ii++){


$par_val[$ii] = $par_num_arr[$ii].
$fetch['device'.$par_num_arr[$ii]];
}
$string = implode("_",$par_val);
$string = $string."_".$fetch['entry_date']."_".
$fetch['entry_time'];
}
}
echo $string;
}
?>

GSM
GSM which stands for Global System for Mobile
Communication is the most popular standard for mobile
phone communication in the world. It is used by over
three billion people across more than 212 countries and
territories GSM basically provides voice call and short
message service (SMS). It operates as a cellular network
that mobile phones connect to by trying to search for
cells in their immediate vicinity. The modulation used in
GSM is Gaussian minimum shift keying (GMSK), a kind of
continuous-phase frequency shift keying.
In GMSK, the signal to be
modulated onto the carrier is first smoothed with
47

Gaussian low-pass filter prior to being fed to a frequency


modulator, which greatly reduces the interference to
neighboring channels (adjacent channel interference).
GSM networks
Operate in the 900 MHz or 1800MHz frequency bands in
most countries of the world except in few countries like
USA and Canada where 850 and 1900 MHz bands are
used as the 900 and 1800 MHz bands were already
allocated. The GSM technology uses a 200 Khz radio
frequency channels that are time division multiplexed to
enable up to eight users to access each carrier.

The SIM900 is a complete Quad-band GSM/GPRS solution in a


SMT module which can be embedded in the customer applications.
Featuring an industry-standard interface, the SIM900 delivers
GSM/GPRS 850/900/1800/1900MHz performance for voice, SMS,
Data, and Fax in a small form factor and with low power consumption.
With a tiny configuration of 24mm x 24mm x 3 mm, SIM900 can fit
almost all the space requirements in your M2M application, especially
for slim and compact demand of design.
SIM900 is designed with a very powerful single-chip processor
integrating AMR926EJ-S core
48

Quad - band GSM/GPRS module with a size of 24mmx24mmx3mm


SMT type suit for customer application
An embedded Powerful TCP/IP protocol stack
Based upon mature and field-proven platform, backed up by our
support service, from definition to design and production.

CHAPTER FIVE
CONCLUSION AND RECOMMENDATION
CONCLUSION
It is evident from this project work that an individual control home
Automation system can be cheaply made from low-cost locally available
components and can be used to control multifarious home appliances
ranging from the security lamps, the television to 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 and certified to control different home appliances
used in the lighting system, air conditioning system, heating system,
home entertainment system and many more (this is as long as the
maximum power and current rating of the appliance does not exceed that
of the used relay).
Finally, this home automation system can be also
implemented over Bluetooth, 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.

49

RECOMMENDATION
In consonance with the project work and in view of the researched
methods and undertakings in the project design, the following are
recommended:
The department should help the students in getting components that
are not locally available.
Students should be taught how to make embedded systems as the use
of computer software in most project work makes it uneconomical, and
the use of the conventional integrated circuits and logic gates makes the
project work clumsy.
Finally, this project can be further developed to control more than
one home appliance at once through the use of short message service
texts rather than voice dial though it will be more expensive and will
require more relay circuits, making it a distributed control home
automation system. Also, to cut the cost of mobile phone, the project
may be implemented using standalone GSM modems that only perform
specialised functions like text messaging and/or phone calls. This GSM
modems often are cheaper and more reliable than GSM mobile phones.

REFERENCES
Byte Craft (2002). First Steps with Embedded Systems. Byte Craft
Limited, Canada.

50

B & B Electronics (2003) RS-232 connections that work! DTE & DCE
FAQ. From http://www.bb-elec.com Retrieved on 29/03/2003 Collins, T.
J. (2008).
A project report on the design and construction of a low voltage
power line communication system. Project Report, FUTA Akure.
Intersil (2008). HIN232 datasheet. Intersil Inc, USA.
Martin Bates (2006). Interfacing PIC Microcontrollers Embedded
Design by Interactive Simulation. Newness, London.
Wikipedia (2009). Automation. From
http://en.wikipedia.org/wiki/Automation. Retrieved on 7/30/2009
Wikipedia (2009). Building Automation. From
http://en.wikipedia.org/wiki/Building_automation. Retrieved on
7/30/2009
Wikipedia (2009). Microcontroller. From
http://en.wikipedia.org/wiki/Microcontroller. Retrieved on 8/3/2009

51

Das könnte Ihnen auch gefallen