You are on page 1of 10

J. of Active and Passive Electronic Devices, Vol. 3, pp.

331340
Reprints available directly from the publisher
Photocopying permitted by license only

2008 Old City Publishing, Inc.


Published by license under the OCP Science imprint,
a member of the Old City Publishing Group

Design of Power-Line Communication System


(PLC) Using a PIC Microcontroller
Q. Al-Zobi1 , I. Al-Tawil2 , K. Gharaibeh3 and I. S. Al-Kofahi1,
1 Electronics

Engineering Department,Hijjawi Faculty for Engineering Technology,


Yarmouk University, Irbid-Jordan
2 Power Engineering Department, Hijjawi Faculty for Engineering Technology,
Yarmouk University, Irbid-Jordan
3 Communication Engineering Department, Hijjawi Faculty for Engineering Technology,
Yarmouk University, Irbid-Jordan

A Power line communication (PLC) system suitable for power meter reading is presented. A PLC transmitter, receiver and interfacing circuit are
designed, fabricated and tested. Experimental results of digital data transferred over 220V/50 Hz power lines are presented. The carrier frequency
used in this work is 140 kHz.
Keywords:
network.

Power line communication, utility services, electrical distributed

1 INTRODUCTION
Power line communication (PLC) is a technology that employs the infrastructure of electrical power distributed system as communication medium. PLC
technology could provide the consumer with a spectrum of services such as
internet, home entertainment, home automation, and enable the electricity supply authority to efficiently mange their distribution networks in a competitive
manner.
This technique has immediate attraction for meter communication system,
since every consumer is connected to the communication network and that
network is owned and controlled by the electricity supply authority. In a meter
reading communication system high power signals are transmitted through
the network, which are then received by all connected meters. This system
Corresponding author. E-mail: alkofahi@yahoo.com

331

JAPED rc07-18 2008/8/22 12:18 page 331 #1

332

Q. Al-Zobi et al.

has been extensively implemented in Europe and especially in France [1].


PLC systems can also be used to transfer data inside buildings using power
lines discounting the cost of insulating communication cables. A recent survey shows that one third of new broadband customers will choose power line
communication by 2012 [2]. PLC technology could also let the power distribution companies open lucrative revenue streams by bundling electricity
supply with broadband telecommunication access providing high speed and
reliable communication traffic including Internet access [3,4].
PLC technology offers many advantages over other wire line and wireless
communication technology that makes PLC efficient and economic to use in
some applications. First; PLC uses the existing infrastructure of power line
networks which means a great savings in wiring. Second; PLC is more secure
than wireless, and telephone line communication. Transmitted data within any
house, company etc, can not be hacked by anyone out of the sub-network.
On the other hand, there are some difficulties and disadvantages that hinder
using PLC as universal communication system. In addition to the interference
problem created the radiation from power lines, PLC systems suffer from the
noise created by loads and devices connected to the power-line network [5]
which imposes restrictions on the available bandwidth.
In this paper we present a simple hardware implementation for a PLC system using a Peripheral Interface Controller (PIC) microcontroller [6] which
provides data generation and interfacing. The system is suitable for data communications within a local power network area, such as remote automatic
meter reading, fire and security alarm control, etc. The system is built using
on-off-keying (OOK) modulation [7] to reduce complexity. The PLC system
is connected to power lines using proper interfacing circuits which are used
to provide electrical isolation and impedance adaptation between the PIC and
the power line network. This means that the system can be implemented using
the available off-the-shelf components and hence a great reduction in the cost
of the overall system. The system was tested during many hours of continuous
operation, and it was found that the transmitted signal suffered from small
distortion levels.

2 PLC SYSTEM
A PLC transmitter should be designed properly to enhance the signal against
a hostile environment. The transmission line medium is considered as a very
harmful environment against digital data. This is because power line transmission environment may contain stray signals in the form of pulses that could be
noisy at the receiver side [5]. These pulses may interfere with the transmitted
signals and create an unwanted distortion that disturbs the operation of the
system. Therefore, base-band transmission of data is inefficient and hence one

JAPED rc07-18 2008/8/22 12:18 page 332 #2

333

Design of PLC System Using a PIC Microcontroller

Data

Parallel/Serial

Modulator

Interface

Power

Network

source

OSC

FIGURE 1
PLC-transmitter block diagram.

Power

Interface

DeModulator

Serial/Parallel

Data
sink

Network

OSC

FIGURE 2
PLC-receiver block diagram.

of the digital modulation techniques needs to be used to obtain immune data


form and to guarantee safe transmission process.
A simple block diagram of a PLC transmitter is shown in Figure 1. A basic
PLC transmitter consists of five main sub-stages: a data source, a serial to
parallel converter, a carrier frequency oscillator, a digital modulator and an
interfacing circuit. The transmitter function is to modulate the data signal using
one of the digital modulation techniques and then to load it to the power-line
network. OOK modulation is usually used because it provides a reliable and
yet a simple system. OOK modulation is a special case of ASK (Amplitude
Shift Keying) modulation, where no carrier is present during the transmission
of a zero. An interfacing circuit is used to isolate the 220 V/50 Hz from the
low voltage environment.
Figure 2 shows a block diagram of a PLC receiver. A PLC receiver is
connected to the power-line network via an interfacing circuit. A preamplifier
is used to compensate for the losses in the power lines. The amplified signal
is demodulated to recover the original data, and then passed to a data sink.

