INTRODUCTION
This application note describes a simple method for
measuring parameters from the AC power line.
Parameters such as zero crossing, frequency, and
relative phase can be measured. This method is useful
for measurements on 50, 60, and 400 Hz power
systems with voltages up to several hundred volts. The
method requires only one external component, a
resistor, and is more reliable than previously published
methods using capacitors or bulky, expensive
transformers.
APPLICATIONS
This measurement method can be used in any
application where power line parameters are used for
system measurements or control. Typical applications
are; switch timing (what part of the power cycle should
the system be activated), power factor correction,
power measurement, and power line monitor. An additional application is to generate timing or clock functions using the relatively stable power line frequency.
This method is also useful for calibrating oscillator frequency for accurate timing measurements when an
inaccurate reference such as an RC oscillator is used
to clock the PIC16C5X.
THEORY OF OPERATION
This application takes advantage of the input static
protection circuitry that exists on all I/O pins of a CMOS
PIC16C5X. These protection circuits are designed to
short the inputs to the power supplies when a large
overvoltage is applied, thus protecting the chip from
static electricity spikes. On PIC16C5X microcontrollers,
this protection circuit is two large P-N diodes on each
input (Figure 1). These diodes will short any voltage
higher than VDD to the VDD supply and any voltage less
than VSS to the VSS supply. They can take several milliamps of current without any damage to the chip. High
voltages can be applied directly to the chip inputs as
long as they are current limited