You are on page 1of 10

J. of Active and Passive Electronic Devices, Vol. 3, pp. 331–340 ©2008 Old City Publishing, Inc.

Reprints available directly from the publisher Published by license under the OCP Science imprint,
Photocopying permitted by license only 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 read-
ing is presented. A PLC transmitter, receiver and interfacing circuit are
designed, fabricated and tested. Experimental results of digital data trans-
ferred over 220V/50 Hz power lines are presented. The carrier frequency
used in this work is 140 kHz.
Keywords: Power line communication, utility services, electrical distributed
network.

1 INTRODUCTION

Power line communication (PLC) is a technology that employs the infrastruc-


ture 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 sup-
ply 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 sur-
vey shows that one third of new broadband customers will choose power line
communication by 2012 [2]. PLC technology could also let the power dis-
tribution 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 sys-
tem using a Peripheral Interface Controller (PIC) microcontroller [6] which
provides data generation and interfacing. The system is suitable for data com-
munications 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 transmis-
sion 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


Design of PLC System Using a PIC Microcontroller 333

Data Power
Parallel/Serial Modulator Interface
source Network

OSC

FIGURE 1
PLC-transmitter block diagram.

Power Data
Interface DeModulator Serial/Parallel
Network sink

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 synchro-


nization. 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
Level
Frequency
Converter
Oscillator
OOK Power Interfacing
Modulator Amplifier Circuit
PIC16F876
Level
Micro-
Converter
Controller

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 mod-
ulator, 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 inter-
facing circuit used in both the transmitter and the receiver is shown in
Figure 6.
To minimize the effect of the distortion problem, critical parameter selec-
tions 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


Design of PLC System Using a PIC Microcontroller 335

5V

8 1K 12V

PIC16F876
10 K 1N 4007
5V MCLR'/Vpp RB7/PGD
RA0/AN0 RB6/PGC
RA1/AN1 RB5
RA2/AN2/Vref- RB4 300
RA3/AN3/Vref+ RB3/PGM
RA4/T0CKI RB2
RA5/AN4/SS' RB1
Vss RB0/INT
OSC1/CLKIN Vdd 5V
4 MHz OSC2/CLKOUT Vss 12V
RC0/T1OS0/T1CKI RC7/RX/DT 12V
RC1/T1OSI/CCP2 RC6/TX/CK
10 K 12V
22 pF 22 pF RC2/CCP1 RC5/SDO
+ LF347N 1K ,6W
RC3SCK/SCL RC4/SDI/SDA
12V
12V CD4081B
9.1K 12V
300
LM566CN
+
GND Vcc 1nF
NC C1 LF347N
SQR O/P R1
5.1K
TRI O/P Input 2.2 K Interfacing
470 pF Circuit

FIGURE 5
PLC transmitter schematic.

C1 C2
10nF 1uF 11
Tx

220 V/ 50Hz
To the C3
1uF
Preamplifier
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.

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.

8-bit Parallel data


PowerLine Network

Received Serial
Signal data PIC
Interfacing OOK Micro-
Circuit Demodulator Controller

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 log-


ical 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 Switch relay on


fromRS232 RX pin

Read parallel data


from PORT B
Convert data
into parallel

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

40
Amplitude (V).

30

20

10

0
1E-2 1E-1 1E+0 1E+1 1E+2 1E+3 1E+4
Frequency (KHz)

FIGURE 10
Frequency response of the preamplifier.

1.000 V

0.750 V
1 2
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 transmit-
ted 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. 76–80.
[2] Dostert K. Telecommunication over the power Distribution Grid Possibilities and Limitations,
Proc. 1997 Internet. Symp. on Power Line Comms. and its Applications, pp. 1–9.
[3] Waldec T., Zimmermann M. and Dostert K. Konzepte fur Powerline Kommunikation system.
Furkschau 1 (1998), 40–43.
[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