NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
UM0981 STM8L152C6 STPM01 STEVAL-IPE012V1 RS232 STPM01BTR TSSOP20 LQFP48 TL431AI - Datasheet Archive
User manual Single-phase energy meter based on the STPM metering IC and STM8L152C6 MCU Introduction This document describes the
UM0981 UM0981 User manual Single-phase energy meter based on the STPM metering IC and STM8L152C6 STM8L152C6 MCU Introduction This document describes the functions of the single-phase energy meter based on the STPM metering IC and an STM8L152C6 STM8L152C6 microcontroller. The demonstration board is a fully functional single-phase solution with parameter display, tamper management, maximum demand (MD) calculation, EEPROM data logging, and low power management. Meter specifications: Accuracy: 1 % error with dynamic range 200:1 Nominal voltage: 240 V Nominal current: 5 A (ITYP) Maximum current: 45 A (IMAX) Operating range: 0.6 Vb to 1.2 Vb Meter constant: 3200 impulses/kWh Power frequency range: 45 Hz to 65 Hz Sensor: primary side CT and secondary side shunt Communication interface: IrDA®. Figure 1. November 2010 Single-phase energy meter solution based on STPM and STM8L Doc ID 17778 Rev 1 1/34 www.st.com Contents UM0981 UM0981 Contents 1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.1 2.2 Recommended reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 3 Safety rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Getting technical support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.1 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 Hardware installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.3 Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.3.1 System requirements for demonstration GUI . . . . . . . . . . . . . . . . . . . . . . 8 4 Hardware layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5 Hardware details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.1 Metering IC U1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.1.1 5.2 Clocking Y1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Microcontroller U2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.2.1 5.2.2 Switch SW1 and SW2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.2.3 Jumper J2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.2.4 5.3 LED D10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Clocking Y2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Power supply section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.3.1 5.3.2 Current sensor CT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.3.3 5.4 Programmable voltage reference U5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Shunt RS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Neutral missing power supply section . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.4.1 Current sensor CT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.5 EEPROM U3 section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.6 LCD section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.7 Battery management section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.7.1 2/34 Coin cell BT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Doc ID 17778 Rev 1 UM0981 UM0981 Contents 5.7.2 5.7.3 Small signal Schottky diode D11, D12, D13, D14, D5 . . . . . . . . . . . . . . 12 5.7.4 5.8 Rechargeable battery BT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Switch SW3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 IrDA section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.8.1 IRDA transceiver U6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.8.2 Jumper J6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.9 5.10 6 Magnetic sensor U4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Connector section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Single-phase energy meter features . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.1 Auto-calibration mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.1.1 Steps for auto-calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.2 EEPROM data log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.3 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.3.1 6.3.2 6.4 Meter run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Meter low power mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 LCD display modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 6.4.1 6.4.2 6.5 Meter run mode display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Meter low power mode display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Tamper detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 6.5.1 6.5.2 6.6 Tamper types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 LCD symbol for tamper condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 62056-21 IrDA protocol mode C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 6.6.1 6.6.2 6.7 7 IrDA modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 SerialIO GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Pulse out LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 EEPROM log data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 7.1 Size overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 7.2 Entry structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Appendix A Tamper definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Appendix B BOM list and schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 8 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Doc ID 17778 Rev 1 3/34 List of figures UM0981 UM0981 List of figures Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. Figure 11. 4/34 Single-phase energy meter solution based on STPM and STM8L . . . . . . . . . . . . . . . . . . . . 1 Electricity meter connection diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Hardware layout: top view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Hardware layout: bottom view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Auto-calibration mode connection diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 SerialIO GUI hardware setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 SerialIO GUI with protocol mode C settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Microcontroller schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Battery, connector, magnetic sensor and IrDA module schematics . . . . . . . . . . . . . . . . . . 30 Power supply, EEPROM, LCD and neutral missing power supply schematics . . . . . . . . . 31 STPM schematic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Doc ID 17778 Rev 1 UM0981 UM0981 1 Features Features The single-phase energy meter has the following features: Low cost single-phase energy meter solution Supports IEC 61036:1996 + A1: 2000, static meter for active energy class 1 for Ib=5 A Less than 4 VA power consumption for voltage circuit at reference voltage Less than 1 VA power consumption for current circuit at reference basic current Multiple tamper detection: earth, neutral missing, reverse, case tamper, magnetic tamper detection Case tamper detection also in power-down Detects signals and continues to measure accurately under tamper condition Rechargeable battery is available on the board for showing LCD parameters in case of power-down mode Active energy pulse output 3200 impulses/kWh Software based auto-calibration without the need of a reference meter, only the reference source is required Microcontroller in-built RTC for date and time display Microcontroller STM8L152C6 STM8L152C6 is responsible for all data management, display and power management STPM metering IC with 1st order sigma-delta ADC for energy measurements Single point and fast calibration of STPM for class 1 meter External EEPROM used to store calibration parameters, tampering information, cumulative energy, MD and power factor (PF) data Active power, current, voltage, power factor and line frequency measurements Numeric display precision (except cumulative energy): 5+2 digits Numeric display precision for cumulative energy: 5+1 digits Energy EEPROM log precision: 0.01 kWh. Doc ID 17778 Rev 1 5/34 Overview UM0981 UM0981 2 Overview 2.1 Safety rules This board can be connected to mains voltage (240 V). In the case of improper use, wrong installation or malfunction, there is a danger of serious personal injury and damage to property. All operations such as transport, installation and commissioning, as well as maintenance, should be carried out only by skilled technical personnel (regional accident prevention rules must be observed). Warning: 2.2 Due to the risk of death when using this prototype on mains voltage (240 V), only skilled technical personnel who are familiar with the installation, mounting, commissioning and operation of power electronic systems and have the qualifications needed to perform these functions, may use this prototype. Recommended reading This document describes how to use the multi-tariff meter demonstration board. Additional information can be found in the following documents: STM8L152C6 STM8L152C6; STM8L-Ultra Low Power-8 bits Microcontrollers, datasheet Component datasheets 2.3 STPM01 STPM01; Programmable single-phase energy metering IC with tamper detection, datasheet IEC 62056-21 IrDA protocol mode C Getting technical support For technical assistance, documentation, information and updates for products and services, please refer to your local ST distributor/office. 6/34 Doc ID 17778 Rev 1 UM0981 UM0981 Getting started 3 Getting started 3.1 Package The demonstration kit package includes the following items: Hardware content STEVAL-IPE012V1 STEVAL-IPE012V1 demonstration board Software SerialIO GUI for IrDA communication testing Documentation Presentation Schematic 3.2 User manual BOM list Hardware installation Connect the STEVAL-IPE012V1 STEVAL-IPE012V1 demonstration board with the mains supply before load. Please refer to Figure 2 for connection with mains power and load. Auto-scrolling LCD display indicates successful power-up of board. Figure 2. Electricity meter connection diagram Doc ID 17778 Rev 1 7/34 Getting started 3.3 UM0981 UM0981 Software installation The demonstration kit supports the SerialIO GUI for RS232 RS232 testing to check 62056-21 IrDA protocol mode C implementation. 3.3.1 System requirements for demonstration GUI For demonstration board communication with the GUI, a recent version of Windows, Windows XP must be installed on the PC. The SerialIO GUI does not require any driver installation. Note: Windows is a registered trademark of the Microsoft Corporation in the United States and other countries. The version of the Windows OS installed on the PC can be determined by clicking on the system icon in the control panel. 8/34 Doc ID 17778 Rev 1 UM0981 UM0981 4 Hardware layout Hardware layout The demonstration kit hardware is designed in a sectional approach to offer multiple functions to users. Figure 3. Hardware layout: top view Figure 4. Hardware layout: bottom view Doc ID 17778 Rev 1 9/34 Hardware details UM0981 UM0981 5 Hardware details 5.1 Metering IC U1 The programmable single-phase energy metering IC STPM01BTR STPM01BTR (package: TSSOP20 TSSOP20) is interfaced to a microcontroller using a 3-wire SPI interface. Active energy, apparent energy, instantaneous voltage, and instantaneous current values are obtained from the STPM metering IC. Auto-calibration is implemented to calibrate the STPM. 5.1.1 Clocking Y1 A 4.194 MHz crystal is used as the clock generator input for the metering IC. For more details about auto-calibration, please refer to Section 6.1: Auto-calibration mode. 5.2 Microcontroller U2 The microcontroller STM8l152C6 (package: LQFP48 LQFP48, 32K Flash, 2KB RAM, 48-pin) is responsible for all the data management and power management tasks. MCU consumes very lower power and has an in-built RTC for date and time management. 5.2.1 LED D10 LED D10 is the pulse out LED for cumulative energy. This is used for testing the energy meter energy calculation accuracy. 5.2.2 Switch SW1 and SW2 Switch SW1 is the reset switch for the microcontroller. Switch SW2 is the case tamper switch which is used to detect case tampering of energy meter solution. For more details, refer to Section 6.4: LCD display modes. 5.2.3 Jumper J2 Table 1. 3-pin jumper header Jumper J2 5.2.4 Close: 1-2 Close: 2-3 Microcontroller pin PA1 is connected Microcontroller pin PA1 is connected to reset switch SW1 to LED D10 Default Close: 2-3 Clocking Y2 A 32.768 kHz crystal is used as the clock input for LSE (low speed external) for the microcontroller RTC block. The microcontroller core is clocked by a HSI (high speed internal) clock. 10/34 Doc ID 17778 Rev 1 UM0981 UM0981 5.3 Hardware details Power supply section Capacitive power supply is used to build 3.6 V for the metering IC and microcontroller section. 5.3.1 Programmable voltage reference U5 A U5 TL431AI TL431AI (package TO-92) is used to regulate the 3.6 V supply. 5.3.2 Current sensor CT1 CT1 E4623-X002 E4623-X002 (2500 turns, series resistance: 61.5 ) is the sensor for the primary current channel. 5.3.3 Shunt RS1 RS1 500uOHM is the sensor for the secondary current channel. 5.4 Neutral missing power supply section The neutral missing power supply section is operational in the case of neutral missing tamper. In case of a neutral missing tamper condition, neutral is disconnected from the energy meter. Therefore, there is no voltage input and so no output would be generated by the main capacitive power supply. However, in the case of load present, there would be a valid input signal on the current channel so energy would be consumed. As the voltage on the neutral channel is zero, so is the power (P = V x I). In order to understand the energy consumed in this case, the neutral missing power supply section provides the voltage supply to the STPM metering IC. A zero crossing signal of 50 Hz is provided to the VIP pin of STPM, so STPM now calculates the energy consumption at a nominal voltage level of 240 V. 5.4.1 Current sensor CT2 CT2 is used to develop the power supply for the board using a diode full wave rectifier circuit in neutral missing condition. 5.5 EEPROM U3 section EEPROM M24C32-RMN6P M24C32-RMN6P (package: SO8, 32 Kbit) is interfaced to the microcontroller using an I2C bus. Cumulative energy, MD, average PF and tamper information for seven consecutive months is logged as months in EEPROM. For more details about EEPROM data logging, refer to Section 6.2: EEPROM data log. 5.6 LCD section LCD J3 is the connector for the external 18* 4 LCD glass. LCD glass OPT6089A OPT6089A (operating voltage 3 V, duty 1/4, bias 1/3) offers various energy meter specific symbols. LCD glass is driven by the microcontroller internal LCD driver. Doc ID 17778 Rev 1 11/34 Hardware details 5.7 UM0981 UM0981 Battery management section Two batteries are used in the circuit. 5.7.1 Coin cell BT1 BT1 CR2032 CR2032 (3 V, 225 mAh) is the microcontroller power source in halt mode to keep RTC running. 5.7.2 Rechargeable battery BT2 BT2 VL2330 VL2330 (3 V, 50 mAh) is for push button and IrDA operation when mains power is off. 5.7.3 rechargeable battery acts as power source for microcontroller section when push button is pressed during mains power off rechargeable battery is charged based on trickle charging mode during mains power on. Small signal Schottky diode D11, D12, D13, D14, D5 Diodes (D11, D12, D13, D14, and D5) BAT30KFILM BAT30KFILM (SOD - 523) based circuit is used to select the power source for the microcontroller. 5.7.4 Switch SW3 Switch SW3 is the push button switch which is used to control the LCD display modes. When mains power is on, once the push button is pressed, the LCD display is executed as per the push button run mode. When mains power is off, once the push button is pressed, the LCD display is executed as per the push button low power mode. 5.8 IrDA section 5.8.1 IRDA transceiver U6 The IrDA transceiver TFDU4300 TFDU4300 is used for IrDA communication. 5.8.2 Jumper J6 Using jumper J6, IrDA transmit and receive pins allow testing of the IrDA section using the SerialIO GUI. For more details, please refer to Section 6.6.2: SerialIO GUI. Table 2. Pin jumper headers Jumper Pin 2 J6 12/34 Pin1 PC3_IRDA_Tx IRDA transmit pin PC2_IRDA_Rx IRDA receive pin Doc ID 17778 Rev 1 UM0981 UM0981 5.9 Hardware details Magnetic sensor U4 The magnetic sensor AH180 AH180 (SC59-3L SC59-3L) is used to detect magnetic interference in the energy meter solution. Magnetic sensor outputs low when magnetic interference occurs. 5.10 Connector section The connector section comprises test points for different signals. Table 3. 4-pin jumper headers Jumper Pin1 J1 VDD J5 PA0_SWIM SWIM interface data pin Table 4. Pin2 Pin3 PA0_SWIM GND SWIM interface data pin PE6 GPIO GND Pin4 PA1_NRST_PULSE_LED LED pulse output/reset signal PE7_STPM_ZCR metering IC ZCR signal 3-pin jumper header Jumper Pin1 Pin 2 Pin3 J6 PC0_EEPROM_SDA I2C data signal PC1_EEPROM_SCL I2C clock signal GND Doc ID 17778 Rev 1 13/34 Single-phase energy meter features UM0981 UM0981 6 Single-phase energy meter features 6.1 Auto-calibration mode The STEVAL0-IPE012V1 STEVAL0-IPE012V1 demonstration board supports auto-calibration using an ideal reference source for 10 A and 240 V. Calibration is performed to minimize measurement errors and to increase the accuracy of the meter. When using auto-calibration mode, calibration parameters CHV (one byte calibration data for voltage channel), CHP (one byte calibration data for primary current channel), and CHS (one byte calibration data for secondary current channel), are calculated and programmed in registers of the metering IC. The procedure for meter calibration is explained below by firstly giving an overview of the hardware setup, and then by describing how to connect a calibration board. 6.1.1 Steps for auto-calibration Connect 240 V voltage source to phase and neutral of board Connect 10 A source to board Push button SW3 for more than 4 sec Board enters auto-calibration mode; "CALIB ON" is displayed on the board Once calibration is complete, the board returns to auto-scroll display mode. Figure 5. Auto-calibration mode connection diagram For more details of calibration parameters, refer to the STPM01 STPM01 datasheet. 14/34 Doc ID 17778 Rev 1 UM0981 UM0981 6.2 Single-phase energy meter features EEPROM data log Total EEPROM data log size: 920 bytes. Multiple parameters are stored in EEPROM, as below: The following metering parameters are logged in EEPROM memory for the current month and last six months Cumulative energy (CE) until last month Maximum demand (MD) Cumulative energy (CE) consumed in current month Average PF and averaging count Tamper entries; four types of tamper data storage is done: earth, reverse, neutral, and case tamper. For each type of tamper, the number of tamper entries per month is four. Two duplicate entries of cumulative energy are stored with CRC-8 value for error detection 10 bytes stored for calibration data at start of EEPROM including 3 bytes of CHV, CHP, and CHS Last power-down date and time log Overflow count for cumulative energy Number of times cumulative energy overflows from 99999.9 (maximum display precision). For further details, refer to Section 7. 6.3 Power management The STEVAL-IPE012V1 STEVAL-IPE012V1 demonstration board is designed with board power consumption 4 VA. The board supports two modes of operation: 1. 2. 6.3.1 Meter run Meter low power Meter run mode When mains power is on, the board operates in run mode. The board components are powered using a capacitive supply with main power line as the source. In this mode, the rechargeable battery is in charging mode based on the trickle charging technique. 6.3.2 Meter low power mode When mains power goes down, the onboard microcontroller enters halt mode and metering IC is off. In this mode, the microcontroller RTC is running and low, other peripherals are off. In halt mode, the microcontroller is powered using BT1. Therefore, push button SW3 is pressed in low power mode; BT2 supply connects to the supply input of the microcontroller and IrDA section, and so, in button pressed condition, BT2 is the main supply source. Doc ID 17778 Rev 1 15/34 Single-phase energy meter features UM0981 UM0981 Now the meter low power LCD display and IrDA communication are operational until push button SW3 is operational. 6.4 LCD display modes The STEVAL-IPE012V1 STEVAL-IPE012V1 demonstration board offers the user different parameters. The metering parameters display is configured in a specific manner based upon the power mode of the meter: 6.4.1 Meter run mode LCD display Meter low power LCD display Meter run mode display During the main power-on condition, all the critical parameters, with details of last month's logs for metering parameters, are available on the display. Parameter display is classified for mains on condition: Auto-scroll mode Push button display mode Auto-scroll mode In auto-scroll mode, the following parameters are displayed on the LCD one by one: Max demand (kW) of last month Note: Cumulative active energy (kWh) Average PF of last consumption month Auto-scroll mode interval (8sec) is configurable in "autoscroll_display.h" in the firmware. Push button mode In push button mode, the parameters listed below are displayed on the LCD on pressing push button SW3. Each button push displays the next push button parameter. If the push button is in pressed condition for 4 seconds, the board enters auto-calibration mode. For more details on auto-calibration, please refer to Section 6.1. In push button mode, the following parameters are displayed on the LCD: All LCD segments on Date and time Max demand since last reset Cumulative energy for last six months Max demand for last six months Instantaneous PF Instantaneous voltage Instantaneous current Instantaneous load in Watts. When the push button SW3 is released, the LCD display returns to auto-scroll mode after a push button mode interval (10 sec). Note: 16/34 Push button mode interval (8 sec) is configurable in "pushbutton_display.h" in the firmware. Doc ID 17778 Rev 1 UM0981 UM0981 6.4.2 Single-phase energy meter features Meter low power mode display In low power mode, the display is off until push button SW3 is pressed. When push button SW3 is pressed in low power mode, the display is on in auto-scroll display mode. The display is active until push button SW3 is in a pressed condition. 6.5 Tamper detection The STEVAL-IPE012V1 STEVAL-IPE012V1 demonstration board supports multiple tamper detection and their logging in EEPROM. 6.5.1 Tamper types The five types of tamper detection are: 1. 2. Reverse tamper 3. Neutral missing tamper 4. Case tamper 5. 6.5.2 Earth tamper Magnetic interference LCD symbol for tamper condition Earth tamper: Reverse tamper: Neutral missing tamper: Case tamper: Magnetic interference: Three tampers (earth, reverse and neutral missing) are detected using a software algorithm based on meter readings from the metering IC. In the case of neutral missing tamper detection, the board starts recording energy when the load current is 2 A or higher. Case tamper is detected using switch SW2 and magnetic interference is detected using magnetic sensor U4. Symbol 'BP' is shared for displaying case tamper as well as magnetic interference. It means if any of the tampers are detected, symbol 'BP' is displayed on the LCD. For tamper definitions, refer to Appendix A. Note: In the present solution, magnetic tamper is not logged in EEPROM. Logging can be easily done by modifying the EEPROM log structure. Doc ID 17778 Rev 1 17/34 Single-phase energy meter features 6.6 UM0981 UM0981 62056-21 IrDA protocol mode C The STEVAL-IPE012V1 STEVAL-IPE012V1 demonstration board supports 62056-21 IrDA protocol mode C. IrDA is used as the communication channel for reading meter data. In such systems, a handheld unit (HHU) or a unit with equivalent functions is connected to a tariff device (energy meter). The protocol offers five alternative protocol modes, A, B, C, D and E. This user manual covers mode C use. In mode C, data exchange is bi-directional and is always initiated by the HHU with the transmission of a request message. In this mode, the HHU acts as a master and the tariff device acts as a slave. These protocol modes permit meter reading, manufacturer specific operation and programming mode. It is designed to be highly suitable for electricity metering environments, particularly with regards to electrical isolation and data security. 6.6.1 IrDA modes Data read out mode In data read out mode, the tariff device responds with all the data logged in EEPROM as per EEPROM data structure (refer to Section 7). Each data block consists of a sequence of data lines separated by carriage return (CR) and line feed (LF). Manufacturer specific mode In manufacturer specific mode, RTC date and time setting is done Programming mode In programming mode, as per the protocol, data read and write can be done at different locations of EEPROM. 6.6.2 SerialIO GUI The SerialIO GUI can be used as the test GUI for 62056-21 IrDA protocol mode C implementation. Here, the protocol is tested using serial communication. For this testing, a daughter board with an RS232 RS232 converter is required to map PC serial data signals to 3.4 V data signals of the board. Steps for serial communication based protocol testing: 1. Comment "#defines IRDA_MODE_ENABLE" in "emter_irda.h" 3. Connect the RS232 RS232 daughter board as shown in Figure 6 4. 18/34 Demount R41 and R42 from board 2. Write data into the SerialIO GUI data box and send. Doc ID 17778 Rev 1 UM0981 UM0981 Single-phase energy meter features Figure 6. Figure 7. 6.7 SerialIO GUI hardware setup SerialIO GUI with protocol mode C settings Pulse out LED LED D10 is used as the pulse out for cumulative energy. It works on a meter constant of 3200impulses/kWh. The LED output can be used to test the accuracy of the meter. Doc ID 17778 Rev 1 19/34 EEPROM log data structure 7 UM0981 UM0981 EEPROM log data structure All the parameters below are stored in EEPROM: Calibration data (10 bytes): (3 bytes of CHV, CHP, and CHS then 7 times 0x00) Total cumulative energy: (at two locations - to keep duplicate entries) Total cumulative until last month: (monthly for last six months and current month) Maximum demand: (monthly for last six months and current month) Cumulative energy: (monthly for last six months and current month) Average PF and averaging count: (monthly for last six months and current month) Tamper information - earth, reverse, neutral missing, case tamper: (monthly for last six months and current month and four entries per month with count for tamper and date and time details) Count of cumulative energy overflow: count of cumulative energy overflow Date and time of last power-down; total size required: 920 bytes. The data storage structure in EEPROM is as follows: Calibration data (CHV, CHP, CHS) CE main entry with CRC N month: CE until last month: MD: CE current month: average PF: tamper N-1 month: CE until last month: MD: CE current month: average PF: tamper N-2 month: CE until last month: MD: CE current month: average PF: tamper N-3 month: CE until last month: MD: CE current month: average PF: tamper N-4 month: CE until last month: MD: CE current month: average PF: tamper N-5 month: CE until last month: MD: CE current month: average PF: tamper N-6 month: CE until last month: MD: CE current month: average PF: tamper CE duplicate copy with CRC Count for cumulative energy overflow Power-down date and time. Where N is the current month: In the current month log, data is updated at day end and on power-down Total cumulative energy log is updated half-hourly 20/34 All parameters are logged for a total of 7 months including one current and the last 6 months Month serial order is updated at 2400 hours on the last date of each calendar month. Doc ID 17778 Rev 1 UM0981 UM0981 7.1 EEPROM log data structure Size overview Table 5. EEPROM parameter size overview Parameter Size (in byte) Calibration data Total cumulative energy duplicate entry 1 7 (4 bytes + 2 bytes + 1 byte (CRC) Cumulative energy until last month 42 (7*6): without CRC Maximum demand log 63 (7*(3+3+3) Monthly cumulative energy log 42 (7*6) Average PF log 42 (7*4 + 7*2) Earth tamper log 175 (7*(4*(3+3) +1) Reverse log 175 (7*(4*(3+3)+1) Neutral missing log 175 (7*(4*(3+3) +1) Case tamper log 175 (7*(4*(3+3)+1) Total cumulative energy duplicate entry 2 7(4 bytes + 2 bytes + 1 byte (CRC) Count for CE overflow 1 byte Power-down entry Note: 10 (3 bytes (CHV, CHP, CHS) + 7 dummy bytes for future use) 6 bytes EEPROM data structuring is done in a modular way in order to support future updates. Reconfigure parameters in header file "emeter_datamgmt.h", to modify the log structure entry count. 7.2 Entry structure Calibration data log CHV, CHP, and CHS are calibration parameters for the current and voltage channel for the metering IC. Table 6. Calibration data Calibration data Start address Size 0x00 10 (CHV, CHP, CHS, 7 times 0x00) For more details on calibration parameters, refer to the STPM01 STPM01; Programmable singlephase energy metering IC with tamper detection, datasheet. Doc ID 17778 Rev 1 21/34 EEPROM log data structure UM0981 UM0981 Total cumulative energy log Two duplicate entries are stored. One at the start of EEPROM and another at the end of EEPROM This is done to make sure that, if EEPROM is corrupted at one point, another entry with the correct CRC is considered as a valid value 7 bytes (4 bytes: kWh, 2 bytes: impulse count and 1 byte: CRC): total cumulative energy entry Cumulative energy until last month Cumulative energy until last month states energy consumed up to the last calendar month reset 6 bytes (4 bytes: kWh and 2 bytes: impulse count): cumulative energy entry up to last month Monthly maximum demand 3 bytes (1 byte: integer value and 2 bytes: impulse count): MD value, 3 bytes (date) 3 bytes (time) Current monthly cumulative energy Current monthly cumulative energy states energy consumed in that particular current month until the last calendar month reset 6 bytes (4 bytes: kWh and 2 bytes: impulse count), current cumulative energy entry Monthly average PF PF average value is the sum of PF readings and PF averaging count is the number of PF readings. 4 bytes (PF average value) 2 bytes (PF averaging value) Monthly tamper log For the monthly tamper log, the following four types of tamper data are logged: Earth tamper Reverse tamper Neutral missing tamper Case tamper For each tamper, there are 4 entries per month: 1 byte: tamper count Note: 3 bytes: date 3 bytes: time. For each tamper entry log, the tamper count: number of tampers in month D: date and T: time is of 3 bytes. 22/34 Doc ID 17778 Rev 1 UM0981 UM0981 Tamper definitions Appendix A Tamper definitions Earth tamper: using earth in place of neutral (load current is passed partially or fully through earth) Reverse connection: reversal of phase and neutral at mains Neutral missing tamper: when neutral is disconnected, the board is not powered. During this condition (single wire conditions), power supply is generated by a CT for powering up the board Case tamper: if an attempt is made to open the meter body, the meter logs the date/time of the meter opening tamper Magnetic tamper: if a magnet is near to the board, it pulls magnetic sensor output IO low. Doc ID 17778 Rev 1 23/34 Table 7. BOM list and schematics BOM Manufacturer Manufacturer's ordering code / orderable part number Supplier ordering code TSSOP20 TSSOP20 STMicroelectronics STPM10BTR STPM10BTR STPM10BTR STPM10BTR STM8L microcontroller LQFP48 LQFP48 STMicroelectronics STM8L152C6T6 STM8L152C6T6 STM8L152C6T6 STM8L152C6T6 U3 EEPROM 32 Kb SO8 STMicroelectronics M24C32-RDW6P M24C32-RDW6P M24C32-RDW6P M24C32-RDW6P U5 Voltage reference TO92 STMicroelectronics TL431AIZ TL431AIZ TL431AIZ TL431AIZ D5,D11,D12,D13,D1 4 Small signal diode SOD-523 STMicroelectronics BAT30KFILM BAT30KFILM BAT30KFILM BAT30KFILM Y1 4194.304 kHz oscillator 2-pin (3.5 mm) ECS Inc ECS-42-12-4X ECS-42-12-4X X1046-ND X1046-ND Y2 32.768 kHz oscillator 2-pin (cylindrical) Abracon Corporation AB26T-32 AB26T-32.768 kHZ 535-9032-ND 535-9032-ND J1 Swim connector (SMT, 4-pin, 1.27 mm pitch) SMD ERNI ERNI 284697 J2,J4 3-pin connector 3-pin (2.54 mm) Any J5 4-pin connector 4-pin (2.54 mm) Any J6 Doc ID 17778 Rev 1 Crystal and oscillator Connectors and jumpers 2-pin connector 2-pin (2.54 mm) Any LEDs D10 LED Leaded (3 mm) HLMP-K150 HLMP-K150 Component description Package STPM metering engine U2 ST devices Reference designator U1 Category BOM list and schematics 24/34 Appendix B 516-1311-ND 516-1311-ND UM0981 UM0981 BOM (continued) Manufacturer's ordering code / orderable part number 1 µF SMD0805 SMD0805 Any 1 nF SMD0805 SMD0805 Any C5,C14,C15,C17, C21,C22,C24,C28, C31 100 nF SMD0805 SMD0805 Any C6,C8 15 pF SMD0805 SMD0805 Any C7,C10 10 nF SMD0805 SMD0805 Any C9,C11 12 pF SMD0805 SMD0805 Any C12 4.7 µF SMD1206 SMD1206 Any C16,C30 4.7 µF Tantulum SMD EIA 3216-18/ size A C13 33 nF SMD0805 SMD0805 C18 200 nF/630 V Leaded Vishay/BC Components BFC2 383 20204 BC1857-ND BC1857-ND C19 220 µF/16 V Leaded Panasonic - ECG EEU-FC1C221 EEU-FC1C221 P11199-ND P11199-ND C25 1 nF/500 V Leaded Vishay/BC Components D102K25Y5PL63L6R D102K25Y5PL63L6R 1457PH-ND 1457PH-ND C26 100 µF/50 V Leaded Panasonic - ECG ECE-A1HN101U ECE-A1HN101U P1284-ND P1284-ND C32 6.8 µF/16 V Leaded Panasonic - ECG ECE-A1CKG6R8 P909-ND P909-ND C33 Doc ID 17778 Rev 1 Package C2,C29 Capacitors Component description C1,C3,C4,C20,C23, C27 Category Reference designator 470 µF/35 V Leaded Nichicon UVR1V471MPD UVR1V471MPD 493-1084-ND 493-1084-ND UM0981 UM0981 Table 7. Manufacturer Supplier ordering code Any Any BOM list and schematics 25/34 BOM (continued) Manufacturer's ordering code / orderable part number Package 10 k SMD0805 SMD0805 Any R2 1 M SMD0805 SMD0805 Any R3,R11,R20,R21, R27,R33,R34,R35 0 SMD0805 SMD0805 Any R4,R10,R14,R19, R32 1 k SMD0805 SMD0805 Any R5 Resistors Component description R1,R13,R17,R18, R36,R37,R41 Category Reference designator 6.8 SMD0805 SMD0805 BOM list and schematics 26/34 Table 7. Any Manufacturer Supplier ordering code Doc ID 17778 Rev 1 UM0981 UM0981 BOM (continued) Manufacturer's ordering code / orderable part number 27 SMD0805 SMD0805 Any 42.2 k SMD0805 SMD0805 Any R9,R15 2 M SMD0805 SMD0805 Any R12 100 SMD0805 SMD0805 Any R16 2.2 k SMD0805 SMD0805 Any R22 100 k SMD0805 SMD0805 Any R23,R24,R25 261 k SMD1206 SMD1206 Any R26 475 SMD0805 SMD0805 Any R28 82, 2 W Leaded R29 15 k SMD0805 SMD0805 Any R30 22 k SMD0805 SMD0805 Any R31 470 SMD0805 SMD0805 Any R38 5.1 SMD0805 SMD0805 Any R39 150, 2 W Leaded R40 8 k SMD0805 SMD0805 Any R41 10 k SMD0805 SMD0805 Any L1 220 µH SMD Panasonic - ECG ELJ-FB221JF ELJ-FB221JF PCD1469CT-ND PCD1469CT-ND L2, L3 Doc ID 17778 Rev 1 Package R7 Resistors Component description R6 Category Reference designator 1 µH SMD Panasonic - ECG ELJ-FC1R0JF PCD1228CT-ND PCD1228CT-ND D1,D2,D3,D4,D6,D7, D8,D9 Diode GPP 1A 1000 V DO41 Leaded Fairchild Semiconductor 1N4007 1N4007 1N4007FSCT-ND 1N4007FSCT-ND Manufacturer Yageo Vishay/BC components RSF200JB-82R RSF200JB-82R PR02000201500JR5 PR02000201500JR5 00 Supplier ordering code 82W-2-ND PPC150W-2CT-ND PPC150W-2CT-ND 27/34 BOM list and schematics Inductors Diode UM0981 UM0981 Table 7. BOM (continued) Manufacturer Manufacturer's ordering code / orderable part number Supplier ordering code SMD-8pin Vishay Electronics TFDU4300 TFDU4300 751-1073-1-ND 751-1073-1-ND Micropower omnipolar Hall-effect sensor switch SC-59-3L SC-59-3L Diodes Inc. AH180 AH180_SC59-3L SC59-3L AH180-WGDICT-ND AH180-WGDICT-ND SW1 Reset switch for micro Leaded Tyco Electronics 1555986 FSM10JH FSM10JH SW2 Case tamper switch Leaded Tyco Electronics 1555986 FSM10JH FSM10JH SW3 LCD_PUSH switch Leaded Tyco Electronics 1555986 FSM10JH FSM10JH J3 LCD glass 18x4 22-pin connector OPT6089A OPT6089A PIE Electronics MOV1 SUR ABSORBER 10 MM 750V 2500 A ZNR Leaded Panasonic - ECG ERZ-V10D751 ERZ-V10D751 P7260-ND P7260-ND RS1 Current sensing resistors 5 WATT .0005OHM 0005OHM 1 % Leaded IRC CSL-5R0005F0002LF CSL-5R0005F0002LF 66-CSL-5R0005FLF 66-CSL-5R0005FLF CT1 Current transformer Leaded Vacuumschmelze (Vac) T60404-E4623-X002 T60404-E4623-X002 T60404-E4623-X002 T60404-E4623-X002 BAT1 Battery lithium Coin 3 V W/TABS Leaded Panasonic - BSG CR-2032/F4N CR-2032/F4N P245-ND P245-ND BAT2 Battery lithium Coin 3 V 23 MM 50 MA VERT Leaded Panasonic - BSG VL-2330/VCN VL-2330/VCN P086-ND P086-ND Q1 Transistor NPN 45 V 0.1 A SOT23 SOT23 Fairchild Semiconductor BC847BMTF BC847BMTF BC847BMTFCT-ND BC847BMTFCT-ND Reference designator Component description Package U6 Infrared transceiver module (SIR, 115.2 kbit/s) U4 Category BOM list and schematics 28/34 Table 7. Misc components Doc ID 17778 Rev 1 Misc components UM0981 UM0981 UM0981 UM0981 Figure 8. BOM list and schematics Microcontroller schematic Doc ID 17778 Rev 1 29/34 BOM list and schematics Figure 9. 30/34 UM0981 UM0981 Battery, connector, magnetic sensor and IrDA module schematics Doc ID 17778 Rev 1 BOM list and schematics 31/34 Figure 10. Power supply, EEPROM, LCD and neutral missing power supply schematics Doc ID 17778 Rev 1 UM0981 UM0981 UM0981 UM0981 Figure 11. STPM schematic Doc ID 17778 Rev 1 BOM list and schematics 32/34 UM0981 UM0981 Revision history Revision history Table 8. Document revision history Date Revision 23-Nov-2010 1 Changes Initial release. Doc ID 17778 Rev 1 33/34 UM0981 UM0981 Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST's terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST'S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER'S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. © 2010 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 34/34 Doc ID 17778 Rev 1