nProtected against ESD
nTotal power consumption rating below
500mW (excluding current sensing)
DESCRIPTION
The SAMES single phase power/energy metering module, the PM9603AP, provides
energy data via a isolated SPI interface.
Energy consumption is determined by the power measurement being integrated over
time.
The method of calculation takes the power factor into account.
The output of this innovative universal power/energy meter is ideally suited for energy
calculations in applications using a micro-controller.
The application utilises the SAMES SA9603B power metering integrated circuit for power
measurement.
As a safety measure, this application shows the current sensor connected to the neutral
line. In practice, the live line may be used for current sensing, provided that the supply
connections (MAINS) are reversed on the module.
nUses a shunt resistor for current sensing
nOperates over a wide temperature
range
nIsolated SPI interface.
7131 PDS038-SA9603B-001 REV.A 5-09-97
1/16
Page 2
PM9603AP
BLOCK DIAGRAM
NEUTRAL
NEUTRAL
NEUTRAL
LIVE
IN
OUT
IN
SHUNT
POWER
SUPPLY
VOLTAGE SENSE
SA9603B
POWER
METER
WITH
SPI BUS
DR-01349
OPTOCOUPLER
OPTOCOUPLER
D-sub CONNECTOR
ABSOLUTE MAXIMUM RATINGS*
ParameterSymbolMinMaxUnit
Supply Voltage (Note 1)V
Current Sense Input (Note 1)V
Storage TemperatureT
Operating TemperatureT
Max CurrentI
through SensorI
STG
MAX
MAX
AC
IV
-2.5+2.5 V
-25+125 °C
O
-10 +70 (Note 2) °C
300 V
800 (Note 3) A
2000 (Note 4) A
Note 1: Voltages are specified with reference to Live.
Note 2: The SA9603B integrated circuit is specified to operate over the temperature
range -10°C to +70°C. The module functionality will however depend upon the
external components used.
Note 3: t = 500ms
Note 4: t = 1ms
*Stresses above those listed under “Absolute Maximum Ratings” may cause permanent
damage to the device. This is a stress rating only. Functional operation of the device
at these or any other conditions above those indicated in the operational sections of this
specification, is not implied. Exposure to Absolute Maximum Ratings for extended
periods may affect device reliability.
2/18
sames
Page 3
PM9603AP
ELECTRICAL CHARACTERISTICS
(Over the temperature range -10°C to +70°C, unless otherwise specified. Power
consumption figures are applicable to the PM9603APE only.)
Parameter SymbolMinTypMaxUnitCondit ion
Supply Voltage V
AC
180230265 VPM9603APE
(Continuous) 90115135 VPM9603APA
Power Measurement P
RNG
-1840018400 WSpecified
rangeaccuracy
Power Consumption
1
800mWVAC = 230V
Supply direct
from mains
Isolation Voltage
2
V
IS
2500 VContinuous
Opto-coupler Output
Current I
O
10mAVOL = 1V
Opto-coupler Input
Current I
I
10mA
Note 1: Power consumption specifications exclude power consumed by the current
sensor.
Note 2: Isolation voltage may be specified, depending on customer requirements.
CONNECTION DESCRIPTION
DesignationDescription
MAINS
Voltage supply connection to Neutral line
Voltage supply connection to Live line
NEUTRAL INConnection to positive side of current sensor
NEUTRAL OUTConnection to negative side of current sensor
SK1P1 Supply (+ve) to opto-couplers
25-Way femaleP2 Input SA9603B - SCK
(D-type)P8 Input SA9603B - DI
P9 Input SA9603B - CS
P12 Output SA9603B - DO
P18, 20-25 Common emitters and cathodes opto-couplers
sames
3/18
Page 4
PM9603AP
FUNCTIONAL DESCRIPTION
1. Power Calculation
In the Application Circuit (see Figure 2), the output current from the current sensor
will be between 0 and 16µA
(0 to 80A through a shunt resistor of 625µΩ). The
RMS
current input stage of the module, saturates at input currents greater than 18µA
The mains voltage (Voltage + 15% - 20%) is used to supply the circuitry with power.
A SA9603B utilize current information from the current sensor (shunt resistor),
together with the mains voltage to perform the power calculation.
The SA9603B integrated circuits may be adjusted to accommodate any voltage or
current values. The method for calculating external component values is described
in paragraph 6 (Circuit Description).
SAMES offers two evaluation module options, namely 230V/80A and 115V/80A.
The on chip registers are accessed via the isolated SPI bus.
2. Electrostatic Discharge (ESD) Protection
The device's inputs/outputs are protected against ESD according to the Mil-Std
883C, method 3015. The modules resistance to transients will be dependant upon
the protection components used.
3. Power Consumption
The overall power consumption rating for this power metering application (Figure 2),
is under 500mW, excluding the current sensor, when the supply is taken directly from
the mains.
RMS
.
4. Isolation
The reference of the module is connected to neutral.
5. Isolated Input/Output Interface
The isolated interface is provided to allow the user to access the registers of the
SA9603B.
A 25-Way D type connector (female) is provided on the PM9603AP module. The
connector SK1 connects via a one to one connected cable to a Personal Computer
parallel port.
6. Circuit Description
In the Application Circuits, (Figures 1), the components required for power metering
applications are shown.
In Figure 1, a shunt resistor is used for current sensing. In this application, the
circuitry requires a +2.5V, 0V, -2.5V DC supply.
4/18
sames
Page 5
PM9603AP
The current sense input requires a differential approach to cater for precision across
the dynamic range. It is therefore important that the PC board layout of the branches
to the sensing element, are as symmetrical as possible and the loop area is kept to
a minimum.
The most important external components for the SA9603B integrated circuit are:
R2, R1 and RSH are the resistors defining the current level into the current sense input.
The values should be selected for an input current of 16µA
into the SA9603B at
RMS
rated line current.
Values for RSH of less than 200µΩ should be avoided.
R1 = R2 = (IL/16µA
Where I
L
) * RSH/2
RMS
=Line current
RSH =Shunt resistor/termination resistor
R3, R6 and R4 set the current for the voltage sense input. The values should be
selected so that the input current into the voltage sense input (virtual ground) is set
to 14µA
RMS
.
R7 defines all on-chip bias and reference currents. With R7 = 24kΩ, optimum
conditions are set.
XTAL is a colour burst TV crystal (f = 3.5795MHz) for the oscillator. The oscillator
frequency is divided down to 1.7897MHz on-chip and supplies the A/D converters
and the digital circuitry.
7. Demonstration Software
Software which runs under Windows 3.1 and Windows 95 is provided with each
evaluation module. See README.TXT on the diskette supplied for the installation
instructions.
8. Sample C source code
The following software demonstrates how to synchronize the reading of the registers
to the SA9603B's internal offset cancellation scheme. The software is also available
on the SAMES Internet web pages.
sames
5/18
Page 6
PM9603AP
Figure 1: Connection Diagram
L
N
OU T
OU T
14
1
PARALLE L P OR T
R16
R14
R4
25
132513
R17
R18
R15
P M 960 3A P
S AME S
LK1
R13
R11
LK2
R12
C12
6/18
OP TIONA L
R1A
R3B
SHUNT
R3A
L
N
IN
IN
R7
R2
R1
R6
R10
C14
D2
R5
C15
C10
ZD1
ZD2
D1
C11A
XTAL
C9
R9
C13
C11B
DR -01350
sames
Page 7
PM9603AP
APPLICATION CIRCUIT
Figure 2: Application using a Shunt Resistor for Current Sensing, having a
// This program will read the registers from a SA9603B device
and
// display the content on the screen.
// The program work on a PM9603AP demonstration module.
#include <stdio.h>
#include <math.h>
#define PI 3.141593
#define win_size 20
// Definitions for the parallel port
#define CLK_b 0x20 //D5 on port pin 7
#define DO_b 0x40 //D6 on port pin 8
#define DI_b 0x20 //Paper out pin 12
#define CS_b 0x80 //D7 on port pin 9
#define PCTrig 0x02 //D1 on port pin 3
//#define freq_bits 0x00FFFF
//#define inv_bits 0x0C0000
// Mask definitions for the parallele port
#define CLK_m ~CLK_b //D5 on port pin 7
#define DO_m ~DO_b //D6 on port pin 8
#define DI_m ~DI_b //Paper out pin 12
#define CS_m ~CS_b //D7 on port pin 9
#define byte_mask 0x80 //1000 0000
double
arr_energy[win_size],arr_volt[win_size],arr_reactive[win_size];
long delay_time;
10/18
sames
Page 11
PM9603AP
int prt, buffindex = 0;
double convert_24bits(double value)
// This function will sort out the 24 bits of the register
values
{
if (fabs(value) > 0x7FFFFF)
{
if (value > 0)
value = (16777216-value) * (-1);
else
value = (16777216+value)* (1);
}
return(value);
}
void spi_wait(void)
// This function will wait for the specified period, very
short time
{
int ti;
for (ti = 1; ti < 1 ; ti++);
}
void spi_out(unsigned char value)
// Put value on the parallel port
{
int n;
portval = value;
outport(prt,(~portval));
// Remove the ~ if you dont use opto couplers
for(n=0 ; n< delay_time ; n++); // Specify the pulse
width
}
void spi_clock(void)
// This function will pulse CLK pin of spi port
{
spi_wait();
spi_out(portval | CLK_b); // or
spi_wait();
sames
11/18
Page 12
PM9603AP
spi_out(portval ^ CLK_b); // xor
}
void spi_PCTrig(void)
// This function will set the PC trigger pin
{
spi_out(portval & (~PCTrig)); // and
spi_wait();
}
void spi_ClearPCTrig(void)
// This function will clear the PC trigger pin
{
spi_out(portval | PCTrig); // or
}
void spi_cs(void)
// This function will set CSs pin of spi port
{
spi_out(portval | CS_b); // or
}
void spi_reset(void)
// all bits of the port are made 0
{
spi_out(portval & CLK_m);
spi_out(portval & DO_m);
spi_out(portval & CS_m);
}
void spi_start_read(unsigned char value)
// All bits of the port are made 0
{
int counter;
unsigned char and_mask,mask;
mask = 0x80;
value = (value | 0xC0 ); // Put the header for the
adress 110—
value = value << 1;
}
spi_clock(); // sort out the extra clock cycle
between command & response
}
unsigned long spi_read_register(void)
// This function will read 24 bits of a register
// the register to be red would be indicated by the
// preceding spi_start_read function
{
int counter;
unsigned char and_mask,mask;
unsigned long fromport;
// Get the rising edge if the inversion bits
if (((freq & bits_50hz) == bits_50hz ) //D19
is now set
&& ((old_freq & bits_50hz) != bits_50hz)) //D19
was not set previously
{
// The following is used to indicate that
//registers is read every 8th mains cycle
spi_PCTrig();
delay(1);
spi_ClearPCTrig();
//del_time is the amount of inversion cycles to
wait before
//reading the rest of the register values.
del_time ++;
}
if(del_time == 10) // 5 x 8 mains cycles time to
integrate registers
{
// spi_PCTrig();
// Now calculate the incremental difference and take care of
register
// overflow as well as the sign of register values
active = convert_24bits(act - act1);
reactive = convert_24bits(react - react1);
voltage = convert_24bits(volt1 - volt);
k = (1/((double)(freq&freq_bits)*del_time)) * 80
* 230/(1.44*2);
fm = (double)((CLOCKFREQ/2)/((double)(freq &
freq_bits)));
vm = (double)voltage * ((14/17.5)*0.63)/
((double)(freq&freq_bits)*del_time) *230;
first = 0;
act1 = act;
react1= react;
volt1 = volt;
del_time = 0;
}
}//while
}
16/18
sames
Page 17
Notes:
PM9603AP
sames
17/18
Page 18
PM9603AP
Disclaimer:The information contained in this document is confidential and proprietary to South African Micro-
Electronic Systems (Pty) Ltd ("SAMES") and may not be copied or disclosed to a third party, in whole or in part,
without the express written consent of SAMES. The information contained herein is current as of the date of
publication; however, delivery of this document shall not under any circumstances create any implication that the
information contained herein is correct as of any time subsequent to such date. SAMES does not undertake to inform
any recipient of this document of any changes in the information contained herein, and SAMES expressly reserves
the right to make changes in such information, without notification,even if such changes would render information
contained herein inaccurate or incomplete. SAMES makes no representation or warranty that any circuit designed
by reference to the information contained herein, will function without errors and as intended by the designer.
Any Sales or technical questions may be posted to our e-mail address below:
energy@sames.co.za
For the latest updates on datasheets, please visit out web site:
http://www.sames.co.za
South African Micro-Electronic Systems (Pty) Ltd
P O Box 15888,33 Eland Street,
Lynn East,Koedoespoort Industrial Area,
0039Pretoria,
Republic of South Africa,Republic of South Africa