3 PLC SYSTEM DESIGN USING PIC


In this paper we use a microcontroller to provide data generation and synchronization. The input data to the PLC transmitter is parallel data which may come
from PC, a DIP switches, etc. A PIC microcontroller is used to read parallel
input data and then convert it into serial data ready for digital modulation. The

JAPED rc07-18 2008/8/22 12:18 page 333 #3

334

Q. Al-Zobi et al.

FIGURE 3
Pin diagram of the PIC-16F87.
Carrier
Frequency
Oscillator

Level
Converter
OOK
Modulator

PIC16F876
MicroController

Power
Amplifier

Interfacing
Circuit

Level
Converter

FIGURE 4
A block diagram of the proposd PLC transmitter.

PIC is also used to enable transmission of data after a certain delay to ensure
that the turns on/off spikes are removed. A pin diagram of a PIC 16F876 is
shown in Figure 3.
3.1 PLC transmitter
The proposed PLC transmitter is shown in Figure 4 and consists of the PIC
16F876 which is used as a data source and data synchronizer, an OOK modulator, a power amplifier and an interfacing circuit. A level converter (an
operational amplifier which works as a simple comparator) is used to convert
data levels between the PIC and the OOK modulator.
Figure 5 shows a schematic of the proposed transmitter circuit. The interfacing circuit used in both the transmitter and the receiver is shown in
Figure 6.
To minimize the effect of the distortion problem, critical parameter selections have been used based on working experience and best output results.
The selected carrier frequency (fc) has to be constant, stable and much higher
than the Data Baud Rate. Therefore, an oscillator was built using LM566CN
voltage controlled oscillator [8,9] to produce a rectangular waveform with
frequency of 140 KHz which is much greater than the used data baud rate

JAPED rc07-18 2008/8/22 12:18 page 334 #4

335

Design of PLC System Using a PIC Microcontroller

5V
12V

8 1K
PIC16F876

5V

10 K

MCLR'/Vpp

RB7/PGD

RA0/AN0

RB6/PGC

RA1/AN1

RB5

RA2/AN2/Vref-

RB4

RA3/AN3/Vref+

RB3/PGM

RA4/T0CKI

RB1

Vss

22 pF

300

RB2

RA5/AN4/SS'

4 MHz

1N 4007

RB0/INT

OSC1/CLKIN

Vdd

OSC2/CLKOUT

Vss

RC0/T1OS0/T1CKI

RC7/RX/DT

RC1/T1OSI/CCP2

RC6/TX/CK

22 pF RC2/CCP1

5V
12V
10 K

RC5/SDO

RC3SCK/SCL

+ LF347N

RC4/SDI/SDA

12V
9.1K

C1

SQR O/P

R1

TRI O/P

LF347N

2.2 K

Input

470 pF

300

12V
+

1nF

Vcc

NC

1K ,6W
CD4081B

12V
LM566CN
GND

12V

12V

5.1K

Interfacing
Circuit

FIGURE 5
PLC transmitter schematic.

Tx

C1
10nF

C2
1uF

C3
1uF

To the
Preamplifier

11

220 V/ 50Hz

Rx
FIGURE 6
The interfacing circuit.

(500 bit/s). A rectangular waveform was selected because it achieves better


distortion performance.
The modulated signal is loaded to the power-line by an interfacing circuit
which consists of an LC resonant circuit after power amplification which
provides the current level needed to drive the interfacing circuit. The power
amplifier was designed using the C3039 power transistor. The C3039 power
transistor is usually used for high voltage, high speed applications, especially
in inductive circuits. The interfacing circuit isolates the 220 V/50 Hz from the
low voltage environment of the PLC transmitter. The interfacing circuit is also
used to suppress the high voltage spike generated by switching.

JAPED rc07-18 2008/8/22 12:18 page 335 #5

336

Q. Al-Zobi et al.

Interfacing
Circuit

Received
Signal

OOK
Demodulator

Serial
data

PIC
MicroController

8-bit Parallel data

PowerLine Network

3.2 PLC receiver


In the proposed PLC receiver, the received signal is first amplified using a
preamplifier. Then the amplified signal is entered to the OOK demodulator,
which recovers the original data. The received data is then passed to the
microcontroller which converts serial data into parallel data. An interfacing
circuit similar to the interfacing circuit used the transmitter is used to isolate the
receiver from the 220 V/50 Hz environment. Figure 7 shows a block diagram
of the proposed PLC receiver and Figure 8 shows a schematic diagram of the
receiver circuit.

FIGURE 7
A block diagram of the proposed PLC receiver.

FIGURE 8
PLC receiver schematic.

JAPED rc07-18 2008/8/22 12:18 page 336 #6

Design of PLC System Using a PIC Microcontroller

