UM1529 User Manual
UM1529 User Manual
UM1529 User Manual
User manual
Single-phase energy meter with 80 A maximum current based on STPM10
metering IC and STM8L152C6 MCU with dual interface EEPROM
Introduction
This document describes the functioning of a single-phase energy meter based on the
STPM10 metering IC and STM8L152C6 microcontroller.
The demonstration board STEVAL-IPE020V1 is a fully functional single-phase solution with
parameter display, tamper management, maximum demand (MD) calculation, with dual
interface (RF and I2C interface) EEPROM data logging and low-power management. The
meter specifications are:
■ Accuracy: class 1 with dynamic range 200:1
■ Nominal voltage: 240 V
■ Nominal current: 10 A (ITYP)
■ Maximum current: 80 A (IMAX)
■ Operating range: 0.6 Vb to 1.2 Vb
■ Meter constant: 1600 impulses/kWh
■ Power frequency range: 45 Hz to 65 Hz
■ Sensor: primary side CT and secondary side shunt
■ Communication interface: IrDA
Contents
1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 Safety rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Recommended readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Getting technical support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 Hardware installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.1 System requirements for demonstration GUI . . . . . . . . . . . . . . . . . . . . . 10
4 Hardware layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Hardware details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1 Metering IC U1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.1 Clocking Y1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2 Microcontroller U2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2.1 LED D10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2.2 Switch SW1, SW2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2.3 Jumper J2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2.4 Clocking Y2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.3 Power supply section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3.1 Programmable voltage reference U5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3.2 Current sensor CT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3.3 Shunt RS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.4 Neutral missing power supply section . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.4.1 Current sensor CT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.5 EEPROM U3 section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.6 LCD section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.7 Battery management section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.7.1 Coin cell BT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.7.2 Rechargeable battery BT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Appendix C Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
C.1 Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
List of tables
List of figures
Figure 1. Single-phase energy meter solution based on STPM10 and STM8L152C6 with dual interface
EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Figure 2. Electricity meter connection diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 3. Hardware layout: top view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 4. Hardware layout: bottom view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 5. Auto-calibration mode connection diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 6. SerialIO GUI hardware setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 7. SerialIO GUI with protocol mode C settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 8. Schematics (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 9. Schematics (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1 Features
2 Overview
Danger: 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.
3 Getting started
3.1 Package
The demonstration kit package includes the following items:
● Hardware content
– STEVAL-IPE020V1 demonstration board
● Software
– SerialIO GUI for IRDA communication testing
● Documentation:
– User manual
– Presentation
– Schematic
– BOM.
,#$
0HASE
.EUTRAL
!-V
4 Hardware layout
5 Hardware details
5.1 Metering IC U1
The programmable single-phase energy metering IC STPM10BTR (package: TSSOP20) is
interfaced to the microcontroller using a three-wire SPI interface. Active energy, apparent
energy, instantaneous voltage, instantaneous current values are obtained from the STPM10
metering IC. For calibration of the STPM10, auto-calibration is implemented.
5.1.1 Clocking Y1
A 4.194 MHz crystal is used as 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 STM8L152C6T6 (package: LQFP48, 32 K Flash, 2 KB RAM, 48-pin) is
responsible for all the data management and power management tasks. MCU consumes
much lower power and has in-built RTC for date and time management.
5.2.3 Jumper J2
5.2.4 Clocking Y2
A 32.768 kHz crystal is used as clock input for LSE (low speed external) for the
microcontroller RTC block. The microcontroller core is clocked by HSI (high speed internal)
clock.
5.8.2 Jumper J6
Using jumper J6, IRDA transmit and receive pins allow the testing of the IRDA section using
the SerialIO GUI.
For more details, refer to Section 6.7.2: SerialIO GUI.
PC3_IRDA_Tx
J6 PC2_IRDA_Rx IRDA receive pin
IRDA transmit pin
PA1_NRST_PULSE_LED
PA0_SWIM
J1 VDD GND LED pulse output/reset
SWIM interface data pin
signal
PA0_SWIM PE6 PE7_STPM_ZCR
J5 GND
SWIM interface data pin GPIO metering IC ZCR signal
J4 GND VDD PC1_EEPROM_SCL PC0_EEPROM_SDA
1 VOTP
2 SBS
3 GND
4 PB7_STPM_SDA
5 PB6_STPM_SCS
6 PB5_STPM_SCL
7 PD6_STPM_LED
8 PA3_STPM_SYN
9 SBS
10 VDD
6
!# 3OURCE
0
.
! 3OURCE
3(5.4
340-
#4
!-V
For more details of calibration parameters, refer to the metering IC datasheet which can be
found on www.st.com.
● Reverse tamper:
● Case tamper:
● Magnetic interference:
The three tampers (earth, reverse and neutral missing) are detected using a software
algorithm based on meter readings from 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. The symbol 'BP' is shared for displaying case tamper as well as
magnetic interference. It means that if any of the tampers are detected, symbol 'BP' is
displayed on the LCD.
For tamper definitions, refer to Appendix B: Tamper definitions.
Note: In the present solution, magnetic tamper is not logged in EEPROM. Logging can be easily
done modifying the EEPROM log structure.
0#
6## 6
4X 34 4X
*UMPER *
2X 2X /PTO
4X0#
#OUPLER
2X0#
34%6!,
)0%6
3ERIAL #OMMUNICATION
%NERGY -ETER
!-V
Note: For more details about IRDA mode C, refer to the 62056-21 IRDA protocol mode C
document.
Note: EEPROM data structuring is done in a modular way to support future updates. Reconfigure
parameters in header file “emeter_datamgmt.h” to modify log structure entry count.
● Monthly average PF
PF average value is sum of PF readings and PF averaging count is number of PF readings.
● 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
meter opening tamper
● Magnetic tamper
– When a magnet comes near to the board, it pulls magnetic sensor output IO low.
Figure 8.
3%B6730B6'$ 5 3%B670B6'$ 3$B6730B6<1 5 3$B670B6<1
5
- 5 N 3%B6730B6&6 5 3%B670B6&6
3$B1567B38/6(B/('
&21
6: 3&B/6(B,1 &
5(6(7 & S)
Q)
' <
Appendix C
3(B3:5B'1
3(
3&B/&'B6(*
3&B/6(B287
3&B/6(B,1
3&B&$6(B7$03(5
3&B,5'$B7;
3&B,5'$B5;
*1'
9''
3&B((3520B6&/
3&B((3520B6'$
9'' 5 .+]
N
/('
8
3&B/6(B287 &
S)
3(
3(
3&
3&
3&
3&
3&
3&
3&
3&
966,2
9'',2
3$B6:,0 3'B+=B3:0
3$B1567B38/6(B/(' 3$ 3' 3'B670B/('
3$B%$7B(;7B/&'B386+ 15673$ 3' 3'B/&'B6(*
3$B670B6<1 3$ 3' 3'B/&'B6(*
3$B/&'B&20 3$ 3' 3)B06
3$ 3)
Schematics
9/&'
3(
3(
3(
3(
3(
3(
3'
3'
3'
3'
3%
&
9/&'
5
/ & N
9'' 9''$ X) 3'B+=B3:0 6730B9,3
X+B%(('
3(B/&'B6(*
3(B/&'B6(*
3(B/&'B6(*
3(B/&'B6(*
3(B/&'B6(*
3(B/&'B6(*
3'B/&'B6(*
3'B/&'B&20
3'B/&'B6(*
3'B/&'B6(*
3%B/&'B6(*
& & & X)
Schematics
9&&B6730
%$77(5<6(&7,21
'
' %$7.),/0
%$7.),/0
' '
.OTE $O .OT -OUNT *
0$*1(7,&6(1625 9''
-
,5'$02'8/(
3&B,5'$B7; 5 ,5'$B7['
3&B,5'$B5; 5
5 ,5'$B5[' 9'' 5 N
&21 ( 8 8
$12'(
9''
&$7+2'(
,5'$B7[' 7[' 3)B06
287387
5 3( 5 ,5'$B5[' 5['
*1'
( 6'
9&& $+B6&/
9''
9'' 9/2*,&
*1' *1'
7)'8
!-V
Schematics
27/35
28/35
Schematics
-
9273 6%6
67306(&7,21 *1' 3%B6730B6'$
3%B6730B6&6 3%B6730B6&/
3'B6730B/(' 3$B6730B6<1
9''
8
3'B6730B/('
021 /(' &21$3 6%6
Figure 9.
/&'6(&7,21 3%B6730B6'$
& & & & 023 6'$
- X) Q) X) X) 3%B6730B6&6 3%B6730B6&/
3$B/&'B6(* 6&6 6&/
3(B/&'B6(*
3(B/&'B6(* 9''' &/.287
3(B/&'B6(* 9&&B6730 $*1' 6730B&/.,1
3(B/&'B6(* 966 &/.,1
3(B/&'B6(* 9&&B6730 3$B6730B6<1
3(B/&'B6(* 9&& 6<1
3'B/&'B6(* 9273
3'B/&'B6(* 9273 9,1 5
3'B/&'B6(* 6730B9,3 0
3%B/&'B6(* 9''$ 9,3 <
3%B/&'B6(* 5
3%B/&'B6(* . ,,3 ,,1
3%B/&'B6(* .+]
3%B/&'B6(*
5(' ,,1 ,,3 5
3'B/&'B6(* 5 5 & 6730%75B76623 N 5
3'B/&'B6(* &7 ( ( Q) &
3&B/&'B6(* 7(; N & S)
3$B/&'B&20 S)
3$B/&'B&20 5 5
3$B/&'B&20 . 0
3'B/&'B&20
%/$&. 5
/&'B*/$66&211 5
(
Schematics (2 of 2)
5
.
5
56
0
&
1(875$/0,66,1*32:(56833/<6(&7,21 Q) *1'
5
.
6KXQW%.:05X2KP $*1'
5 5
& '
&7 5
& &
9&&B6730
X) Q)
5
9&&B6730
' 3(B3:5B'1
3
5 / 1 ( 73
9$& 5 & 5
X+ (: Q)9
3+$6( (: (;76833/<
'
1
((35206(&7,21 5 '
9'' N 1 5
N
8
&
5
( 9&& 029 & & X)9 8
9 Q)9 X)9 7/B72
5 4 & &
( :& &
%&% X)9 Q)
5 3&B((3520B6&/ 5 Q)
( 6&/ 5
N ' N
3&B((3520B6'$ 5
966 6'$ N 1
0&50173B62 1
/
X+
1(875$/
32:(56833/<6(&7,21
!-V
UM1529
Appendix D Bill of material
UM1529
Table 13. BOM
Manufacturer’s
Reference Component Supplier ordering
Category Package Manufacturer ordering code / Supplier
designator description code
orderable part number
STPM metering
U1 TSSOP20 ST STPM10BTR STPM10BTR
engine
STM8L
U2 LQFP48 ST STM8L152C6T6 STM8L152C6T6
microcontroller
U3 EEPROM 32 Kb SO8 ST M24C32-RMN6TP M24C32-RMN6TP
U5 Voltage reference TO92 ST TL431AIZ TL431AIZ
Doc ID 022953 Rev 1
Swim connector
Connectors
J1 (SMT, 4-pin, 1.27 SMD ERNI ERNI ERNI 284697
Bill of material
and jumpers
mm pitch)
J2 3-pin connector 3-pin (2.54 mm) Any
29/35
Table 13. BOM (continued)
30/35
Bill of material
Manufacturer’s
Reference Component Supplier ordering
Category Package Manufacturer ordering code / Supplier
designator description code
orderable part number
UM1529
Table 13. BOM (continued)
UM1529
Manufacturer’s
Reference Component Supplier ordering
Category Package Manufacturer ordering code / Supplier
designator description code
orderable part number
Panasonic -
C32 6.8 µF/16 V Leaded ECE-A1CKG6R8 Digi-Key P909-ND
ECG
C33 470 µF/35 V Leaded Nichicon UVR1V471MPD Digi-Key 493-1084-ND
Capacitors Panasonic -
C34 47 µF/50 V Leaded ECA-1HM470 Digi-Key P5181-ND
ECG
Panasonic -
C35 1000 µF/16 V Leaded ECA-1CM102 Digi-Key P5142-ND
ECG
R1,R13,R32,R36,R37 10 kΩ SMD0805 Any
R2 1 MΩ SMD0805 Any
Doc ID 022953 Rev 1
R3,R8,R11,R17,R18,
R20,R21,R27,R33,R3
0 SMD0805 Any
4,R35,R42,R43,R44,R
46,R47,R49
R4,R10,R14,R19 1 kΩ SMD0805 Any
R5 6.8 Ω SMD0805 Any
R6 5.1 Ω SMD0805 Any
R7 42.2 kΩ SMD0805 Any
Resistors
R9,R15 2 MΩ SMD0805 Any
R12 100 Ω SMD0805 Any
R16 2.2 kΩ SMD0805 Any
R22,R41 100 kΩ SMD0805 Any
R23,R24,R25 261 kΩ SMD1206 Any
Bill of material
R26 475 Ω SMD0805 Any
R28 82, 2 W Leaded Yageo RSF200JB-82R Digi-Key 82W-2-ND
R29 15 kΩ SMD0805 Any
31/35
Bill of material
Manufacturer’s
Reference Component Supplier ordering
Category Package Manufacturer ordering code / Supplier
designator description code
orderable part number
Inductors
Panasonic -
L2, L3 1 µH SMD ELJ-FC1R0JF Digi-Key PCD1228CT-ND
ECG
DIODE GPP 1A Fairchild
Diode D1,D2,D3,D4, Leaded 1N4007 Digi-Key 1N4007FSCT-ND
1000 V DO41 Semiconductor
Infrared transceiver
Vishay
U6 module (SIR, 115.2 SMD-8-pin TFDU6300-TR3 Digi-Key 751-1082-1-ND
Electronics
kbit/s)
Micropower
omnipolar Hall-
Misc. U4 effect sensor SC-59-3L Diodes Inc. AH180_SC59-3L Digi-Key AH180-WGDICT-ND
components switch
RESET switch for Tyco
SW1 Leaded 1555986 Farnell FSM10JH
micro Electronics
CASE TAMPER Tyco
SW2 Leaded 1555986 Farnell FSM10JH
switch Electronics
UM1529
Table 13. BOM (continued)
UM1529
Manufacturer’s
Reference Component Supplier ordering
Category Package Manufacturer ordering code / Supplier
designator description code
orderable part number
Tyco
SW3 LCD_PUSH switch Leaded 1555986 Farnell FSM10JH
Electronics
22-pin PIE
J3 LCD glass 18x4 OPT6089A PIE Electronics
connector Electronics
SUR absorber 10
Panasonic -
MOV1 mm 750 V 2500 A Leaded ERZ-V10D751 Digikey P7260-ND
ECG
ZNR
Current sensing
Misc. resistors ISABELLENH Electric
RS1 Leaded BKW-M-R0003-5.0 BKW-M-R0003-5.0
components 5WATT.0003OHM UTTE center
1%
Doc ID 022953 Rev 1
VACUUMSCH Vacuumsc
CT1 Current transformer Leaded T60404-E4626-X002 T60404-E4626-X002
MELZE (VAC) hmelze
BATTERY LITHIUM Panasonic -
BT1 Leaded CR-2032/F4N Digi-Key P245-ND
COIN 3 V W/TABS BSG
BATT LITH COIN 3
Panasonic -
BT2 V 23 MM 50 MA Leaded VL-2330/VCN Digi-Key P086-ND
BSG
VERT
Bill of material
33/35
Revision history UM1529
Revision history
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 TWO AUTHORIZED ST REPRESENTATIVES, 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.
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.