Professional Documents
Culture Documents
COMMUNICATION
Submitted by
M. Karim Shah
Muhammad ul Haque
Muhammad Umair
Zeeshan Sikandar Niazi
Advisor
Mr. Muhammad Umar Khan
1|Page
CERTIFICATE OF APPROVAL
Certified by,
Project Advisor
2|Page
ACKNOWLEDGEMENTS
support we needed.
3|Page
ABSTRACT
4|Page
CONTENTS
5|Page
APPENDIX ……………………………………….……………………………………………..35
APPENDIX A Schematics….........................................................................................................35
APPENDIX B Datasheets ……………………………….……………………………………..37
6|Page
CHAPTER 1
INTRODUCTION
1.1 Overview
bridging the gap existing between the electrical and communication network. It is
basically the utilization of an extensive power line network and the connection of
multiple devices to this network that could communicate over this intricate system
residential unit. It also offers the prospect of being able to construct intelligent
buildings, which would maintain themselves by the use of multiple sensors that
communicate to any device on the power grid, through the power grid itself.
possible to supply this kind of network communication over the power-line, the
The various concerns facing this medium are that unlike power related
applications, network communications require very high bit rates and in some
7|Page
communication system but has been the focus of many researchers during the last
years. Systems under trial exist today that claim a bit rate of 1 Mb/s, but most
high power low frequency signal. The communication signal tends to be a low
power high frequency one which is one hurdle to overcome. Additional challenges
are the fact that the power lines are contaminated by noise and signal attenuation
through runs of power line get higher as the frequency of operation increases.
Power line networks are usually made of a variety of conductor types and cross
The project aims to understand and explore the theoretical and practical aspects of
power line communication techniques. This would lead to subsequent design and
microcontrollers and the transmission of command signals over the power line to
8|Page
1.3 Project Modules
Modulator/Demodulator:
The modulating circuitry would produce a specified high frequency signal, that
devices.
User Interface:
The user interface for the control of units is implemented by an LCD for display
of options and a keypad to choose the option of choice. This was connected to the
master microcontroller which would generate a unique bit pattern for each device,
Coupling:
This is the most essential module that couples the device to the power line. It must
isolate the system from the high power network and also act as a high pass filter
so that noise at lower frequencies may be filtered out and allowing the
Device activation:
The devices are to be activated using relays as they require high power which
cannot be provided by the microcontroller port. Each port is input to a latch which
mechanism. Without this latch the voltage level at the output port is not sufficient
9|Page
to energize the coil in the relay. After latching a BJT is used as a switching device
so that the high power signal is throughput to the N.O. of the relay which is
10 | P a g e
CHAPTER 2
POWERLINE COMMUNICATION
2.1 Background
The technology was initiated back in the 1940s and has been used ever since in
and devices in close proximity. Latest advancements are the attainment of higher
bandwidth and integration of outdoor applications which is evident from the fact
that broadband over power lines has been achieved in many western countries. A
the frequency band utilized and the channel access mechanisms that are used.
The X-10 for example is one of the oldest protocols. It uses amplitude shift keying
and was initially used for simplex communication. The presence or absence of a
120kHz signal is used to detect the transmission of „1‟ or „0‟ bits respectively.
Each module is assigned an address and the transmission signal would typically
contain start bits, house address, device address and function code. This protocol
had its speed limitations and also the fact that multiple devices could be
The CEBus Protocol uses p2p communication model and employs Carrier Sensed
Multiple Access to avoid collisions. Power line physical layer of the CEBus is
11 | P a g e
100-400kHz. This allows for synchronisation as an instantaneous frequency is
used as referance and it also aids in collision resolution. The „1‟ and „0‟ are
resolved by the time duration of the chirp with 100microseconds for a „1‟ and
Further protocols are progressively more efficient and employ techniques for the
of this technology.
2.3.1 Noise
poor connections that arc, and other "accidental transmitters" that either switch or
to reduce such noise, that we understand how the noise travels from the source
Corona Noise
Corona noise is the most common noise associated with transmission lines and is
heard as a crackling or hissing sound. Corona is the breakdown of air into charged
particles caused by the electrical field at the surface of conductors. This type of
noise varies with both weather and voltage of the line, and most often occurs in
conditions of heavy rain and high humidity (typically >80%). An electric field
surrounds power lines and causes implosion of ionized water droplets in the air,
12 | P a g e
During relatively dry conditions, corona noise typically results in continuous noise
edge of the right-of-way. In many locations, this noise level is similar to ambient
corona noise levels could increase to 50 to 60 dBA and could even increase to
over 60 dBA under some conditions. Corona noise levels are not consistent from
location to location because conductor surface defects, damage, dust, and other
Insulator noise
caused by dirty, nicked, or cracked insulators, and is mainly a problem with older
ceramic or glass insulators. New polymer insulators minimize this type of noise.
50 Hz periodic noise
Noise synchronous to the sinusoidal power line carrier can be found on the line.
The sources of this noise tend to be silicon-controlled rectifiers (SCRs) that switch
at a certain angle in the 50Hz cycle, placing a voltage spike on the line. This
Lightning strikes, ignition sparks and lights being turned on or off produce single-
event impulses which result in noise throughout the spectrum. Capacitor banks
Devices such as the triac-controlled dimmers on lights are the most common
source of indoor noise as they introduce impluses whenever they connect the lamp
13 | P a g e
to the AC line part way through each AC cycle. These impulses occur at twice the
Continuous impulsive noise is the most severe of all the noise sources as this kind
multiple devices such as found in vacuum cleaners, drillers, electric shavers and
This type of noise has line spectra uncorrelated with 50 Hz sinusoidal carriers.
communications transceiver.
measured from different locations in the building. Noise levels tend to decrease in
power level as the frequency increases; in other words, spectrum density of power
communications carrier frequency would compete with less noise if its frequency
were higher.
14 | P a g e
2.3.2 Attenuation
Attenuation is the loss of signal strength as the signal travels over distance.
For a transmission line the input impedance depends on the type of line, its length
and the termination at the far end. The characteristic impedance of a transmission
line (Zo) is the impedance measured at the input of this line when its length is
infinite. Under these conditions the type of termination at the far end has no effect.
by
At the frequencies of interest for PLC communications (the high frequency range),
this approximates to
where L and C are the line impedance and capacitance per length.
appropriately designed high pass filter. Maximum signal power will be received
when the impedance of the transmitter, power line and the receiver are matched.
Power line networks are usually made of a variety of conductor types and cross
line is not a suitable model for PLC communications, since the power line has a
15 | P a g e
amounts of time. Channel impedance is a strongly fluctuating variable that is
difficult to predict. The overall impedance of the low voltage network results from
a parallel connection of all the network‟s loads. so the small impedances will play
are not easy to predict either. The most typical coaxial cable impedances used are
50 and 75-ohm coaxial cables and measured 7dB attenuation for a 50 meter run
insulation on the wires measures at about 120 ohms. Clearly, channel impedance
is low. This presents significant challenges when designing a coupling network for
PLC communications. Maximum power transfer theory states that the transmitter
and channel impedance must be matched for maximum power transfer. With
expected situations.
must be considered for this medium of communication as well. The higher SNR
For indoor environments there are multiple noise sources as discussed earlier and
as seen from the attenuation in a power line channel it is apparent that the SNR is
majorly hampered. Improvements can be made by, for example, installing filters
at each household to block the noise generated from entering the grid and
16 | P a g e
decreasing noise from the outdoor grid as well. This will mean higher costs.
Another test for locating noise sources is to go to the main breaker panel or fuse
box. Check the presence of the noise with a battery-powered radio. If the noise is
present, shut off all power to the premises by turning off the MAIN circuit breaker
or by pulling the MAIN fuses or meter. If the noise on the AM radio stops while
the power is off, the source of the interference is within the residence. If the noise
continues, you can assume it is coming from a point external to the customer's
home. Restore the main circuit breaker or fuses or meter. If the noise stopped
while the power was off, locate the circuit supplying the power to the noise source
using an AM radio as before, and de-energize the individual circuit breakers one
at a time until the noise stops. Next, determine what is on the circuit by going
from room to room to isolate outlets, appliances and lights until the offending
device is found.
Frequencies used by the devices communicating over the power line are restricted
In North America frequency band from 0 to 500 KHz can be used for power line
17 | P a g e
Here, the CENELEC standard only allows frequencies between 3 kHz and 148.5
kHz. This puts a hard restriction on power line communications and might not be
enough to support high bit rate applications, such as real-time video, depending on
the performance needed. According to this standard the spectrum is divided into
95 – 125 KHz: The use of this frequency band is limited to the energy
125 – 140 KHz: The use of this frequency band is limited to the energy
access protocol using center frequency of 132.5 KHz was defined. This
140 – 148.5 KHz: The use of this frequency band is limited to the energy
frequency range from 95 – 148.5 KHz. Apart from band allocation, regulatory
bodies also impose limits on the radiations that may be emitted by these devices.
18 | P a g e
These reflect as restrictions on the transmitted power in each of these frequency
bands.
Bandwidth is proportional to bit rate, in order to increase the bit rate, larger
bandwidth may be needed. Recent research has suggested the use of frequencies
in the interval between 1 and 20 MHz. If this range could be used, it would make
an enormous increase in bandwidth and would perhaps allow high bit rate
19 | P a g e
CHAPTER 3
MODULATION
When data is transmitted over long distance there should be some mechanism of
coding so that the data can easily be distinguished from noise and other signals
being transmitted in the same channel and decoded. Modulation is the used to
transmit signal over long distances. modulation is the process of varying one or
more properties of high frequency periodic waveform, called the carrier signal,
by some high frequency signal and transmitted and at the receiving end the signal
mathematically expressed as
There are only three characteristics of a signal that can be changed over time:
amplitude, phase, or frequency. However, phase and frequency are just different
ways to view or measure the same signal change. So, we have three parameter
20 | P a g e
And the phase of the signal ( )
And based on these three parameters there are three different types of modulations
Modulation (FM) is the most popular analog modulation technique used in mobile
constant while its frequency is varied by the modulating message signal and in
phase modulation the phase of the carrier signal is varied with the amplitude of the
21 | P a g e
3. Modulation also serves as a source of coding mechanism.
frequency.
frequency and phase are kept constant. Bit 1 is transmitted by a carrier of one
particular frequency and to transmit bit 0, the amplitude is changed keeping the
other two parameters constant. ON=OFF keying is a special form of ASK, where
Where,
22 | P a g e
A is the amplitude
Which implies that the carrier signal is present when the digital signal is at logic
change in the amplitude of the carrier signal and noise is always present. During
on the power line and after receiving the signal before demodulation). As a result
the noise will also be amplified. This is one of the drawback due to which we
In PSK, we change the phase of the carrier signal to indicate the information.
Phase in this context is the starting angle at which the carrier signal (sinusoid)
starts. To transmit 0, we shift the phase of the sinusoid by 180 0 . Phase shift
23 | P a g e
for logic level 1
Where,
A is a constant
information signal, one particular frequency for logic 1 and another frequency for
FSK is the most favorable scheme of modulation for power line communication
since the carrier frequency is always present and we can recover the original filter
easily because the amplitude is not important anymore so the effect of noise is
24 | P a g e
CHAPTER 4
COUPLING CIRCUITRY
One of the most critical components of any Power Line Communication system is
its interface circuit (or coupling circuit) with the power distribution network. This
PLC channel. Due to high voltages, varying impedances, high amplitudes and
provide both the specific signal transmission with the appropriate bandwidth, and
decoupling that signal from the power line to a receiver unit. The coupling circuit
includes: (a) a ferrite core inductive coupler for isolating the transmitter unit and
the receiver unit from a power line and for coupling information signals from the
transmitter unit to the power line and from the power line to the receiver unit, (b)
a high pass filter (capacitive coupler) which not only blocks random noise from
entering into the modem but also suppresses 50Hz power signal. Hence it is the
core part of Power Line Communication which isolates the modem from high
voltages and allows only the information signal to pass through unattenuated.
25 | P a g e
4.1 Coupling Transformer
Coupling transformer is used for two reasons (a)To attain galvanic isolation (b)
The power signal tends to have a saturating influence on the magnetic core and in
the order of atleast 105 time more as compared to the communication signal. This
means that the transformer must be placed after the capacitive coupler so as to
prevent the power signal from saturating the core, and hence deforming the
frequency response. Operating at lower frequencies and high power ratings, most
power transformers have transfer functions which do not allow for the
current is injected into the power distribution lines. This is achieved through an
inductive injection method is most effective when the mains impedance is low at
the signal injection point. This is typically the case when injecting the signal into a
bus network where several power cables are connected together. Connecting
impedance. The inductive coupling is often the preferred method for coupling due
to its better performance in low impedance situations, lower radiation from power
26 | P a g e
4.2 Coupling Capacitors
A high pass passive filter is needed to remove noise coming from the power line
and to act as a capacitive coupling circuit, blocking 50Hz power signal. The
employ perfect grounds at the transmitting and receiving side. This provides a
27 | P a g e
CHAPTER 5
HARDWARE IMPLEMENTATION
In this project we are using HEF4046B IC for modulation and demodulation. The
This IC contains VCO as well as the PLL which are used for modulation and
is the exclusive OR gate. This comparator has the feature that it does not only lock
on to the fundamental frequency but also at its harmonics which is undesired for
us as we do not want to lock the PLL at the harmonics which might be any noise
28 | P a g e
on the power line (there is always noise at different frequencies on the power
The VCO gives both square or triangular signal of particular frequency set by the
We are using 190KHz for logic level 1 and 150KHz for logic level 0. For these
Step 1
determine R2 and C1
Step 2
From the first step we get R2 =10KΩ (for Vcc = 10V) and C1 = 5nf
29 | P a g e
5.1.2 The FSK Demodulator
The values of R1, R2 and C1 for the demodulator are the same as for the
fc = 100zHz
R3 =1.5KHz
30 | P a g e
According to the standard used for isolation of the low voltage circuitry from the
high voltage power line, an isolation transformer and coupling capacitors are used.
The transformer serves two purposes, first it serves as an isolating device and
The transformer should be of high frequency. Since we are using 190KHZ and
150KHZ for logic high and low respectively, the frequency ratings of the
transformer should also be in this frequency ranges. But due to the unavailability
second order high pass filter. Keeping in view the high voltage, the resistors used
are of 10watts and the capacitors are of high voltage rating (800V). and the cutoff
fc = 72.3KHZ
This helps to suppress the 50HZ high voltage signal and the noise below this
frequency ranges is also suppressed. (To further minimize noise the signal is
electromagnet inside the relay, and energizing that electromagnet causes the
switch to change position by pulling the movable parts of the switch mechanism
31 | P a g e
There are two main classes of relays - latching and non-latching. Non-latching
to one side, which is called the "normal" or "reset" side. Whenever the
electromagnet's coil carries enough current (called the pull-in current), it makes
"set" position. The switch stays in the energized position as long as the current in
the coil is enough to make the electromagnet overcome the force of the spring. As
soon as the current drops below the holding current, the spring pulls the switch
works, it takes less magnetic force - and therefore less current in the coil - to hold
the relay set than it did to move it there in the first place, so the holding current is
The nonlatching relay is shown schematically on left hand corner of fig below.
The switch portion of the basic relay is shown as a switch that consists of a pole
which can be switched to one of two throws. The throw that the pole connects to
when no current flows in the coil is called the normally closed (NC) throw. The
normally open (NO) contact is - well, normally open. A spring holds the switch in
this position. The pole and throws are the only signal connections on the relay.
The coil is only used to control the relay, not to conduct signal
32 | P a g e
currents.
Figure 5.4 Two types of relays one employing a spring (L) and one using a magnet (R)
On the right hand side of the figure above, we see the other major kind of relay,
the latching relay. If we have no spring, but make the swinging arm a magnet
(indicated by the n and s poles), then the swinging arm will be made to be
attracted to the closest of the two iron coil cores. It will stay in that position
connecting the switch and battery to make the two electromagnets energize in a
way that repels the magnet in the swing arm away from its current position. If the
polarity of the battery is such that the iron core attracts the swinging arm, the arm
stays right where it is and nothing happens. Only if the polarity of the battery is
such that the iron core repels the swinging arm, and the other iron core attracts the
swinging arm, will the swinging arm will flip to the other side and stay there. By
proper winding and connections, this forms a magnetically latching relay. This
particular kind is called a "single coil" latching relay. You make it change states
by putting a reverse pulse into the single coil. To flip it back, you have to invert
The switch in the above figure is practically replaced in the Power Line
33 | P a g e
connected to the output of the latch IC. As the output current of the
microcontroller is too small and cannot provide the sufficient base current for the
transistor, it is first latched and then connected to the base. The relay is connected
to the emitter and VCC is applied at the collector. The transistor turns ON and
34 | P a g e
CHAPTER 6
PROGRAMMING MASTER/SLAVE
Language
Assembly Language
Microcontroller
Atmel AT89C51
Software
MIDE-51
Microcontroller sends the digital data at data rate of 5kb/s which is fed into the
FSK modulator thus we have 190Khz frequency burst for „1‟ and 140Khz
frequency burst for „0‟. Serial port of the microconroller is not used for the data
receiver due to high baud rate, instead P1.7 of the master microcontroller is
First two bits are the starting bits which tells the slave unit to take the next byte as
a data byte. Microcontroller concatenates a pair of ones before the address of the
corresponding device.
1 1 DATA (8 Bits )
Figure 6.1 Transmission Protocol
6.1.2 Address Mapping
35 | P a g e
Each device which is to be controlled is mapped with a unique address. So when a
A 1 00000001
B 2 00000010
C 3 00000011
. . .
Z . .
At the control side user is provided with an interface which includes LCD display
and a numeric keypad. LCD is used for visual purpose and user guidance where
switched on/off. The detail Pin configuration of LCD and working of keypad is
described in Appendix A.
Fi
36 | P a g e
6.1.4 Sample Code (Transmission)
TRANS:MOV R4,#8
SETB P2.1
ACALL DELAY3
DJNZ R4,UNT
ACALL DELAY1
ACALL DELAY1
At the receving end slave unit takes in the serial data through P2.1 and after
START:MOV A,#0H
JNB P2.1,START
37 | P a g e
JNB P2.1,START ;Check for Second starting bit
MOV R4,#8
JMP DAT
ADD A,#0H
ACALL DELAY3
JMP DAT
ADD A,#01H
ACALL DELAY3
JMP DAT
38 | P a g e
REFERENCES
I. Muhammad Ali Mazidi, and Janice Cillisie Mazidi. “The 8051 Microcontroller and
II. M Zubair M Atif Siddiqui, Wajahat Ali Shah, M Rashid, “Power Line
Communications.
V. Niovi Pavlidou, A. J. Han Vinck, Javad Yazdani and Bahram Honary, “Power Line
Technologies.
X. http://www.tpub.com/neets/book2/5i.htm
XI. http://www.oas.org/en/citel/infocitel/2006/noviembre/bpl_e.asp
39 | P a g e
APPENDIX A
PROGRAMMING CODE
TRANSMITTING END
ORG 0h
HERE1: CLR A
MOVC A,@A+DPTR
JZ PRINT15
ACALL COMWRT
ACALL DELAY1
INC DPTR
SJMP HERE1
PRINT15:MOV DPTR,#DATA1
PRINT1: CLR A
MOVC A,@A+DPTR
JZ COMM2
ACALL DATAWRT
ACALL DELAY1
INC DPTR
SJMP PRINT1
HERE6: CLR A
MOVC A,@A+DPTR
JZ DAT2
40 | P a g e
ACALL COMWRT
ACALL DELAY1
INC DPTR
SJMP HERE6
PRINT2: CLR A
MOVC A,@A+DPTR
JZ START1
ACALL DATAWRT
ACALL DELAY1
INC DPTR
SJMP PRINT2
MOV DPTR,#COM3
HERE7: CLR A
MOVC A,@A+DPTR
JZ START2
ACALL COMWRT
ACALL DELAY1
INC DPTR
SJMP HERE7
PRINT3: CLR A
MOVC A,@A+DPTR
JZ CNTRL
41 | P a g e
ACALL DATAWRT
ACALL DELAY1
INC DPTR
SJMP PRINT3
ACALL COMWRT
ACALL DELAY1
; MOV DPTR,#MENUE2
PRINT4: CLR A
MOVC A,@A+DPTR
JZ CNTRL
ACALL DATAWRT
ACALL DELAY1
INC DPTR
SJMP PRINT4
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,K1
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,OVER
SJMP K2
42 | P a g e
OVER: ACALL DELAY1
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,OVER1
SJMP K2
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW0
MOV P1,#11111101B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW1
MOV P1,#11111011B
MOV A,P2
ANL A,#00001111B
CJNE A,#00001111B,ROW2
LJMP K2
SJMP FIND
SJMP FIND
SJMP FIND
43 | P a g e
FIND: RRC A
JNC MATCH
INC DPTR
SJMP FIND
MATCH: CLR A
MOVC A,@A+DPTR
RET
MOV R6,A
XRL A,#1
JZ STATUS
MOV A,R6
XRL A,#2
JZ OF
SJMP CNTRL
HERE9: CLR A
MOVC A,@A+DPTR
JZ OFPRINT
ACALL COMWRT
ACALL DELAY1
INC DPTR
SJMP HERE9
OFPRINT:MOV DPTR,#STAT1
44 | P a g e
PRINT6: CLR A
MOVC A,@A+DPTR
JZ ADDRESS1
ACALL DATAWRT
ACALL DELAY1
INC DPTR
SJMP PRINT6
HERE8: CLR A
MOVC A,@A+DPTR
JZ STPRINT
ACALL COMWRT
ACALL DELAY1
INC DPTR
SJMP HERE8
STPRINT:MOV DPTR,#STAT1
PRINT5: CLR A
MOVC A,@A+DPTR
JZ ADDRESS1
ACALL DATAWRT
ACALL DELAY1
INC DPTR
SJMP PRINT5
ADDRESS1:ACALL KEYCHK
JMP TRANS
45 | P a g e
TRANS: MOV R4,#8
SETB P2.1
ACALL DELAY3
UNT: MOV R5
RRC A
INC R5
MOV P2.1,C
ACALL DELAY3
DJNZ R4,UNT
MOV A,R5
DIV AB
MOV A,B
JZ PARITY
SETB P2.1
JMP FIN
ACALL DELAY3
ACALL DELAY1
ACALL DELAY1
LJMP START
46 | P a g e
CLR P3.1 ;R/W
ACALL DELAY1
RET
DATAWRT:MOV P0,A
ACALL DELAY1
RET
DJNZ R2,HERE4
DJNZ R1,HERE5
RET
DJNZ R2,HERE12
DJNZ R1,HERE13
47 | P a g e
RET
X: MOV R0,#145
DJNZ R1,X
RET
LCD
COM3: DB 1,80H,0
COM2: DB 0C2H,0
STAT1: DB "ADDRESS:",0
KCODE0: DB 1,2,3
KCODE1: DB 4,5,6
KCODE2: DB 7,8,9
KCODE3: DB 10,11,12
END
48 | P a g e
RECEIVING END
ORG 00H
SETB P2.1
JNB P2.1,START
MOV R4,#5
JMP DAT
NEXT: JB P2.1,ADD1
JNB P2.1,ADD2
ADD1: RL A
ADD A,#0H
ACALL DELAY3
JMP DAT
ADD2: RL A
ADD A,#01H
ACALL DELAY3
JMP DAT
JZ ONE
XRL A,#2
JZ TWO
49 | P a g e
XRL A,#3
JZ THREE
XRL A,#4
JZ FOUR
XRL A,#5
JZ FIVE
XRL A,#6
JZ SIX
XRL A,#7
JZ SEVEN
XRL A,#8
JZ EIGHT
XRL A,#9
JZ NINE
LJMP START
LJMP START
LJMP START
LJMP START
LJMP START
50 | P a g e
LJMP START
LJMP START
LJMP START
LJMP START
DJNZ R2,HERE12
DJNZ R1,HERE13
RET
END
51 | P a g e
APPENDIX B
SCHEMATIC DIAGRAMS
TRANSMITTING END
52 | P a g e
RECEIVING END
53 | P a g e
APPENDIX C
DATASHEETS
74HC4046 (PLL)
54 | P a g e
55 | P a g e
56 | P a g e
57 | P a g e
58 | P a g e
59 | P a g e
60 | P a g e
61 | P a g e
62 | P a g e
63 | P a g e
64 | P a g e
65 | P a g e
66 | P a g e
67 | P a g e
68 | P a g e
69 | P a g e
70 | P a g e
71 | P a g e
72 | P a g e
73 | P a g e