337

The OOK modulator/demodulator circuits were designed using a basic logical AND gates proceeded by level converters used to interface TTL to CMOS
of the PIC and the OOK modulator. An operational amplified that operates
as a comparator was used as a level converter. The comparator converts data
levels to other levels where logic HIGH is greater than 8 V and logic LOW is
less than 2 V. The carrier signal used in OOK modulation was obtained using
an LM566CN voltage controlled oscillator.

4 IMPLEMENTATION AND PERFORMANCE ANALYSIS


The microcontroller was programmed to read parallel input data on PORT B
(from RB0 RB7), then converts it into serial. The PIC then transmits the data
serially via the RS232, (RC6/TX/CK) transmitting pin. The flowchart of the
program used in PIC16F876 is shown in Figure 9. The microcontroller was
Start

Initialization

Delay ( 5 second )

Start

Initialization

Switch relay on
Delay ( 5 second )

Read serial dat


fromRS232 RX pin

Convert data
into parallel

Switch relay on

Read parallel data


from PORT B

Convert data
into serial

Output parallel on
PORT B
Output serial data
via RS232 XMIT

Enable interrupt
Delay ( 1 second )

Finish

Finish

FIGURE 9
Flow chart used to program the PIC-16F876.

JAPED rc07-18 2008/8/22 12:18 page 337 #7

338

Q. Al-Zobi et al.

programmed to enable transmission of data after a time delay to ensure that


the spikes generated from switching the circuit on are removed.
The interfacing circuit was tested by measuring the leakage voltage of the
220 V/50 Hz signal that can be passed by this circuit. It was found that the
maximum leakage signal amplitude was 36 mV which does not cause any
problem to the electronic components of the transceiver.
The interfacing circuit was tested using three different types of signals;
sinusoidal, triangle and rectangular signals to assess the attenuation, distortion
and noise performance of the circuit. The transmitted signal was monitored
during transmission in three points; at the transmitter terminal before entering
the interfacing circuit, on the power-line, and at the receiver stage. It was
found that sinusoidal signal suffers from high attenuation levels and hence a
rectangular waveform needs to be used as a carrier signal.
The frequency response of the preamplifier used in the receiver circuit is
shown in Figure 10. It can be seen that low frequencies (50 Hz) are attenuated.
50

Amplitude (V).

40

30
20
10
0
1E-2

1E-1

1E+0

1E+1
1E+2
Frequency (KHz)

1E+3

1E+4

FIGURE 10
Frequency response of the preamplifier.
1.000 V
0.750 V

0.500 V

0.250 V
0.000 V

- 0.250 V
- 0.500 V
- 0.750 V
- 1.000 V
0.000ms

10.00ms

20.00ms

30.00ms

40.00ms

50.00ms

60.00ms

70.00ms

80.00ms

90.00ms

100.0ms

1: Input Signal (1V/50Hz)


2: Output Signal (10mV/50Hz)

FIGURE 11
Preamplifier input/output waveforms.

JAPED rc07-18 2008/8/22 12:18 page 338 #8

Design of PLC System Using a PIC Microcontroller

339

FIGURE 12
Transmitter PCB.

FIGURE 13
Receiver PCB.

The preamplifier was tested with a signal of amplitude of 5 mV at 140 KHz.


The input and output signal waveforms were as shown in Figure 11.
The transmitter and receiver circuits were implemented on a PCB as shown
in Figures 12 and 13, respectively.

JAPED rc07-18 2008/8/22 12:18 page 339 #9

340

Q. Al-Zobi et al.

5 CONCLUSION
We have designed a simple and reliable PLC system. The system achieves the
required demands of stability, reliability, and accuracy. The system was tested
during many hours of continuous operation, and it was found that the transmitted signal suffered from very low levels of noise and distortion. The system
can be implemented using off the shelf components and can be used for low
data rate applications such as meter reading and remote control applications.

REFERENCES
[1] Duval G. Application of power line carrier at Electricite de France, Proc. 1997 Internat.
Symp. On Power Line Comms. and its Applications, pp. 7680.
[2] Dostert K. Telecommunication over the power Distribution Grid Possibilities and Limitations,
Proc. 1997 Internet. Symp. on Power Line Comms. and its Applications, pp. 19.
[3] Waldec T., Zimmermann M. and Dostert K. Konzepte fur Powerline Kommunikation system.
Furkschau 1 (1998), 4043.
[4] Metcalfe B. Cheap, reliable, powerful net connections may be as close as an electric socket.
Info World, Febuary 10, 1997, 44.
[5] http://en.wikipedia.org/wiki/Electromagnetic_interference.
[6] Gardner N. An Introduction to Programming the Microchip PIC in CCS C, 2002.
[7] http://en.wikipedia.org/wiki/On-off keying.
[8] Karris S. T. Electronic Devices and amplifier Circuits. Orchard Publications, 2005.
[9] Winder S. Analog and Digital Filter Design, 2nd edition, Butterworth-Heinemann, 2002.

JAPED rc07-18 2008/8/22 12:18 page 340 #10

You might also like