Single Phase Power / Energy IC with SPI Interface sames SA9903B + FEATURES + Bi-directional active + + + + and reactive power/energy measurement RMS Voltage and frequency measurement SPI communication bus Meets the IEC 521/1036 Specification requirements for Class 1 AC Watt hour meters Meets the IEC 1268 Specification requirements for VAR hour meters Protected against ESD Total power consumption rating below 25mW Adaptable to different current sensor technologies Operates over a wide temperature range Precision voltage reference on-chip + + + + + DESCRIPTION The SAMES SA9903B is a single phase bi-directional energy/power metering integrated circuit that performs measurement of active and reactive power, mains voltage and mains frequency. This innovative universal single phase power/energy metering integrated circuit is ideally suited for energy calculations in applications such as electricity dispensing systems (ED's), residential municipal metering and factory energy metering and control. The SA9903B is pin compatible to the SA9603B. New features include, RMS mains voltage and accurate reactive power measurements. TheSA9903B integrated circuit is available in both 20 pin dualin-line plastic (DIP-20), as well as 20 pin small outline (SOIC20) package types. Measured values for active and reactive energy, the mains voltage and frequency are accessible through a SPI bus from 24 bit registers. TEST VDD VSS ACTIVE IIP CURRENT ADC IIN DI DO REACTIVE SPI RMS VOLTAGE IVP SCK CS VOLTAGE ADC MAINS. FREQ. FMO VOLTAGE REF. GND OSC Dr-01583 VREF OSC1 OSC2 Figure 1: Block diagram SPEC-0051 (REV. 2) 1/12 26-02-01 sames SA9903B ELECTRICAL CHARACTERISTICS (VDD = 2.5V, VSS = -2.5V, over the temperature range -10°C to +70°C#, unless otherwise specified.) Symbol Min Operating temp. Range TO Supply Voltage: Positive Typ Max Unit -25 +85 °C VDD 2.25 2.75 V Supply Voltage: Negative VSS -2.75 -2.25 V Supply Current: Positive IDD 3.56 5.1 mA Supply Current: Negative ISS 3.56 5.1 mA Parameter Condition Current Sensor Inputs (Differential) Input Current Range III -25 +25 µA Peak value IIV -25 +25 µA Peak value Voltage Sensor Input (Asymmetrical) Input Current Range Oscillator Pin VREF Ref. Current Ref. Voltage Recommended crystal: TV colour burst crystal f = 3.5795 MHz -IR VR 45 1.1 VIH VIL VDD-1 50 55 1.3 µA V VSS+1 V V With R = 24kW connected to VSS Reference to VSS Digital I/O Pins SCK High Voltage Low Voltage fSCK tLO tHI Pins CS, DI High Voltage Low Voltage VIH VIL Pins FMO, DO Low Voltage High Voltage VOL VOH 800 0.6 0.6 VDD-1 VDD-1 kHz µs µs VSS+1 V V VSS+1 V V IOL = 5mA IOH = -2mA ABSOLUTE MAXIMUM RATINGS* Parameter Symbol Min Max Unit Supply Voltage VDD -VSS -0.3 6.0 V Current on any pin IPIN -150 +150 mA Storage Temperature TSTG -40 +125 °C Operating Temperature TO -40 +85 °C *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 condition 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. http://www.sames.co.za 2/12 3 sames SA9903B PIN DESCRIPTION PIN Designation 20 GND 8 VDD Positive Supply voltage. The voltage to this pin is typically +2.5V if a shunt resistor is used for current sensing or in the case of a current transformer a +5V supply can be applied. 14 VSS Negative Supply Voltage. The voltage to this pin is typically -2.5V if a shunt resistor is used for current sensing or in the case of a current transformer a 0V supply can be applied. 19 IVP Analog Input for Voltage. The current into the A/D converter should be set at 14µARMS at nominal mains voltage. The voltage sense input saturates at an input current of ±25µA peak. 1, 2 IIN, IIP Inputs for current sensor. The shunt resistor voltage from each channel is converted to a current of 16µARMS at rated conditions. The current sense input saturates at an input current of ±25µA peak. 3 VREF This pin provides the connection for the reference current setting resistor. A 24kW resistor connected to VSS sets the optimum operating condition. 7 TEST Manufacturers test pin, connect to VSS for normal operation. 10, 11 OSC1, OSC2 12 SCK Serial clock in. This pin is used to stobe data in and out of the SA9903B 13 DO Serial data out. Data from the SA9903B is strobed out on this pin. DO is only driven when CS is active. 15 FMO 17 DI Serial data in. Data is only accepted during an active chip select (CS). 18 CS Chip select. The CS pin is active high. 4, 5, 6, 9, 16 TP4, TP5, TP6, TP9, TP16 Analog Ground. The supply voltage to this pin should be mid-way between VDD and VSS. Connections for a crystal or ceramic resonator. (OSC1 = input; OSC2 = Output) Voltage zero crossover. The FMO output generates a pulse (50% duty cycle) on every rising edge of the mains voltage. IIN 1 20 GND IIP 2 19 IVP VREF 3 18 CS TP4 4 17 DI TP5 Description 5 16 TP16 TP6 6 15 FMO TEST 7 14 VSS VDD 8 13 DO TP9 9 12 OSC2 10 Manufacturers Test Pins. (Leave unconnected) ORDERING INFORMATION SCK 11 OSC1 DR-01225 Figure 2: Pin connections: Package: DIP-20, SOIC-20 http://www.sames.co.za 3/12 Part Number Package SA9903BPA DIP-20 SA9903BSA SOIC-20 sames SA9903B FUNCTIONAL DESCRIPTION Current Sense Input (IIP and IIN) Figure 8 shows the typical connections for the current sensor input. The resistor R6 and R7 define the current level into the current sense inputs of the SA9903B. At rated current the resistor values should be selected for input currents of 16µARMS. Values for resistors R6 and R7 may be calculated as follows: The SA9903B is a CMOS mixed signal Analog/Digital integrated circuit, which performs the measurement of active power, reactive power, RMS voltage and mains frequency. The integrated circuit includes all the required functions for singlephase power and energy measurement such as two oversampling A/D converters for the voltage and current sense inputs, power calculation and energy integration. R6 = R7 = (IL / 16µA ) x RSH / 2 Where IL = Max line current RSH = Shunt resistor or termination resistor. The SA9903B integrates instantaneous active and reactive power in 24 bit integrators. RMS voltage and frequency is continuously measured and stored in respective registers. The mains voltage zero crossover is available on the FMO output. The voltage drop across RSH should not be less than 16mV at rated currents. In case a current transformer is used for current sensing the value of RSH should be less than the resistance of the CT's secondary winding. The SPI interface of the SA9903B has a tri-state output that allows connection of more than one metering device on a single SPI bus. Voltage Sense Input (IVP) The mains voltage is divided to 14VRMS.at nominal mains voltage by means of resistors R1, R2, R3 and R4. The current into the voltage sense input is set at 14µARMS with resistor R5 from the voltage divider. The voltage sense input of the AD converter saturates at an input current of ±25µA peak. INPUT SIGNALS Analog Input Configuration The input circuitry of the current and voltage sensor inputs is illustrated in figure 3. These inputs are protected against electrostatic discharge through clamping diodes. The feedback loops from the outputs of the amplifiers AI and AV generate virtual shorts on the signal inputs. Exact duplications of the input currents are generated for the analog signal processing circuitry. The current and voltage sense inputs are identical. Both inputs are differential current driven up to ±25µA peak. One of the voltage sense amplifier input terminals is internally connected to GND. This is possible because the voltage sense input is much less sensitive to externally induced parasitic signals compared to the current sense inputs. Reference Voltage (VREF) The VREF pin is the reference for the bias resistor. With a bias resistor of 24kW optimum conditions are set. It may be varied within ±10% for calibration purposes. Serial Clock (SCK) The SCK pin is used to synchronize data interchange between the micro controller and the SA9903B. The clock signal on this pin is generated by the micro controller and determines the data transfer rate of the DO and DI pins. Serial Data In (DI) The DI pin is the serial data input pin for the SA9903B. Data will be input at a rate determined by the Serial Clock (SCK). Data will be accepted only during an active chip select (CS). V DD IIP CURRENT SENSOR INPUTS VSS AI VDD Chip Select (CS) The CS input is used to address the SA9603B. An active high on this pin enables the SA9903B to initiate data exchange. IIN VSS VDD IVP VOLTAGE SENSOR INPUT V SS AV GND DR-01288 Figure 3: Analog input internal configuration http://www.sames.co.za 4/12 sames SA9903B OUTPUT SIGNALS SPI - INTERFACE SERIAL DATA OUT (DO) DESCRIPTION The DO pin is the serial data output pin for the SA9903B. The Serial Clock (SCK) determines the data output rate. Data is only transferred during on active chip select (CS). This output is tri-state when CS is low. A serial peripheral interface bus (SPI) is a synchronous bus used for data transfers between a micro controller and the SA9903B. The pins DO (Serial Data Out), DI (Serial Data In), CS (Chip Select), and SCK (Serial Clock) are used in the bus implementation. The SA9903B is the slave device with the micro controller the bus master. The CS input initiates and terminates data transfers. A SCK signal (generated by the micro controller) strobes data between the micro-controller and the SCK pin of the SA9903B device. The DI and DO pins are the serial data input and output pins for the SA9903B, respectively. MAINS VOLTAGE SENSE ZERO CROSSOVER (FMO) The FMO output generates a signal, which follows the mains voltage zero crossings, see figure 4. The micro controller may use the FMO to extract mains timing. ELECTROSTATIC DISCHARGE (ESD) PROTECTION The SA9903B Integrated Circuit's inputs/outputs are protected against ESD. REGISTER ACCESS The SA9903B contains four 24 bit registers. The content represents active energy, reactive energy, mains voltage and mains frequency. The register addresses are shown in the following table: POWER CONSUMPTION The power consumption rating of the SA9903B integrated circuit is less than 25mW. Header A5 A4 A3 A2 A1 A0 bits ID Register 1 Active 1 1 0 X X 0 0 0 0 2 Reactive 1 1 0 X X 0 0 0 1 3 Voltage 1 1 0 X X 0 0 1 0 4 Frequency 1 1 0 X X 0 0 1 1 Voltage +5V (VDD) FM0 0V (VSS) Dr-01498 Figure 4: Mains voltage zero corssover pin FMO http://www.sames.co.za 5/12 sames SA9903B The sequence 110 (0x06) must precede the 6-bit address of the register being accessed. When CS is HIGH, data on pin DI is clocked into the SA9903B on the rising edge of SCK. Figure 5 shows the data clocked into DI comprising of 1 1 0 A5 A4 A3 A2 A1 A0. SCK t3 t4 DI Address locations A5 and A4 are included for compatibility with future developments. t2 t5 DO Registers may be read individually and in any order. After a register has been read, the contents of the next register value will be shifted out on the DO pin with every SCK clock cycle. Data output on DO will continue until CS is inactive. t1 CS DR-01545 The 9 bits needed for register addressing can be padded with leading zeros when the micro-controller requires a 8 bit SPI word length. The following sequence is valid: 0000 0001 10A5A4 Parameter Description A3A2A1A0 Min Max t1 SCK rising edge to DO valid 625ns 1.160µs DATA FORMAT t3 SCK min high time 625ns Figure 5 shows the SPI waveforms. After the least significant digit of the address has been entered on the rising edge of SCK, the output DO goes low with the falling edge of SCK. Each subsequent falling edge transition on the SCK pin will validate the next data bit on the DO pin. t4 SCK min low time 625ns t2 Setup time for DI and CS before the rising edge of SCK 20ns t5 The content of each register consists of 24 bits of data. The MSB is shifted out first. DI hold time 625ns Figure 6: SPI Timing diagrams with timing information SCK CS Read command DI 1 1 Register address 0 A5 A4 A3 A2 A1 A0 Register Data DO 0 D23 D22 Next data register D21 Figure 5: SPI waveforms http://www.sames.co.za 6/12 D1 D0 D23 D22 D1 D0 High impedance sames SA9903B ACTIVE AND REACTIVE REGISTER VALUES USING THE REGISTER VALUES The active and reactive registers are 24 bit up/down counters, that increment or decrement at a rate of 320k samples per second at rated conditions. The register values will increment for positive energy flow and decrement for negative energy flow as indicated in figure 7. The active and reactive registers are not reset after access, so in order to determine the correct register value, the previous value read must be subtracted from the current reading. The data read from the registers represents the active or reactive power integrated over time. The increase or decrease between readings represent the measured energy consumption. ACTIVE ENERGY REGISTER The active energy measured by the SA9903B is calculated as follows: Energy = VRATED x IRATED x N / INTTIME / 320000 VRATED Rated mains voltage of meter IRATED Rated mains current of meter N Difference in register values between successive reads (delta value) INTTIME Time difference between successive register reads (in seconds) Register wrap around REACTIVE ENERGY REGISTER The reactive energy measured by the SA9903B is calculated as follows: Positive energy flow Register values 0 H7FFFFF ................ (8388607) H800000 (8388608) Reactive = VRATED x IRATED x N / INTTIME / 320000 VRATED Rated mains voltage of meter IRATED Rated mains current of meter N Difference in register values between successive reads (delta value) INTTIME Time difference between successive register reads (in seconds) HFFFFFF ................ (16777215) Negative energy flow Register wrap around DR-01590 Figure 7: Register increment / decrement showing the register wrap around MAINS VOLTAGE REGISTER At rated conditions, the active and reactive registers will wrap around every 52 seconds. The micro controller program needs to take this condition into account when calculating the difference between register values. The RMS voltage measurement is accurate to 1% in a range of 50% to 115% of rated mains voltage. The RMS mains voltage measured by the SA9903B is calculated as follows: As an example lets assume that with a constant load connected, the delta value (delta value = present register previous / register value) is 22260. Because of the constant load, the delta value should always be 22260 every time the register is read and the previous value subtracted (assuming the same time period between reads). However this will not be true when a wrap around occurs, as the following example will demonstrate: Description Present register value Valiable Decimal MAINS FREQUENCY REGISTER Bits D0 to D9 represents a counter value that is scaleable to the mains frequency measured. The mains frequency measured by the SA9903B is calculated as follows: Hex new_val 16767215 0x00FFD8EF Previous register value old_val new_val - old_val = Voltage = VRATED x VREGISTER VALUE / 700 VRATED Rated mains voltage of meter VREGISTER VALUE Voltage register value delta_val Frequency = FCRYSTAL / 256 / FREGISTER VALUE FCRYSTAL The external crystal frequency. FREGISTER VALUE Bits D9 to D0 of the frequency register. 16744955 0x00FF81FB 22260 0x000056F4 The register now wraps around so after the next read Bits D10 to D22 are not used in the frequency register. Bit D23 is set with the same status as the FMO output. the values are as follows: Present register value new_val Previous register value old_val new_val - old_val = 12260 0x00002FE4 16767215 0x00FFD8EF delta_val -16754955 0x00FFA90B Computing this delta value will result in incorrect calculations. http://www.sames.co.za 7/12 sames SA9903B TYPICAL APPLICATION VOLTAGE DIVIDER In figure 8, the components required for a two wire single phase power/energy metering section of a meter, is shown The application uses a shunt for the mains current sensing. The metering section described in this section will be designed for measuring 230V/80A with precision better than Class 1 The voltage divider is calculated for a voltage drop of 14V+2.3% (14.33V). Equations for the voltage divider in figure 8 are: The most important external components for the SA9903B integrated circuit are the current sense resistors, the voltage sense resistors as well as the bias setting resistor. The resistors used in the metering section should be of the same type so temperature effects are minimized. BAIS RESISTOR R8 defines all on-chip and reference currents. With R8=24kW, optimum conditions are set. The meter calibration is implemented in software. SHUNT RESISTOR The voltage drop across the shunt resistor (RSH) at rated current should be at least 20mV. A shunt resistor of 625µW is chosen. The voltage drop across the shunt resistor is 50mV at rated conditions (Imax for the meter). CURRENT SENSE RESISTORS The resistors R6 and R7 define the current level into the current sense inputs of the device. The resistor values are selected for an input current of 16µA on the current inputs at rated conditions. RA = R1 + R2 + R3 RB = R4 || R5 Combining the two equations gives: ( RA + RB ) / 230V = RB / 14.33V Values are chosen for R4 = 24kW and R5 =1MW. Substituting the values result in: RB = 23.4375kW RA = RB ( 230V / 14.33V - 1 ) RA = 352.7kW. Resistor values of R1, R2 and R3 are chosen to be 110kW, 110kW and 130kW. CRYSTAL OSCILLATOR A color burst TV crystal with f = 3.5795MHz is used for the oscillator. The oscillator frequency is divided down to 1.7897MHz on-chip, to supply the A/D converters as well as the digital circuitry. According to equation described in the Current Sense inputs section: R6 = R7 = (IL / 16µA) x RSH / 2 = 80A / 16µA x 625µW / 2 =1.5625kW A resistor value of 1.6k is chosen, the -2.3% deviation from the calculated value will be compensated for when calculating the resistor values for the voltage path. http://www.sames.co.za 8/12 http://www.sames.co.za Figure 8: Typical application circuit 9/12 LIVE NEUTRAL LIVE NEUTRAL RSH R9 -2V5 C6 +2V5 R1 C5 R8 R7 R6 R2 D2 D1 10 9 8 7 6 5 4 3 2 1 SA9903B X1 OSCO TP9 VDD TEST TP2 TP3 TP4 VREF IIP IIN U1 R3 R11 + C4 + C3 R10 OSCI DI DO VSS FMO TP16 DI CS IVP GND dr-01589 11 12 13 14 15 16 17 18 19 20 D4 D3 -2V5 R5 -2V5 C1 C2 +2V5 R4 GND SCK SDO FMO SDI CS SA9903B sames sames SA9903B Parts List for Application Circuit: Figure 8 Symbol Description U1 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 RSH C1 SA9903B Resistor, 110k, 1/4W, 1% metal Resistor, 110k, 1/4W, 1% metal Resistor, 130k, 1/4W, 1% metal Resistor, 24k, 1/4W, 1% metal Resistor, 1M, 1/4W, 1% metal Resistor, 1.6k, 1/4W, 1% metal Resistor, 1.6k, 1/4W, 1%, metal Resistor, 24K, 1/4W, 1%, metal Resistor, 47R, 2W, 5%, wire wound Resistor, 680R, 1/4W, 1%, metal Resistor, 680R, 1/4W, 1%, metal Shunt Resistor, 80A/50mV Capacitor, 220nF, ceramic C2 C3 C4 C5 C6 D1 D2 Capacitor, 220nF, ceramic Capacitor, 220uF, 16V, electrolytic Capacitor, 220uF, 16V, electrolytic D3 D4 X1 Capacitor, 470nF, 250VAC, polyester Capacitor, 820nF, ceramic Diode, 1N4003 Diode, 1N4003 Diode, Zener, 2.5V Diode, Zener, 2.5V Crystal, 3.579545MHz Note 1: Capacitor C6 to be positioned as close as possible to supply pins VDD and VSS of U1 as possible. http://www.sames.co.za 10/12 Detail DIP-20/SOIC-20 Note 1 sames SA9903B http://www.sames.co.za 11/12 sames PM9607AP SA9903B 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: [email protected] For the latest updates on datasheets, please visit our web site: http://www.sames.co.za. SOUTH AFRICAN MICRO-ELECTRONIC SYSTEMS DIVISION OF LABAT TECHNOLOGIES (PTY) LTD Tel: (012) 333-6021 Tel: Int +27 12 333-6021 Fax: (012) 333-8071 Fax: Int +27 12 333-8071 33 ELAND STREET KOEDOESPOORT INDUSTRIAL AREA PRETORIA REPUBLIC OF SOUTH AFRICA P O BOX 15888 33 ELAND STREET LYNN EAST 0039 REPUBLIC OF SOUTH AFRICA http://www.sames.co.za 12/12