MQX-Enabled MCF51EM256 SinglePhase Electricity Meter Reference Design Using the MCF51EM256, MC1322x and MMA7660FC Document Number: DRM121 Rev. 0 MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 2 Freescale Semiconductor, Inc. Contents Section Number Title Page Chapter 1 Introduction 1.1 Overview..........................................................................................................................................................................7 1.2 General platform features.................................................................................................................................................8 1.2.1 Hardware design features .....................................................................................................................................8 1.2.2 Software features of the design..............................................................................................................................9 1.3 MCF51EM256 Microcontroller series.............................................................................................................................9 1.3.1 Peripheral application usage..................................................................................................................................11 1.4 1322x low power node (LPN)..........................................................................................................................................13 1.5 MMA7660FC 3-axis Xtrinsic accelerometer...................................................................................................................15 Chapter 2 Basic Theory 2.1 Definition of terms...........................................................................................................................................................17 2.1.1 Power.....................................................................................................................................................................17 2.1.2 Energy....................................................................................................................................................................19 2.1.3 Power factor...........................................................................................................................................................19 2.2 Electricity distribution......................................................................................................................................................20 2.3 Electricity meters..............................................................................................................................................................21 2.3.1 Electromechanical meters......................................................................................................................................22 2.3.2 Electronic meters...................................................................................................................................................22 2.4 Voltage and current measurement....................................................................................................................................24 2.4.1 Voltage divider......................................................................................................................................................25 2.4.2 Shunt resistor.........................................................................................................................................................26 2.4.3 Current transformer...............................................................................................................................................26 2.4.4 Rogowski coil........................................................................................................................................................28 MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 3 Section Number Title Page Chapter 3 System Concept 3.1 Application description....................................................................................................................................................29 3.1.1 Metering board.......................................................................................................................................................30 3.1.2 Switch mode power supply board connection.......................................................................................................33 3.1.3 External current sensors connection......................................................................................................................34 3.1.4 1322x-LPN connection..........................................................................................................................................35 3.1.5 Power meter case...................................................................................................................................................36 3.2 Application usage.............................................................................................................................................................38 3.2.1 Power meter hardware configuration.....................................................................................................................38 3.2.2 Application example..............................................................................................................................................39 Chapter 4 Hardware Design of the Metering Board 4.1 Introduction to hardware implementation........................................................................................................................41 4.2 Power supply ...................................................................................................................................................................41 4.3 Digital hardware ..............................................................................................................................................................42 4.3.1 MCU core..............................................................................................................................................................42 4.3.2 RS232 interface.....................................................................................................................................................43 4.3.3 Infrared interface (IEC1107).................................................................................................................................44 4.3.4 User interfaces.......................................................................................................................................................44 4.3.5 LED interface.........................................................................................................................................................45 4.3.6 SPI interface...........................................................................................................................................................45 4.3.7 Accelerometer interface.........................................................................................................................................45 4.3.8 IIC interface...........................................................................................................................................................46 4.4 Signal conditioning ..........................................................................................................................................................47 4.4.1 Voltage measurement............................................................................................................................................50 4.4.2 DC Bias circuit......................................................................................................................................................50 4.4.3 Shunt resistor current measurement.......................................................................................................................51 4.4.4 CT current measurement........................................................................................................................................53 MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 4 Freescale Semiconductor, Inc. Section Number Title Page 4.4.5 Input protection......................................................................................................................................................55 Chapter 5 Application Set-Up 5.1 Setting-up the demo hardware .........................................................................................................................................57 5.2 Setting-up the software demo...........................................................................................................................................58 5.2.1 FreeMASTER data visualization ..........................................................................................................................58 5.2.2 ZigBee communication .........................................................................................................................................60 5.2.3 Code reprogramming via serial bootloader...........................................................................................................63 MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 5 MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 6 Freescale Semiconductor, Inc. Chapter 1 Introduction 1.1 Overview This design reference manual describes the solution for a single phase electricity meter based on the MCF51EM256 microcontroller (MCU). The design demonstrates the capabilities of this MCU for electricity metering applications. There are also additional Freescale components used in this design, including the RF (ZigBee) and accelerometer solution (interface). The reference design provides a high performance solution for power measurement in single phase two-wire installations. The target market is residential metering. The reference design has the ability to connect to a ZigBee® network thanks to the integrated 1322x low power node, hence it can easily become part of the smart grid network. Besides this development, this design uses the MQX real time operating system, to improve the code structure and to serve as a proof of concept for the true real-time applications, such as a power meter. Because of the MQX, this power meter is designed for use in advanced markets. In addition, various analog front end configurations and measurement methods are explored, implemented, and compared in this reference design. This reference design manual describes only the hardware solution for the power meter. Software solutions; mainly metering algorithms are described in associated documents, like the application note titled FFT-based Algorithm for Metering (document AN4255). The power meter reference design is prepared for use in a real customer metering area, this is due to the implemented HMI (LCD and buttons) and communication interfaces for remote data collecting (AMR). Finally, it provides both hardware and software solutions for customer applications. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 7 General platform features 1.2 General platform features This chapter describes the main hardware and software features of the MCF51EM256 Power Meter Reference Design. 1.2.1 Hardware design features • 5 (100) A current range, nominal current is 5 A, peak current is 100 A • 120/230 V AC, 50/60 Hz operational range • Accurate metering function (IEC50470-3 class B), 1% (applicable for two-gain stages configuration) • Active and reactive power (energy) measurement • Line frequency measurement (for precision zero-cross detection) • Two standard current sensing circuit implementations (shunt resistor and CT) • Voltage sensing is executed by an inexpensive resistor divider • Cost-effective bill of materials (BOM) due to various configurations of hardware signal conditioning parts • Low-power modes effectively implemented, including the use of standby RAM and RTC • 3 V internal battery for proper RTC function and data storage for a minimum 10 years • 4 x 40 segment LCD, including charge pump (values shown on the LCD: V,A,W,Var,VA,kWh, kVArh, cos , Hz, time, date) • Tamper detection via: • Built-in tamper push-button • 3-axis IIC MMA7660FC accelerometer (optional only) • Simple user interface — Two user buttons, one LED • LED pulse outputs (kWh,kVArh) • Open-collector power pulse output — Maximum power rating is 1.6 W • IEC1107 infrared hardware interface MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 8 Freescale Semiconductor, Inc. Chapter 1 Introduction • Optically isolated RS232 interface (19200 Bd, 8 data bits, no parity) • BDM debug interface (non-optically isolated) • 2.4 GHz RF interface through a 1320x-RFC RF daughter card (optional only) • 2.4 GHz RF interface through a 1322x low power node daughter card • Powered by 3.3 V SMPS open-frame module (3-rd party solution) • All components (board, sensors, and SMPS) are built into a plastic box with a transparent cover • EMC proven design (EN61000-4-2, EN610004-4) • Power meter demo mechanical dimension — 18 x 26 x 15 cm (w x l x h) • Power meter demo weight — 1 kg approximately 1.2.2 Software features of the design • Application C/ASM source code for CodeWarrior is available • MQX based design for advanced markets • Fast Fourier Transform (FFT) computing technique for precise reactive energy measurement • ZigBee SE2.0 stack implemented in 1322x low power node for connection to a ZigBee® network • FreeMASTER visualization script for calibration, watching, and so on. • Serial bootloader for safe firmware upload through RS232, see application note Developer's Serial Bootloader for M68HC08 and HCS08 MCUs (document AN2295) 1.3 MCF51EM256 Microcontroller series The MCF51EM256 is Freescale’s new smart-meter-on-a-chip 32-bit ColdFire® V1 core microcontroller (MCU) with embedded LCD controller, 16-bit ADC, and metrologyspecific peripherals optimized for smart meter applications. The MCF51EM256 comes with a full suite of hardware and software tools to make development quick and easy. There is a block diagram of this MCU in Figure 1-1. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 9 MCF51EM256 Microcontroller series The MCF51EM256 MCU provides the following main features: • Operating at processor core speeds of up to 50.33 MHz (peripherals operate at half of this speed) at 3.6 V to 2.5 V, and 20 MHz at 3.6 V to 1.8 V • Up to 256 KB of flash memory • Up to 16 KB of RAM • Less than 1.3 µA of typical power consumption in battery mode, with the MCU supply off • Ultra-low power independent RTC with calendar features, separate time base, power domain, and 32 bytes of RAM • Integrated 16-bit SAR analog-to-digital converter • Programmable Delay Block (PDB) • Two analog comparators with selectable interrupt (PRACMP) • LCD driver • Three Serial Communications Interface modules (SCI) • Three Serial Peripheral Interfaces (SPI) • Inter-Integrated Circuit (IIC) • Two 8-bit and one 16-bit Modulo Timers (MTIM) • Two-channel Timer/PWM module (TPM) • 80-pin LQFP or 100-pin LQFP package • –40° C to +85° C operating temperature range • RoHS compliant Target applications of this MCU are: • Smart metering • Sensor collection • Phase measurement units • Industrial energy measurement • 1-phase and 3-phase electricity meters MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 10 Freescale Semiconductor, Inc. Chapter 1 Introduction Figure 1-1. MCF51EM256 block diagram 1.3.1 Peripheral application usage The power meter concept benefits greatly from plenty of integrated internal peripherals in the MCF51EM256 MCU. The Analog to Digital Controller (ADC) features used in the application: • Four channels are used, one is differential for CT current measurement, the second is single-ended for voltage measurement. The remaining two channels are also singleended for shunt resistor current measurement (two gain stages) • Linear successive approximation algorithm with a 16-bit resolution • High-speed conversion (up to 128 samples per one period) • 3.735 MHz module clock • 16 hardware averaged samples to create a proper ADC result The General Purpose Input Output (GPIO) features used in the application are: MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 11 MCF51EM256 Microcontroller series • Used for directly controlling some peripherals such as LEDs, open-collector, and so on. The Inter-Integrated Circuit (IIC) features used in the application: • Primarily provides a method for internal communication between the meter (slave) and the 1322x-LPN daughter card (master)—prepared for ZigBee communication • Secondarily used for internal communication with the 3-axis digital accelerometer MMA7660FC (optional only)—prepared for tamper detection • Interrupt driven by byte-by-byte data transfer • Communication up to 100 kbps with software selectable slave address The Keyboard Interrupt (KBI) features used in the application: • Used for reading the state of the buttons in interrupt mode The Liquid Crystal Display (LCD) controller features used in the application: • Up to 288 segments (4x40 is currently used) • Used for data displaying The 16-bit Modulo Timer (MTIM16) features used in the application: • Free-running mode with interrupt is used • Generates a precision time marks for zero-crossing The PRACMP (Programmable Analog Comparator) features used in the application: • Compares input voltage signal with a bias voltage (reference) • Interrupt on rising edges is used • Generates capture flags for zero-cross voltage signal detection. Due to this, a variable time window for the PDB is generated • Line frequency measurement The Programmable Delay Block (PDB) features used in the application: • Hardware triggering of the ADC channels • Four individually controlled trigger conditions (one for each ADC channel) depending on the phase shift of the sensors The Real-Time Clock (RTC) features used in the application: • Ultra-low power independent real time clock with calendar features (iRTC) • Tamper detection and indicator • Battery monitor output The Serial Communication Interface (SCI1) features used in the application: MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 12 Freescale Semiconductor, Inc. Chapter 1 Introduction • Provides communication interface with an external PC (for calibration, watching and safe code uploading) • Communication settings are—19200 Bd, 8 data bits, one stop bit, and no parity The Serial Communication Interface (SCI2) features used in the application: • Provides communication interface for the IEC1107 infrared communication port (optional only) The Serial Peripheral Interface (SPI) features used in the application: • Provides internal communication interface for the1320x-RFC RF daughter card (optional only) The Voltage Reference (VREF) features used in the application: • Provides a reference voltage for internal analog peripherals such as the ADC, PRACMP • Low-power buffer mode is used 1.4 1322x low power node (LPN) The 1322x-LPN is one of the Freescale 1322x development kits designed for connecting to a ZigBee network. The 1322x low power node is designed as a stand-alone development board, including an MC1322x, two LEDs, two push buttons, a GPIO connector, header pins, and a programming and debug port. Note that the ZigBee capabilities of this board are only used in the MCF51EM256 metering concept – because of this feature, the power meter can easily became part of the smart grid. The low power node board is internally connected to an EM256 metering board via a IIC interface. Here are the main features of the 1322x low power node board: • • • • • • • • • • • 2.4 GHz wireless nodes compatible with the IEEE 802.15.4 standard Based on the MC13224V Platform in a Package Hardware acceleration for both the IEEE 802.15.4 MAC and AES security Printed F antenna Over-the-air data rate of 250 kbps Typical range (outdoors, line of sight) is 300 meters On-board expansion capabilities for external application-specific development activities Programmable flash J-Tag port for reprogramming and in-circuit hardware debugging Buttons and LEDs for demonstration and control Connections for battery or external power supply MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 13 1322x low power node (LPN) The core of the 1322x low power node is the Freescale MC1322x 99-pin LGA Platformin-Package (PiP) solution that can be used for wireless applications ranging from simple proprietary point-to-point connectivity to complete ZigBee mesh networking. The MC1322x is designed to provide a highly integrated, total solution, with premier processing capabilities, and very low power consumption. A full 32-bit ARM7TDMI-S core operates up to 26 MHz. The RF radio interface provides for low cost and high density as shown in Figure 1-2. Figure 1-2. MC1322x RF interface As described above, the 1322x low power node is used for connecting an EM256 power meter to a ZigBee network. ZigBee, an IEEE® 802.15.4 standards-based solution, as defined by ZigBee Alliance, was developed specifically to support sensing, monitoring and control applications. The ZigBee solution offers significant benefits, such as low power, robust communication and a self-healing mesh network. The ZigBee solution frequencies are typically in the 868/915 MHz or 2.4 GHz spectrums. The ZigBee data rate for technology solutions is 250 Kbps. ZigBee technology theoretically supports up to 65,000 nodes. Common applications in sensing, monitoring and control, which are best supported by a ZigBee technology solution include: • • • • • • • • Personal and medical monitoring Security, access control and safety monitoring Process sensing and control Heating, ventilation and air conditioning (HVAC) sensing and control Home, building and industrial automation Asset management, status, and tracking Fitness monitoring Energy management MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 14 Freescale Semiconductor, Inc. Chapter 1 Introduction NOTE For connection of the power meter to a ZigBee network via the 1322x-LPN daughter card, it is necessary to program the 1322x-LPN with the correct firmware. That description is out of range of this design reference manual. 1.5 MMA7660FC 3-axis Xtrinsic accelerometer The MMA7660FC is a digital output (IIC), low power, low profile capacitive micro machined accelerometer featuring a low pass filter, compensation for 0 g offset and gain errors and conversion to 6-bit digital values at a user configurable output data rate. The device can be used for sensor data changes, product orientation, and gesture detection through an interrupt pin (INT). The device is housed in an extremely small DFN package. The EM256 metering concept is prepared for tamper detection – this means illegally opening the cover of the power meter. However, the tamper function using a 3-axis IIC accelerometer is only optional. The MMA7660FC provides the main following features: • Digital output IIC • 3 mm x 3 mm x 0.9 mm DFN package • Low power consumption—Off mode: 0.4 A, standby mode: 2 A, active mode: 47A at 1 ODR • Configurable samples per second from 1 to 120 samples a second • Low voltage operation: • Digital voltage— 1.71 V – 3.6 V • Analog voltage— 2.4 V – 3.6 V • • • • • • • Auto-wake and sleep feature for low power consumption Tilt orientation detection for portrait and landscape capability Gesture detection Including shake detection and tap detection Robust design, high shocks survivability (10,000 g) RoHS compliant Environmentally preferred product Low cost Typical applications for this accelerometer are: • Mobile phone/ PMP/PDA—Orientation detection, image stability, text scroll, motion dialing, and tap to mute • Laptop PC—Anti-theft MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 15 MMA7660FC 3-axis Xtrinsic accelerometer • Gaming—Motion detection, auto-wake and sleep for low power consumption • Digital still camera—Image stability There is a simplified accelerometer functional block diagram in Figure 1-3. Figure 1-3. Simplified accelerometer functional block diagram MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 16 Freescale Semiconductor, Inc. Chapter 2 Basic Theory 2.1 Definition of terms To understand the electricity metering theory, here are some definitions of basic terms. 2.1.1 Power AC power flow has the three components — Real power (P) measured in watts (W), apparent power (S) measured in volt-amperes (VA), and reactive power (Q) measured in reactive volt-amperes (VAr). Active power (P) also known as real power or working power is the power that actually powers the equipment. As a rule, true power is a function of a circuit's dissipative elements usually resistances (R). Reactive power (Q) is a concept used by engineers to describe the loss of power in a system arising from the production of electric and magnetic fields. Although reactive loads such as inductors and capacitors dissipate no power, they drop voltage and draw current that creates the impression that they actually do. This imaginary power or nonworking power is called reactive power (Q). If the load is purely inductive or capacitive, then the voltage and current are 90 degrees out of phase (for a capacitor, current leads voltage; for an inductor, current lags voltage) and there is no net power flow. This energy flowing backwards and forwards is known as reactive power. Reactive power thus is produced for system maintenance and not for end-use consumption. By convention, a "lagging" or inductive load, such as a motor, will have positive reactive power. A "leading", or capacitive load, has negative reactive power. Reactive power is a function of a circuit's reactance (X). MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 17 Definition of terms Apparent power (S) is the vector summation of active and reactive power. It is the product of a circuit's voltage and current, without reference to phase angle. Apparent power is a function of a circuit's total impedance (Z). These three types of power — true, reactive, and apparent relate to one another in a trigonometric form. This is called a power triangle (see Figure 2-1). The opposite angle is equal to the circuit's impedance (Z) phase angle. Apparent power is often computed from this power triangle using the Pythagorean Theorem as: Figure 2-1. Power triangle A common utility system is often based on Total Apparent Power (Stot) measured also in volt-amperes (VA). Total apparent power is a product of the RMS voltage and RMS current, and is defined as: MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 18 Freescale Semiconductor, Inc. Chapter 2 Basic Theory This a general proposition: In a pure sinusoidal system with no higher harmonics, the apparent power (S) equals Stot. If there are some higher harmonics in the mains, apparent power is not the same as total apparent power, because the simple vector sum in apparent power computing loses accuracy. Therefore, Stot is often used because it is more precise in these situations. 2.1.2 Energy Energy is the accumulated power over a period of one hour. Active energy means the electrical energy produced, flowing, or supplied by an electric circuit during a time interval, being integral with respect to time of the instantaneous active power and measured in units of watt-hours (Wh). For practical use in power meters, a higher unit called a kilowatt-hour (kWh) is used, which is 1000 watt-hours (Wh). Apparent energy means the integral with respect to time of the apparent power. Kilovoltampere-hour (kVAh) is the unit for total (apparent) energy. Reactive energy means the integral with respect to time of the reactive power. Kilovoltampere-reactive-hour (kVArh) is the unit for reactive (non-working) energy. 2.1.3 Power factor The power factor of an AC electric power system is defined as the ratio of real power flowing to the load to the apparent power in the circuit, and is a dimensionless number between 0 and 1 (frequently expressed as a percentage, that is 0.5 pf = 50% pf). Real power is the capacity of the circuit for performing work in a particular time. Apparent power is the product of the current and voltage of the circuit. Due to energy stored in the load and returned to the source, or due to a non-linear load that distorts the wave shape of the current drawn from the source, the apparent power will be greater than the real power. In an electric power system, a load with a low power factor draws more current than a load with a high power factor for the same amount of useful power transferred. The higher currents increase the energy lost in the distribution system and require larger wires and other equipment. Because of the costs of larger equipment and wasted energy, MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 19 Electricity distribution electrical utilities usually charge a higher cost to industrial or commercial customers where there is a low power factor. Therefore, a modern electronic smart power meter must also measure the power factor. Power factor is defined as: is the phase angle between voltage and current. When power factor is equal to 0, the energy flow is entirely reactive. Stored energy in the load returns to the source on each cycle. When the power factor is 1, all the energy supplied by the source is consumed by the load. Power factors are usually stated as leading or lagging to show the sign of the phase angle. It is often desirable to adjust the power factor of a system to near 1.0. 2.2 Electricity distribution Electricity distribution is the final stage in the delivery of electricity to end users. A distribution system's network carries electricity from the transmission system and delivers it to consumers. Part of what determines the design of the electricity meter is the transmission supply design, the most common residential arrangements being: • 1-phase, 2 wire (1P2W) — Europe and Asia 220 V-240 V, US 2-wire 110 V • 1-phase, 3 wire (1P3W) — US 3-wire, sometimes called 2-phase • 3-phase, 4 wire (3P4W) The 1-phase 2-wire installation is the most common form of electricity distribution in the world. Finally, more than 80% of the population in the world uses a 1-phase 2-wire installation of 230 V/50 Hz (see at Figure 2-2). Much of the US installation is 110 V/60 Hz 1-phase 2-wire. The electricity meter described in this design reference manual is designed for use in 1P2W installations. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 20 Freescale Semiconductor, Inc. Chapter 2 Basic Theory Figure 2-2. Residential voltage and frequency worldwide 2.3 Electricity meters An electric meter or energy meter is a device that measures the amount of electrical energy consumed by a residence, business, or an electrically powered device. Electric meters are typically calibrated in billing units, the most common is the kilowatt hour. Periodic readings of electric meters establish billing cycles and energy used during a cycle. The most common unit of measurement on the electricity meter is the kilowatt hour (kWh), which is equal to the amount of active energy used by a load of one kilowatt over a period of one hour, or 3,600,000 joules. Some electricity companies use the SI megajoule instead. Similarly to active energy in kWh, there is also defined a reactive energy (kVArh) and apparent energy (kVAh), see Section 2.1.2 Energy . Electricity meters operate by continuously measuring the instantaneous voltage (volts) and current (amperes) and finding the product of these to give instantaneous electrical power (watts) which is then integrated against time to give energy used (joules, kilowatthours and so on.). Meters for smaller services (such as small residential customers) can be connected directly in-line between source and customer. For larger loads, more than about 200 amps of load, current transformers are used, so that the meter can be located other than in line with the service conductors. The standard electricity meters fall into two basic categories, electromechanical and electronic. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 21 Electricity meters 2.3.1 Electromechanical meters The most common type of electricity meter is still the electromechanical induction watthour meter. These meters will be progressively substituted by fully electronic meters because of many additional advantages of these meters (see Section 2.3.2 Electronic meters). The electromechanical induction meter operates by counting the revolutions of an aluminium disc that is made to rotate at a speed proportional to the power. The number of revolutions is proportional to the energy usage. It consumes a small amount of power, typically around 2 watts. The metallic disc is acted upon by two coils. One coil is connected in such a way that it produces a magnetic flux in proportion to the voltage, and the other produces a magnetic flux in proportion to the current. The field of the voltage coil is delayed by 90 degrees using a lag coil. This produces eddy currents in the disc and the effect is such that a force is exerted on the disc in proportion to the product of the instantaneous current and voltage. A permanent magnet exerts an opposing force proportional to the speed of rotation of the disc. The equilibrium between these two opposing forces results in the disc rotating at a speed proportional to the power being used. The disc drives a register mechanism that integrates the speed of the disc over time by counting revolutions, much like the odometer in a car to render a measurement of the total energy used over a period of time. 2.3.2 Electronic meters Electronic meters display the energy used on an LCD or LED display, and can also transmit readings to remote places. In addition to measuring energy used, electronic meters can also record other parameters of the load and supply such as maximum demand, power factor, reactive power used, and so on. They can also support time-of-day billing, for example, recording the amount of energy used during on-peak and off-peak hours. A typical electronic power meter has a power supply block, a signal conditioning circuit, a metering engine (AFE), a processing and communication engine (that is, a microcontroller), and other add-on modules such as RTC, LCD, communication ports and modules, and so on. A basic block outline of the electronic power meter, see Figure 2-3. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 22 Freescale Semiconductor, Inc. Chapter 2 Basic Theory User Selection voltage current analog Signal Conditioning AFE digital MCU ADC LCD AMR Communications Figure 2-3. Basic outline of the electronic power meter The signal conditioning circuitry is used for adapting a high-amplitude signal from the mains to a lower one, accepted by the AFE (ADC). The metering engine is given the voltage and current inputs, has a voltage reference, samplers. and quantisers followed by an ADC section to yield the digitised equivalents of all the inputs. All of this is sometimes called the Analog Front-End (AFE). These inputs are then processed using a DSP or MCU to calculate the various metering parameters such as powers, energies, and so on. The processing and communication section has the responsibility of calculating the various derived quantities from the digital values generated by the metering engine. This also has the responsibility of communication using various protocols and interfaces with other add-on modules connected as slaves. RTC and other add-on modules are attached as slaves to the processing and communication section for various input and output functions. On a modern meter, most if not all of this is implemented inside the microprocessor, such as the Real Time Clock (RTC), LCD controller, temperature sensor, memory, and analog to digital converters. One of the important features of the modern electronic power meter is AMR technology. The AMR is the technology of automatically collecting consumption, diagnostic, and status data from energy metering devices and transferring that data to a central database for billing, troubleshooting, and analyzing. This advance mainly saves utility providers the expense of periodic trips to each physical location to read a meter. Another advantage, is that billing can be based on near real time consumption rather than on MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 23 Voltage and current measurement estimates based on previous or predicted consumption. This timely information coupled with analysis, can help both utility providers and customers to better control the use and production of electric energy. Electronic meters with AMR technology can read and communicate through several mechanisms such as: • • • • • • Infrared Radio frequency Data modem (via a telephone line) Power line carrier Serial port (RS-485) Broadband AMR meters often have sensors that can report the meter cover opening, magnetic anomalies, extra clock setting, stuck buttons, inverted installation, reversed or switched phases, and so on. These events may be immediately sent to the utility company thanks to AMR technology. Smart meters go a step further than simple AMR. They offer an additional function, including a real-time or near real-time reading, power outage notification, and power quality monitoring. They allow price setting agencies to introduce different prices for consumption based on the time of day and the season. The feedback they provide to consumers has also been shown to cut overall energy consumption. In comparison to traditional mechanical or electromechanical power meter solution, the electronic meters offer the utility market several additional advantages including: • • • • • • • • Improved immunity and reliability Higher accuracy Higher security Support of a wide range of power factor loads Calibration is easier Anti-tampering protection including traditional or modern solutions Automated meter reading (AMR) Advanced billing methods (prepay, time-of-use, an so on.) 2.4 Voltage and current measurement In electricity meters the energy is calculated from two measured signals, voltage and current. For line voltage and line current measurement, systems that are generally called sensors are used. Whichever sensor is used for voltage and current measurement results in an AC voltage with a magnitude proportional to the signal being measured. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 24 Freescale Semiconductor, Inc. Chapter 2 Basic Theory The voltage sensor results in a sine wave with a fundamental frequency typically either 50 Hz or 60 Hz depending upon the power distribution used, see Section 2.2 Electricity distribution. For current measurement, the sensor provides a fundamentally sinusoidal signal (possibly with harmonics) which may lag or lead the voltage signal depending upon the load. A typical simplified configuration for metering voltage and current in a 1-phase 2-wire installation is shown in Figure 2-4. There are three typical sensors used for sensing current and voltage in power meters. All of these sensors are also used in the electronic power meter described in this manual. Figure 2-4. Typical measurement circuit in 1P2W installation The following sections describe the most used methods for sensing voltage and current used in the electronic power meters. 2.4.1 Voltage divider A voltage divider is used for voltage measurement. In a practical implementation, multiple series resistors are used instead of R1to limit the power dissipation and reducing heat generated thus improving accuracy, see Figure 2-4. The equation for computing output voltage of the voltage divider is defined as: MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 25 Voltage and current measurement Where Vin is the phase voltage and Vout is the voltage measured by the ADC (voltage drop at R2). The voltage divider can be selected to more closely meet the specification of the ADC. 2.4.2 Shunt resistor A shunt resistor is used to sense the current primarily due to the fact it does not distort the signal and is extremely low cost in comparison to other current measurement methods. The downside of using a shunt resistor is primarily the power dissipation that can create inaccuracies in the measurement due to resistive changes and due to temperature and waste of power. To limit the self heating effect of the shunt, the resistor is made using a metal with suitable properties. The resistance of the shunt is kept very low to reduce the power dissipation. Typically, shunt resistors are in the range of 100 μΩ to 300 μΩ and as such the voltage developed across them is very small. For example, 100 A drawn through a 200 μΩ shunt develops only 20 mV (Voltage = current * resistance) through a 300 μΩ shunt this would be 30 mV, which develops 2 W power loss and 3 W respectively. The problem of this approach is the very small voltages derived from the shunt resistor and the even smaller resolution of valid measurements. Therefore, a signal derived from the shunt resistor must be amplified to keep the correct measurement precision. An Operational Amplifiers are frequently used for this purpose (see Figure 2-4). There are several rules for a right selection of a shunt resistor in the application: • A shunt resistor must have good thermal properties (that is Manganin-Alloy with a low temperature coefficient of resistance) • Select the shunt size to maximize the dynamic range of the ADC input • Minimize the power dissipation in the shunt resistor NOTE Power dissipated by the shunt resistor plus the power supply used by the meter, must be below the specification for the meter (IEC1036 specifies a 2 W total power loss). MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 26 Freescale Semiconductor, Inc. Chapter 2 Basic Theory 2.4.3 Current transformer Current Transformers (CT) are used extensively for measuring current and monitoring of the power grid. Like any other transformer, a current transformer has a primary winding, a magnetic core, and a secondary winding. The alternating current flowing in the primary produces a magnetic field in the core, which then induces a current in the secondary winding circuit, see Figure 2-5. The CT is typically described by its current ratio (N) from primary to secondary. Relative to current output of the CT, it is necessary to use an external current to a voltage converter, such as a burden resistor Rb (see Figure 2-4), in systems where the voltage input of the ADC is used in the majority of applications. The primary objective of the current transformer design is to ensure that the primary and secondary circuits are efficiently coupled, so that the secondary current bears an accurate relationship to the primary current. Benefits of using a CT are that the output voltage can easily be matched to the capability of the ADC input by selecting appropriate winding or appropriate burden resistor (Rb), because of this, an OpAmp pictured at Figure 2-4 is not necessary. The next important benefit of using a CT is that this sensor isolates the measuring engine from the mains, therefore the CTs may be easily used in polyphase meters. A typical feature of a CT is the time shift (delay) between the primary and secondary currents in the windings. For using this in the power meters, it is good to know that the power meters must wait a specific time after the voltage measurement before reading the current from the CT. The delay required is specific to each CT and is established during calibration of the meter and programmed into the meter; as a part of calibration constants. CT coils have the negative effect of distorting the current measurement. Considering the magnetic core of the CT, it is necessary to respect a maximum recommended current in the primary winding (rating factor) because of saturation of its core. A good accuracy in the case of CT current measurement is directly related to other factors, including external electromagnetic fields and a change of temperature. Figure 2-5. Current transformer principle MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 27 Voltage and current measurement 2.4.4 Rogowski coil A Rogowski coil is an electrical device for measuring alternating current (AC) or high speed current pulses. It consists of a helical coil of wire with the lead from one end returning through the centre of the coil to the other end, so that both terminals are at the same end of the coil, see Figure 2-6. The whole assembly is then wrapped around the straight conductor whose current is to be measured. Because the voltage that is induced in the coil is proportional to the rate of change (derivative) of current in the straight conductor, the output of the Rogowski coil is usually connected to an electrical, or electronic integrator circuit to provide an output signal that is proportional to the current. One advantage of a Rogowski coil over other types of current transformers is that it can be made open-ended and flexible, allowing it to be wrapped around a live conductor without disturbing it. Because a Rogowski coil has an air core rather than an iron core, it has a low inductance and can respond to fast-changing currents. Also, because it has no iron core to saturate, it is highly linear even when subjected to large currents, such as those used in electric power transmission, welding, or pulsed power applications. A correctly formed Rogowski coil with equally spaced windings is largely immune to electromagnetic interference. Benefits of using a Rogowski coil are similar to using a CT, namely that the output voltage can more easily be matched to the capability of the ADC input by selecting an appropriate winding, load resistor and filter. Another advantage of a Rogowski coil, is the lower cost than a traditional CT, although it requires an integrator and additional phase compensation. Figure 2-6. A Rogowski Coil Principle MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 28 Freescale Semiconductor, Inc. Chapter 3 System Concept 3.1 Application description A standard system block diagram of the MCF51EM256 power meter concept is described in Figure 3-1. The full-metering system solution, that is all the components inside of the green-dashed rectangle, incorporate these parts: • Metering board, inside the grey-dashed rectangle — The main metering engine, here is the concentrated majority of metering components • Switch Mode Power Supply board — SMPS, this board is used for supplying the metering engine and the 1322x-LPN daughter card • External current sensors (CT, shunt resistor) — Located directly to the mains power connector inside the metering case • 1322x-LPN — Daughter card for ZigBee communication • Power Meter case with an integrated mains power connector and RS232 communication connector Some common parts of the power meter in the block diagram have the same color for better function identification, mainly the voltage and current sensors (red color), see Figure 3-1. There are two current sensors in the power meter; shunt resistor and current transformer, both are located near the mains power connector inside the power meter case, outside the metering board. There is voltage measurement sensor (voltage divider) which is located directly on the metering board. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 29 Application description Figure 3-1. MCF51EM256 power meter block diagram 3.1.1 Metering board The metering engine (board) is the main part of the power meter. Here are concentrated components such as: the MCU with AFE, signal conditioning part, LCD, buttons, LEDs, optical interface for the IEC1107 and RS232, voltage sensor, tamper button, 3 V battery, accelerometer, and connector for the 1320x-RFC daughter card. The metering board is designed on a two-sided printed circuit board. Most of the components are soldered on its top side (see Figure 3-2), with only some connectors soldered on the bottom side of this PCB, (see Figure 3-3). MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 30 Freescale Semiconductor, Inc. Chapter 3 System Concept Battery BDM Interface Display Infrared Interface User LED OC Interface Bias Voltage for OpAmps RS232 Interface EOC Interface CT Signal Conditioning Part (full configuration) CT Signal Conditioning Part (low-cost configuration) LED Interface Shunt Resistor Signal Conditioning Part Tamper Button Voltage Divider Reset Signal Button Conditioning Part LED Kvarh LED KWh MCU XTAL Power-on LED User Buttons MRAM Accelerometer Interface Figure 3-2. Top side metering board view Open-collector interface RS232 interface EOC interface 1322x-LPN or accelerometer interface 1320x-RFC interface Power supply Voltage interface Shunt interface CT interface Figure 3-3. Bottom side metering board view MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 31 Application description The core of the metering engine placed on the top side of the PCB is the 32-bit Coldfire V1 microcontroller, called the MCF51EM256 (for a description see Section 1.3 MCF51EM256 Microcontroller series). All of the MCU peripherals except for the BDM interface, which are currently used in the application are pictured in the block diagram in Figure 3-1. A simplified function of the MCU in the application is as follows: The ADC primarily reads data from voltage and currents sensors. The MCU computes other values like powers, energies, power factor, and line frequency consecutively. The MCU communicates with the user via the built-in HMI (LCD+buttons) or via several communication interfaces (RS232, ZigBee, IEC1107, LEDs, OC). A description of the metering algorithm is the content of this design reference manual, but it is described in application note titled FFT-based Algorithm for Metering Application (document AN4255). The HMI of this power meter is comprised of these parts: LCD, two user push-buttons, and one user (yellow) LED. On the LCD, the user can see plenty of computed values, such as the RMS value of line voltage and current, powers, energies, power factor, line frequency, and also actual time and date. By using the two push-buttons, the user can select one of these values to be shown on the LCD. NOTE There is only one value shown on the LCD at one time. The user yellow LED is part of the open-collector (OC) interface. The next important part of the metering engine board is the signal conditioning part. This part is used for adapting the signal level from sensors to the AFE (part of the MCU included ADC, VREF, and so on). There are several different types of signal conditioning parts with regards to sensors used: the part for voltage measurement is made of a simple voltage divider, which is also described as the voltage sensor in this Design Reference Manual. The part for current measurement via a shunt resistor is made from two operational amplifiers (only one is pictured in the simplified block diagram in Figure 2-4) with a resistive feedback network which produce two voltage signals with different gains (26x and 520x approximately). The current measurement via the current transformer (CT) is made in the first level by a burden resistor which works as a simple current to voltage converter. This connection produces only one-gained voltage measurement. The second level of signal conditioning for the current measurement via the CT is optional (dotted symbol for the OpAmp in the block diagram). This is done by several operational amplifiers, also with a resistive feedback network that produces two voltage level signals with different gains; because of this, a two-gained voltage measurement is executed (similar to the current measurement via a shunt resistor). MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 32 Freescale Semiconductor, Inc. Chapter 3 System Concept There are several communication interfaces on the metering board. The interface for RS232 is optically isolated via optocouplers and the interface for the IEC1107 is optically isolated via infrared components. The open-collector is a non-optically isolated output of the power meter – this may be used for switching some small loads (up to 1.6 W). One of the most interesting types of communication in this power meter is RF or ZigBee. Communication via RF/ZigBee is done primarily by the external 1322x-LPN daughter Card (outside the metering engine) which communicates with the metering board through the IIC interface. Secondarily, the RF communication may be done via the 1320x-RFC daughter card which communicates with the metering board through the SPI interface. But the preferential type of RF communication in this Power Meter is through external 1322x-LPN board (the IIC interface between the boards). Finally, two red LEDs are used for optical communication with utility service provider – this is energy output interface, the first LED is here for active energy counting and the second LED is for reactive energy counting. The essential parts of the metering board are components for proper function of the RTC part of the MCU, including the 3 V battery (for saving date and time), crystal and external tamper push-button. The tamper push-button is used only for simulation purposes in this power meter, because it needs user interaction. But in true power meters this button is hidden inside of the power meter and waits for the cover opening by the user – in this case, the illegal interference to the metering engine is detected. The other way of tamper detection in this power meter may be by using a 3-axis IIC accelerometer—the MMA7660FC silicon may be used for that. The MCF51EM256 power meter currently does not use this type of tamper detection, however the interface for it is now prepared. An illegal cover opening can cause a 3-axis motion that which can be detected by this accelerometer. Then some kind of sophisticated algorithm must be used consecutively, because this event must be filtered from ordinary motions of the power meter and interpreted as an illegal cover opening. But this type of tamper detection is only optional, primarily the tamper push-button is used for that. 3.1.2 Switch mode power supply board connection The SMPS board is used for supplying the metering board engine. The SMPS used in this application is a 3-rd party open-frame solution for the power supply that produces one galvanic-isolated level of output voltage. This open-frame SMPS module has a wide range of input AC voltages beginning at 85 V RMS up to 264 V RMS with a wide range of mains frequency (47 Hz to 63 Hz) too. Thanks to input parameters of this SMPS, the whole power meter can work with mains of these voltage and frequency ranges. The output voltage is fixed to a 3.3 V DC level with 1.3 A nominal output current, and the power rating is then 4.3 W. The board overview is in Figure 3-4. There are two power MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 33 Application description connectors on this board—on the left side there is an input socket for connection to the mains (L_inp, N_inp), and on the right side there is an output socket for supplying the board. The SMPS is screwed onto the bottom part of the power meter case and connected to the mains and metering board via two thin cables. +3.3V N_inp L_inp GND Figure 3-4. SMPS board view 3.1.3 External current sensors connection There are two types of external current sensors as was described above: shunt resistor and current transformer. For the correct mains current measurement in the basic power meter configuration, only one of these sensors is required. In the full metering configuration, two sensors are used. In this configuration, the shunt resistor is used for phase current measurement, the CT is used for neutral current measurement. LINE_IN LINE_OUT GND L_inp L_out Figure 3-5. Shunt resistor description MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 34 Freescale Semiconductor, Inc. Chapter 3 System Concept The shunt resistor is mainly a MANGANIN® resistor of an accurately known resistance, in this case 150 μΩ . This shunt resistor is intended for current measurement of up to 100 A RMS. The voltage drop across the shunt resistor is proportional to the phase current flowing through it, because its resistance is known, a small voltage drop is amplified by operational amplifiers, and then measured by the internal ADC of the MCU. For a photo of this shunt resistor see Figure 3-5.The terminal connection of this shunt resistor is divided into two parts—power connection and sense connection, because of this, a 4-wire current measurement may be done. The power connection is intended for a connection between the phase input (L_inp) and phase output (L_out) connectors. The sense connection of this shunt resistor is intended only for measuring its voltage drop. NOTE There is also a separated ground terminal in the sense connection area for the metering board ground connection. This ground terminal is located on the same side as the power phase input (L_inp). The CT is also used for current measurement. In the basic configuration (low-cost), it is intended for phase current measurement equally to the shunt resistor, but in a full-system configuration (where a shunt resistor is used) the CT is used for neutral current measurement. The primary winding of this CT is created from a one-coil hard wire, connected between the phase input and phase output terminals (basic configuration), or between the neutral input and neutral output terminals (full-system configuration). In fact, this hard wire connection is executed by several (two) wires connected in parallel. For a maximum flowing current of 100 A RMS, a minimum of 16 mm2 of conductor cross-section is required. There is a CT description in Figure 3-6. Gap for primary winding Secondary winding termination Figure 3-6. Current transformer description MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 35 Application description 3.1.4 1322x-LPN connection The 1322x-LPN is intended for use of a ZigBee node for the power meter. It works as an inter-mediator between the power meter and a ZigBee coordinator which is based at the utility provider area for example. The ZigBee coordinator scans data from numerous equipment (power meter, home thermostat, sensor, dimmer switch, and so on.) in the ZigBee network and sends it to the central (PC) station. The 1322x Low Power Node is screwed on the bottom part of the power meter case, similar to where the SMPS is, and connected as a daughter card to the metering engine through a thin flat cable. The board overview is in Figure 3-7. There are two (optionally three) pairs of wires for its connection to the metering board: the first pair is for supplying the node (3.3 V, GND), the second pair is for the IIC communication lines (SCL,SDA), and the last optional pair is for resetting the node by the external RESET push-button which is placed on the metering board. NOTE The RESET push-button is used primarily for supplementary resetting the metering board, but for resetting the 1322x-LPN there are unused pins for doing this. IIC connections Power connection arrea + Reset pin Figure 3-7. 1322x-LPN Board View MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 36 Freescale Semiconductor, Inc. Chapter 3 System Concept 3.1.5 Power meter case Placed in a power meter case are all the components mentioned (boards, sensors, and so on). It is made as a base with the terminal compartment cover, an EPDM gasket, and a smoked transparent cover with a PUR gasket. It is intended primarily for DIN-rail mounting in a vertical position (for example, on the wall ). Ingress protection of this case is IP65, but due to apertures for push-buttons, it is downgraded to IP42. Because of the transparent cover, the metering board with all its components, including the LCD primarily are easily visible. Spacer RS232 flat cable & connector Spacer SMPS CT Primary winding for CT N_out N_inp L_out L_inp Metering Board Spacer 1322x-LPN Shunt Resistor Spacer Figure 3-8. Power meter case — inside view Figure 3-8 shows a photo of the metering case. You can see the boards and the current sensor placements. There are also three or four power terminals in the terminal compartment section. The number of terminals (3 or 4) depend on the system configuration—basic with one current sensor (three terminals), or full-system with two current sensors (four terminals). The main metering board is screwed onto four spacers on the front side of the power meter case. On the bottom inside of the case there are the SMPS and 1322x-LPN daughter card. The shunt sensor is soldered directly between the two left power terminals (L_inp,L_out), and the CT sensor with its hard-wires, is MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 37 Application usage connected between the two right power terminals (N_inp,N_out). On the right side of this case, there is an RS232 connector, which is connected to the main board via a thin 9-pin flat cable. 3.2 Application usage 3.2.1 Power meter hardware configuration This power meter is primarily used for demonstration purposes of the MCU used in a single-phase two wire installation. For a better practical demonstration of the power meter, the metering case is placed on a perspex base where an outlet is also placed (for load connection) and a cable with a plug (for connection to the power mains). The whole configuration is also called the power meter demo, see Figure 3-9. SW2 Tamper SW1 Reset Transparent cover Metering engine Case Terminal compartment Plug Pedestal Outlet Figure 3-9. The power meter demo view MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 38 Freescale Semiconductor, Inc. Chapter 3 System Concept Although the current range of this power meter is internally set for a current measuring of up to 100 A, for practical use this range is decreased to approximately 16 A, adequate for demonstration purposes. This is caused by a maximum current rating of the outlet and plug used. For customers who want to use the whole metering range up to 100 A, both the plug and outlet must be replaced by more powerful ones. For remote data communication the RS232 port may be used or the in-built ZigBee node. Some communication interfaces, like an open-collector and so on are not directly accessible.You must first open the cover of the case to access their connections. 3.2.2 Application example The power meter demo can work in several hardware configurations, depending on the current sensors used. In the basic or low-cost configuration it works only with one current sensor, the shunt resistor or CT described in Section 3.1.3 External current sensors connection. One of these sensors can measure line current only. The full metering configuration allows measuring of not only the line current, but also the neutral current. Because of this, several tampering techniques may be used for protecting against hacking in the energy systems. For example, against a partial earth fault condition. An earth fault means some of the load is connected to another ground potential and not the neutral wire. Figure 3-10 shows a normal connection in a full-metering configuration and how the phase and neutral wires are connected to the single-phase power meter. NOTE The current going through the phase wire is the same as that coming out of the neutral wire (IP=IN). Figure 3-11 shows a partial earth condition where one of the loads is connected to the ground and thus part of the return current I2 does not go through the meter. Thus the current in the neutral wire IN is less than that in the phase or live wire (IP). To detect this condition, the power meter firmware monitors the current on both energy wires, phase and neutral, and compares them. If they differ significantly, the firmware uses the larger of the two currents to bill the energy and signals a fault condition. This is one of the tampering events in the power meter. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 39 Application usage phase neutral Single Phase Energy Meter IP L_inp Fault shunt L_out N_inp IN metering engine CT N_out I1 I2 Figure 3-10. Normal phase neutral connection for 1-ph power meter phase neutral Single Phase Energy Meter IP L_inp Fault shunt L_out N_inp IN metering engine CT N_out I1 I2 Figure 3-11. Partial earth fault condition MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 40 Freescale Semiconductor, Inc. Chapter 4 Hardware Design of the Metering Board 4.1 Introduction to hardware implementation This chapter describes the design of the application hardware, that is the design of the metering board (engine). The main hardware is divided into two main parts, digital hardware (HW) and analog hardware. Analog HW is also called signal conditioning in this manual. Both of these parts are configurable depending on the customer request, from a low-cost up to a high performance configuration. The stand-alone section of the metering board is the power supply section, this is a mandatory part of each configuration of the power meter. There are also plenty of test points in some important parts of the metering board for primarily metering and testing purposes. 4.2 Power supply The power supply section is used only for adapting the voltage level from the external SMPS to the internal board, including also the overvoltage protection and signalize function (LED) - see Figure 4-1. Connector J1 placed on the bottom side of the PCB is the input power supply connector of the board. This connector must be joined to the external SMPS, therefore, pin 1 of connector J1 to 3.3 V on the SMPS and pin 2 of the connector J1 to the GND of the SMPS. As you can see, there is a simple overvoltage protection including the Zener diode D1 and D3. These diodes protect against a reversing of polarity. Some circuits of the whole design require two separate power supply levels, a digital and analog power supply. The analog power supply level is separated from the digital part of the power supply by the chip inductors L1 and L2 with filters (C5―C7) co-operation. The analog power supply level is consequently marked +3.3 VA in the schematic, analog ground is then marked GNDA. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 41 Digital hardware For presence of an external power supply level (from the SMPS) there is a green LED D2 in the power supply section. +3.3V B CON_2_TB 1 +3.3VA 1 2 D1 GND 1 A MMSZ5231BT1G J1 D2 WP7104LGD + C3 47UF C1 0.1UF GND 2 5.1V R2 330 GND GND GND L1 C4 100PF L2 1 1uH 1uH 2 2 C5 C6 0.1UF 100PF + C7 47UF D3 MMSZ5231BT1G 5.1V GNDA GND Figure 4-1. Power supply part of the metering board 4.3 Digital hardware 4.3.1 MCU core The MCU is the core of the metering board. It is marked U1 in the schematics. The MCU core with all key components are diplayed in the digital section of the schematic in Figure A-1 or Figure A-3. For the MCU to function correctly, several components are necessary: • • • • Filters C8–C12, C48 Crystal Y1 Battery BT1 (for RTC only) Tamper push-button TAMPER1 for simulation only (for RTC only) Analog circuits (ADC, PRACMP) are also present in the MCU, therefore analog power supply is necessary for supplying it. Another part of the the MCU core, which we may simply assign to it, is the HMI. These components include the display LCD1 and the two user push-buttons SW1 and SW2 with simple filters C13, C17. Pull-up resistors for the buttons are software selectable by the MCU. The charge pump for the LCD is the part of the MCU. Therefore, only minimum external components regarding the LCD are required, in fact, only capacitors C14, C15, C16, and C18. Connector J3 is the BDM interface for MCU programming. Be careful about programming the MCU through this interface in the configuration where the power meter demo is fed from the mains. This interface is not isolated from the mains, therefore an electric shock can arise. To prevent this, use an external optically isolated BDM interface. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 42 Freescale Semiconductor, Inc. Chapter 4 Hardware Design of the Metering Board However, the best solution for MCU re-programming is using the bootloader in cooperation with the optically isolated RS232 data line (see at Section 5.2.3 Code reprogramming via serial bootloader). There is a RESET1 push-button that can reset not only the MCU, but also the external 1322x-LPN daughter card, this is because of the unused pins 4 and 5 of this button. Here, this button is only for evaluation purposes in real power meters there is no room nor reason for it. The auxiliary part of the MCU core is an external universal SPI MRAM, whose density is 1 Mb. 4.3.2 RS232 interface This interface is primarily used for a basic set-up of software for the meter, this includes calibration and checking sensor outputs. The second function of this interface is programming the power meter from a PC by a bootloader (see Section 5.2.3 Code reprogramming via serial bootloader). Communication is optically isolated through optocouplers ISO1 and ISO2. Because of using two additional signals on the serial data line, RTS and DTR, the secondary side of ISO1 and the primary side of ISO2 are powered from the RS232 data line (from the PC side). These signals are normally used for transmission control, but this function is not used in the application, it is because of the fixed voltage level on these control lines used for supplying these optocouplers, in cooperation with others components. These components include, D6–D8, C19, R7, and R13. The part of the schematic including the RS232 communication interface can be seen in Figure 4-2. TP5 ISO1 R7 4.7K SFH6106-4 R9 1.0K C19 ISO2 2.2UF 1 + 3 D7 2 R13 470 TP6 4 1 1 SFH6106-4 D8 MMSD4148T1G 4 +3.3V 2 RS232_TXD RS232_RXD RTS 2 1 (+12V) 1 3 R6 330 MMSD4148T1G 2 D6 J5 RXD TXD DTR GND 1 3 5 7 9 2 4 6 8 10 CON_2X5 2 MMSD4148T1G GND Figure 4-2. RS232 communication interface of the metering board MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 43 Digital hardware 4.3.3 Infrared interface (IEC1107) This interface uses infrared components, the high efficiency IR emitting diode D9, and the NPN phototransistor Q3. Both of these are through-hole assembled. Other than these, some necessary passive components are used such as R8, R10, R12 and C21. The part of the schematic including the IEC1107 communication interface can be seen in Figure 4-3. TP7 +3.3V C21 Q3 OP506B 2 0.1UF 2 IR_RX TP8 R8 680.0 R10 22K R12 1.0K 1 IR_TX IR_RX TSAL4400 GND 1 GND D9 GND Figure 4-3. IEC1107 part of the metering board 4.3.4 User interfaces The part of the schematic including both user interface parts can be seen in Figure 4-4. One of these interfaces is also called the open-collector interface (OC). It has two functions, primarily, it is used for switching some small loads up to 1.6 W, by using the NPN transistor, Q1. It switches the voltage level 3.3 V through an external load to GND. The second function of the user interface optically signalizes some program states via a yellow LED D4 that may be used for debugging purposes. NOTE The user interface uses the same control signal from the MCU for OC interface and for LED controlling. 2 +3.3V LED_USR R3 1 220 EOC_PULSE R14 330 2 3 EOC_OC 2 EOC_OE 1 TP9 GND 1 ISO3 A Q1 J2 MMBTA42 2 220 R4 3 1 CON_2_TB B D4 +3.3V 1 CON_2_TB B A J7 4 SFH6106-4 2 WP7104LYD GND Figure 4-4. Two user interface parts of the metering board MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 44 Freescale Semiconductor, Inc. Chapter 4 Hardware Design of the Metering Board There is also one general purpose user interface, called the EOC interface. This interface is optically isolated through optocoupler ISO3. Output from this interface is accessible on the connector J7. 4.3.5 LED interface The LED interface is used for energy counting. There are two separate high-efficiency red LEDs for doing this, D5 for active energy counting and D15 for reactive energy counting. Both of these LEDs are through-hole assembled for a better placement near the cover. The part of the schematic including the LED interface can be seen in Figure 4-5. LED_kVarh R59 330 LED_kWh R5 330 2 D15 1 WP7104LSRD D5 2 1 +3.3V WP7104LSRD Figure 4-5. LED part of the metering board 4.3.6 SPI interface This interface is used exclusively for joining the 1320x-RFC daughter card to the metering board through the 40-pin header J8. Communication between the boards uses SPI data lines. The part of the schematic including the SPI communication interface can be seen in Figure 4-6. J8 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 RF_RESET RF_ATTN SPI1_SCK SPI1_MISO GND 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 IRQ RF_RTXEN SPI1_MOSI RF_CE +3.3V CON_2X20 Figure 4-6. SPI Interface Part of the Metering Board MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 45 Digital hardware 4.3.7 Accelerometer interface The accelerometer function in this power meter was minutely described in Section 3.1.1 Metering board. The section of the schematic including the accelerometer interface can be seen in Figure 4-7. In this schematic, the accelerometer is marked U6. The accelerometer may be used in this power meter for tamper detection (optional only) instead of the standard button.The accelerometer communicates with the MCU through IIC data lines, therefore external pull-ups R60 and R61 on the SDA and SCL lines are required. There is also the possibility of placing the accelerometer outside of the metering board, like the daughter card thanks to the IIC header J4. This daughter card may be placed on the inner side of the case cover for a better detection of tamper events. 1 +3.3V 5 3 1 J4 6 4 2 3 2 BAT54CLT1 HDR 2X3 SCL SDA /INT D16 V_BAT GND 10 9 C44 C45 8 10UF 0.1UF 7 6 R61 1.0K R60 1.0K GND U6 NC2 RESERVED DVDD NC1 DVSS AVDD SDA AVSS SCL INT MMA7660FC 1 2 3 4 5 C46 C47 10UF 0.1UF GND Figure 4-7. Accelerometer interface part of the metering board 4.3.8 IIC interface The IIC interface is used for joining the accelerometer (Section 4.3.7 Accelerometer interface), and the 1322x-LPN Daughter Card. This daughter card is used primarily for RF/ZigBee communication, more often then the 1320x-RFC daughter card is used. The 1322x-LPN board is connected via a thin flat cable directly to the 6-pin header J4 of the metering board and also to the RESET1 push-button of the metering board. A schematic of the connection between the metering engine and daughter card can be seen in Figure 4-8. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 46 Freescale Semiconductor, Inc. Chapter 4 Hardware Design of the Metering Board 1322x-LPN 1 I2C_SDA 3 5 7 9 11 J1 Metering board +3.3V 5 3 1 2 4 I2C_SCL 6 8 10 12 J4 6 4 2 HDR 2X3 GND 90122-12 BC1 GND 2 - 2xAAA Cells 1 +3.3V + 2468 J17 1 2 TSM-102-01-L-SV 6 RESET1 1 5 2 4 3 P12S1LZ Figure 4-8. Interface between 1322x-LPN and the metering board 4.4 Signal conditioning In regards to various signal conditioning part configurations, there are also various power meter configurations. These configurations depend not only on the analog parts, but also on digital configurations. There are three power meter configurations differentiated in regards to the current signal conditioning section: • Full configuration with both a CT (1 gain or 2 gains) and a shunt resistor (2 gains) current measurement. For sensor connections to the board see Figure 4-9, for a schematic view see Figure A-1, and Figure A-2. For layout views see Figure B-1 and Figure B-2, and for the BOM see Table C-1. • Low-cost configuration with a shunt resistor (2 gains) current measurement. For sensor connection to the board see Figure 4-10, for a schematic view see Figure A-3, and Figure A-4, for layouts views see Figure B-5 and Figure B-6, and for the BOM see Table C-4. • Low-cost configuration with a CT (1 gain) current measurement. For sensor connection to the board see Figure 4-11, for a schematic view see Figure A-3 and Figure A-5, for layouts views see Figure B-3 and Figure B-4, and for the BOM see Table C-3. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 47 Signal conditioning L_inp L_out LOAD N_inp N_out Figure 4-9. Shunt and CT current measurement connection MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 48 Freescale Semiconductor, Inc. Chapter 4 Hardware Design of the Metering Board L_inp L_out LOAD N Figure 4-10. Shunt current measurement connection L_inp L_out LOAD N Figure 4-11. CT current measurement connection MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 49 Signal conditioning Apart from these three basic configurations, others may be constructed by adding or disconnecting some digital parts of the power meter configuration, for example the infrared or OC communication. Be careful, some parts mainly in the digital area are vital (MCU core, RS232 communication, and so on). 4.4.1 Voltage measurement There is a simple voltage divider used for the line voltage measurement in Figure 4-12. It is a basic and key part of each configuration of the power meter. In the basic block diagram (see Figure 3-1) there is a voltage divider, based on two simple resistors. In a practical implementation it is better to design this divider from several resistors connected serially due to a power-loss spread. One part of this total resistor consists of R32, R33, R34, and R57, the second part consists of resistor R36. The basic voltage divider described produces a sine voltage signal around ground. This is not acceptable for the ADC, because all voltage signals connected to it must be above ground (single-ended configuration). Therefore, a further voltage divider that raises the signals is added to the connection. This second divider is made from the R29||R30 combination and from the R36 (a part of the mains divider). The ratio of this second divider allows having a voltage on the ADC input from 0 V to 1.2 V (Vref). The sine voltage signal from the mains is then shifted to Vref/2, that is 0.6 V approximately (voltage at VLINE, see Figure 4-12). VDDA TP13 R29 100k N_IN R57 220K R32 220K R33 100k R34 47k R30 4.7K VLINE R35 47 V_OUT V_OUT 1.2V +/-0.6V 1k R36 GNDA C30 1000pF LPF CUTOFF 3.4MHz GNDA Figure 4-12. Voltage signal conditioning part schematic Finally, there is a simple RC low-pass filter (R35+C30) at the end of the voltage divider. The cut-off frequency for that is set to 3.4 MHz according to this relation: MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 50 Freescale Semiconductor, Inc. Chapter 4 Hardware Design of the Metering Board 4.4.2 DC Bias circuit This circuit is used for raising the voltage signal levels to about Vref/2 in the current measurement. This is necessary for converting the input signal levels from differential to a single-ended configuration, required by the ADC. Its function is the same as the function of the voltage divider R29||R30 plus the R36 in the voltage measurement section (see Section 4.4.1Voltage measurement). In comparison to that voltage divider, higher output loading is required because of using this connection in several parts of the current measurement sections (see below). Therefore, an operational amplifier U7, working as a voltage follower, is used for that. This amplifier extends loading of the basic voltage divider (R21, R56), that produces a DC bias offset of 0.6 V, for using in other parts of the current measurement sections. The part of the schematic including DC bias circuit is in Figure 4-13. R21 1.8K VDDA 8 3 + 2 GNDA - C25 1UF GNDA 1 DC_BIAS 0.6V DC_BIAS MC33502DG 4 R56 390 TP11 U7A GNDA Figure 4-13. DC Bias circuit schematic 4.4.3 Shunt resistor current measurement Because there is a very small voltage drop at the shunt resistor, external amplifiers must be presented in this part of the connection. Finally, there are two operational amplifiers used and housed in one package U3 (see Figure 4-14) and some feedback resistors for the correct function.The first gain stage is made from one half of U3 and resistors, R22, R24, R25, and R28. For maintaining a good signal stability in this gain stage at higher frequencies, there is a filter C23 with a small capacity value. This first gain stage works as a differential amplifier for amplifying higher levels of input signals, and as a preamplifier for the next gain stage, with this gain: MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 51 Signal conditioning The second stage of the signal conditioning for current measurement is made from the second half part of the operational amplifier U3 and as usual with the cooperation of a resistive feedback network (R23, R26) and input bias-adjusting resistor R31. The capacitor (filter) C27 has the same function as filter C23 in the first gain stage, for maintaining the signal stability. NOTE The second gain stage works in co-operation with the feedback resistors as an inverting amplifier and because of this, it inverts the phase of the input signal. Between the first and the second gain stage there is 180 degree phase shift. The second gain stage is primarily used for amplifying low levels of input current signals with this gain ratio: Between both of these gain stages, there is an isolated capacitor C28, which is used for cutting off the DC offset. Therefore, the DC offset from the first gain stage is 0.6 V. Both of these gain stages also have their own RC low-pass filter and similarly to the voltage measurement (see the previous chapter) are adjusted to 3.4 MHz, approximately (f3db): NOTE Filter capacitors (C24, C29) must always be placed as close as possible to the ADC inputs (layouts in the Appendix section). This requirement is also valid for filter C30 in the voltage section. Notice that all the signal levels in this section are raised above Vref/2 (0.6 V), because of the DC bias circuit. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 52 Freescale Semiconductor, Inc. Chapter 4 Hardware Design of the Metering Board TP10 R20 C23 SHUNT_LO 10 PF R22 47k LINE_IN 4 3 U3A MC33502DG 10UF R26 4.7K C27 10 PF R23 100k 6 5 TP12 R27 U3B SHUNT_HI 7 C29 47 1.2V +/-0.6V 1000pF MC33502DG 8 + 47k R28 1 C28 SHUNT_LO 1.2V +/-0.6V + Shunt 150uOhm GNDA 2 R24 1.8K R25 1.8K GNDA LPF CUTOFF 3.4MHz - LINE_OUT C24 1000pF - 47 VDDA DC_BIAS 0.6V R31 100k GNDA LPF CUTOFF 3.4MHz Figure 4-14. Shunt resistor signal conditioning part schematic 4.4.4 CT current measurement A current measurement through the CT sensor works in two modes: • Basic (low-cost) mode without an external OpAmp — One-gained measurement • Full-configuration mode with four OpAmps — Two-gained measurement The basic component in both of these modes is a burden resistor(s) R40||R45. Other circuits are not needed for adjustment of the voltage drop on the burden resistor up to the Vref voltage level (for maximum input current). In fact, only two balancing resistors are used, R42 and R48, which are connected from its midpoint to the DC bias voltage level made by the DC bias circuit (see Section 4.4.2 DC Bias circuit). The reason for this, is the same as in the previous measurement section, for shifting the voltage level above Vref/2 (0.6 V). For the basic (low-cost) configuration an RC low-pass filter which consist of two resistors R44, R49, and capacitor C35 are still only needed. The output signals from this filter (CT_I1+, CT_I1-) are fully-differential in comparison to the shunt resistor current measurement. Finally, for proper activation of the basic CT current measurement mode to bypass the first gain stage around U4 operational amplifier is still needed. For doing this, the jumpers J10 and J13 must be set to position 1–2. Both of these jumpers are not original components. They are made as small tin SMD shapes on the printed circuit board. For a basic CT current measurement only a few passive components in this section are needed, therefore it is called low-cost configuration. It has only one gain set by the value of burden resistors R40||R45 (see Figure 4-15). MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 53 Signal conditioning TP14 J10 3 PAD JUMPER A 2 CT_IN+ 1 CT_IN- J11 R45 R40 39 39 3 R44 DC_BIAS 0.6V 1 J13 CT_I1+ C35 1000pF R49 1.8K R48 CT= 1:2500 1.2V +0.6V 47 47 3 B 1.8K R42 2 CON_2_TB 2 1 TP16 CT_I11.2V -0.6V TP18 LPF CUTOFF 1.7MHz TP19 3 PAD JUMPER Figure 4-15. CT signal conditioning part schematic in low-cost configuration A full-configuration mode in the case of CT current measurement means a two-gained input current measurements, similar to current measurement via a shunt resistor (see Section 4.4.3 Shunt resistor current measurement). A schematic for this configuration can be seen in Figure 4-16. For proper activation of this mode, jumpers J10 and J13 must be switched to position 2-3. The full-configuration mode is done by two independent cascaded sections with instrumentation amplifiers. Each instrumentation amplifier section is created by two simple operational amplifiers housed in one package. A total of four OpAmp are used (two IC). The instrumentation amplifier is a type of differential amplifier with a low DC offset, low drift, high open-loop gain, high CMRR, and high input impedances. The first instrumentation amplifier section is made from OpAmp U4 and the resistive feedback network (R38, R46, and R54) which gives this gain: Although the gain ratio of this first stage is set to 17.7 the ohm value of the input burden resistor R40||R45 must be adequately decreased in this case (approximately 18 x). Filters C32 and C42 connected in parallel to the feedback resistors are used only for maintaining the signal stability (against the signal oscillation). Resistors R41 and R51 are used only for input bias current adjustment and their values are not critical. The second instrumentation amplifier section consists of the OpAmp U5 and a resistive feedback network (R37, R47, R55) which gives this gain: MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 54 Freescale Semiconductor, Inc. Chapter 4 Hardware Design of the Metering Board J10 3 PAD JUMPER 3 1 10 PF R38 100k VDDA VDDA 10K A CT_IN+ 1 CT_IN- R45 R40 39 39 J11 DC_BIAS 0.6V 1.8K R48 CT= 1:2500 R46 12k R44 MC33502DG 47 GNDA 5 U4B 7 47 C42 + U5A - R47 12k C35 1000pF CT_I11.2V -0.6V R43 1.2V +0.6V CT_I2+ 47 C33 1000pF GNDA 6 5 U5B 7 R52 1.2V -0.6V CT_I2- 47 MC33502DG 10K R54 100k 1 MC33502DG CT_I1+ TP18 R53 MC33502DG 2 1.2V +0.6V R49 6 R51 10K TP19 - 4 2 10K + B 1.8K R42 3 TP16 1 - CON_2_TB 2 + U4A 8 3 TP15 4 8 R41 + TP14 R37 100k R39 - 10 PF 2 C31 C32 R55 100k TP17 LPF CUTOFF=1.7MHz C43 3 1 J13 2 10 PF 10 PF 3 PAD JUMPER Figure 4-16. CT signal conditioning part schematic in full configuration Others components, such as filters C31, C43 and resistors R39, and R53 perform the same function as in the first gain stage. The simple RC low-pass filters terminate both of these measurement sections. The cut-off frequency is computed as: NOTE Filters C35 and C33 must be placed as close as possible to the MCU (U1) where the ADC is (see layouts in the Appendix section). The first gain stage is used for amplifying higher levels of input current signals and as a pre-amplifier for the second gain stage, which is used for amplifying lower levels of input current signals. 4.4.5 Input protection An input protection section is an important part of the power meter—it protects the integrated circuits against overvoltages and spikes that sometimes occur in the power line. A high-energy spikes are absorbed primarily by varistor RS1. A low-energy spike is MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 55 Signal conditioning absorbed by diodes D10–D14 (see Figure 4-17). All of these diodes do not allow an input voltage in each measurement input part to be higher than 3.3 V and lower than 0 V (in respect to the voltage drop on the diode). D10 1 3 GNDA VDDA VLINE 2 BAV99LT1 LINE_IN D11 1 3 LINE_OUT 2 BAV99LT1 LINE_OUT D12 1 3 LINE_IN 2 BAV99LT1 D13 1 GNDA VDDA 3 CT_IN+ 3 CT_IN- 2 BAV99LT1 D14 1 GNDA VDDA 2 BAV99LT1 Figure 4-17. Schematic of input protection diodes MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 56 Freescale Semiconductor, Inc. Chapter 5 Application Set-Up 5.1 Setting-up the demo hardware The following section is focused on setting-up the metering demo hardware. For better orientation in the power meter demo see Figure 3-9. • • • • • Connect the power meter plug directly to the power line Green power LED turns-on at this time Connect an external load to the single phase outlet LCD shows the RMS line current in Amp after a power-on (default state) User can also see other values on the LCD by pressing push-buttons SW1 or SW2. These values include: • Active energy in kWh • Reactive energy in kVArh — Value with R symbol on the left side of the LCD • Actual time — Format is, hour, min, sec, plus the TIME symbol • Actual date — Format is, day of week, day, month, year plus the DATE symbol • Line frequency — Is the value with Hz symbol on the right side of the LCD • RMS line voltage — Value with U symbol on the left side of the LCD, plus the volts symbol • RMS line current — Value with I symbol on the left side of the LCD, plus the Amps symbol • Active power — Value with W symbol on the right side of the LCD • Reactive power — Value with Var symbol on the right side of the LCD • Apparent power — Value with VA symbol on the right side of the LCD • Power factor — Value with PF symbol on the left side of the LCD • Both the energies (active and reactive) are saved in non-volatile memory. These energies remain in the memory after resetting the power meter. For clearing energy counters, you must push both of the SW buttons during reset. • When you push only the SW1 button during any soft or hard reset, the LCD shows the actual version of the internal software. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 57 Setting-up the software demo • Press the Tamper button for a tampering simulation. There will be a Tampering text on the LCD after pressing this button and a fire symbol on the LCD appears. The fire symbol remains on the LCD after any reset, because this information is saved in the non-volatile memory. For clearing the tamper status you must push both of the SW buttons during any reset (soft or hard reset). NOTE Together with the tamper status, both energy counters are also erased. • A soft HW reset of the power meter is done by the Reset push-button, a hard HW reset is executed by disconnecting the power meter plug from the power line network. • Energy LEDs are flashing simultaneously with internal energy counters. • 3 V battery is used for the RTC function and the data storage (tamper plus energy counters). • RS232 plug is used for code flashing and for FreeMASTER data visualization and calibration 5.2 Setting-up the software demo The following section is focused on setting-up the metering demo software. 5.2.1 FreeMASTER data visualization For FreeMASTER data visualization the RS232 cable between the power meter and the PC must first be connected. The FreeMASTER visualization script is the software for remote visualization and remote settings of the power meter up via an RS232 cable. This software runs on the PC that connects to the power meter via an RS232 cable. FreeMaster visualization script is the application that runs under FreeMASTER software. FreeMASTER software is one of the off-chip drivers which supports communication between the target microcontroller and a PC. This tool allows the programmer to remotely control an application using a user-friendly graphical environment running on a PC. It also provides the ability to view some real-time application variables in both textual and graphical form. FreeMASTER software runs under Windows 98, 2000, or XP. It is a versatile tool to be used for multipurpose algorithms and applications. It provides a lot of excellent features, including: • Real-time debugging • Diagnostic and a visualisation tool MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 58 Freescale Semiconductor, Inc. Chapter 5 Application Set-Up • Demonstration tool • Education tool Before running a visualization script, FreeMASTER software must be installed on your PC. After, a FreeMASTER visualization script may be started after double-clicking on the EM256kWh.pmp file in the current directory (EM256kWh project). Following this, a visualization script will appear on your PC (see Figure 5-1). You must now set the proper serial communication port and speed in the menu Project/ Option (see Figure 5-2). To do this, you must click on the Start/Stop Communication button. After, you must set the proper Project.abs project file in the menu Project/Option/ MAPfiles (see Figure 5-3). This file is accessible in the Bin directory of the EM256kWh project. If all previous settings are correctly done, the FreeMASTER visualization script for the power meter is now running. At this point you can see the voltage and current diagram in the time domain and in the frequency domain (in FFT window). You may also see other variables in a text format like frequency, VRMS, IRMS, and so on. Figure 5-1. FreeMASTER visualization script (GUI) MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 59 Setting-up the software demo Figure 5-2. FreeMASTER communication port setting Figure 5-3. FreeMASTER project file setting 5.2.2 ZigBee communication ZigBee communication is only optional and is not implemented in every power meter demo. There is a 2.4 GHz 1322x daughter card inside the power meter. The ZigBee module and the power meter are connected through the IIC. For joining the power meter MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 60 Freescale Semiconductor, Inc. Chapter 5 Application Set-Up to the ZigBee network, you will need the 1322x-SRB module, this is like a ZigBee coordinator (see Figure 5-4). The power meter can now easily become part of the smart grid. Figure 5-4. 1322x-SRB as ZigBee Coordinator Here is a standard communication procedure for joining the power meter to smart grid: • Install the latest version of the BeeKit from the Freescale web page. There is also a ZeD monitor and is a separate part of the BeeKit. Use the ZeD monitor for demonstrating ZigBee communication between the power meter and the PC • Switch the power meter on and connect some load to the power meter outlet • Connect the ZigBee coordinator (1322x-SRB) to the PC through a USB cable and switch the coordinator on. The coordinator must be powered. To do this, plug the AC adaptor to the coordinator (you may also use the internal battery inside of the coordinator module), or use a USB power line from the PC side (this is the best choice). You will have to install the software driver for this equipment after the first connection of the 1322x-SRB to the PC. The driver is on the CD in directory Drivers \LuminaryFTDI or alternatively on the FTDI web page • Push the button SW1 on the coordinator – it is looks up all ZigBee equipment connected to the ZigBee network at this time. Two red LEDs on the coordinator are then lit (see Figure 5-4) • Start the ZeD monitor and then click on the OK button. Before running the ZeD GUI, the ZigBee coordinator must be connected to the PC through a USB cable. • At this moment there are several icons of all the devices connected to the ZigBee network, and only power meter plus the coordinator (see Figure 5-5) in this case. If there is no icon for the power meter, you must reset the power meter using the reset button and reset the ZeD GUI using the F5 key. You may also repeat the installation from point 2 in this case MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 61 Setting-up the software demo • In the ZeD GUI menu you may open a new window for showing the ZigBee data transfer. This is in Tools/Start SE Utility Control Panel menu. You must address the meter by clicking the Add New Household ESP Connection, and then click on the Connect icon (see Figure 5-6) • For showing data (only kWh) you must click on the Metering icon and a kWh data table is now refreshed (every 5 seconds). The most important is the meter report column, where active energy from the power meter is displayed (see Figure 5-7). These numbers are in HEX format to 0.0001 kWh resolution, but the kWh-number on the LCD of the power meter is to 0.001kWh resolution. It is ten times lower then the numbers in the ZeD GUI. The reason for this is as follows: there are not many LCD digits for the kWh data displaying in the power meter LCD module. Figure 5-5. ZeD GUI Figure 5-6. Add new household ESP connection dialog box MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 62 Freescale Semiconductor, Inc. Chapter 5 Application Set-Up Figure 5-7. Metering report in ZeD GUI 5.2.3 Code reprogramming via serial bootloader There is a developer’s serial bootloader in the power meter that allows in-circuit reprogramming of the Power Meter MCU using the standard SCI port. A detailed description of this bootloader is out of content of this design reference manual. It is described in the application note titled Developer’s Serial Bootloader for M68HC08 and HCS08 MCUs (document AN2295). Firstly, you must connect an RS232 cable between the power meter and the PC. Then you must double-click on file BootLoaderControl.exe in the directory BootLoader. This program is a GUI for bootloader (see Figure 5-8). In this program you must first select the correct communication port of the PC, where the RS232 cable is connected. Then you must open the *.s19 file of the actual code which you want to flash to the MCU of the power meter. Originally, this file is accessible in the Bin directory of the EM256kWh project. Finally, you must click on the Bootload icon in the GUI. Then turn the power meter on (soft or hard reset) and if all the connections are OK, the PC begins to communicate with the MCU in the power meter. This takes approximately 1 minute. After flashing, the Reset push-button must be clicked, the MCU program then automatically runs with a new code. MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 63 Setting-up the software demo Figure 5-8. Serial bootloader GUI MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 64 Freescale Semiconductor, Inc. Appendix A Schematics MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 65 A B C GND A GND L_IN R5 330 LED_kWh SJ1 1 5 WP7104LSRD 100PF 0.1UF GNDA C6 C5 +3.3VA 1 4 2 GND 10K R18 TAMPER +3.3V 32.768KHz Y1 3 P12S1LZ TAMPER1 GNDA 4 6 10K R15 CT_I2SHUNT_LO SHUNT_HI V_OUT 2 2 GND WP7104LSRD D5 2 1 2 PAD JUMPER 0.1UF C16 1uH 4 2 +3.3V 1 C4 100PF L2 1 LCD25 LCD26 PTD0/LCD27/KBI2P0 PTD1/LCD28/KBI2P1 PTD2/LCD29/KBI2P2 PTD3/LCD30/KBI2P3 PTD4/LCD31/KBI2P4/TMRCLK1 PTD5/LCD32/KBI2P5/TMRCLK2 PTD6/LCD33/KBI2P6 PTD7/LCD34/KBI2P7 LCD35/CLKOUT PTF0/LCD36 PTF1/LCD37/EXTRIG PTF2/LCD38/RX3 PTF3/LCD39/TX3 PTF4/LCD40/AD16 PTF5/LCD41/AD17 PTF6/LCD42/AD18 PTF7/LCD43/AD19 VDDA VREFH DADP0 DADM0 AD4 DADP1 U1 DC_BIAS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0.1UF C18 0.1UF C15 0.1UF GND C1 0.1UF C14 GND C3 47UF 1uH 5 D15 BATTERY 1 3V Battery GND BT1 SHUNT_LO SHUNT_HI CT_I2+ CT_I2- LCD25 LCD26 LCD27 LCD28 LCD29 LCD30 LCD31 LCD32 LCD33 LCD34 LCD35 LCD36 LCD37 LCD38 LCD39 LCD40 LCD41 LCD42 LCD43 +3.3VA VREFH CT_I1+ CT_I1- GND + L1 1 2 Optical Interface R59 330 RS1 20S0271 2 V_OUT DC_BIAS ANALOG SENSING N_IN CT_I2+ CT_I2- SHUNT_LO SHUNT_HI LINE_OUT LINE_IN +3.3VA CT_I1+ CT_I1- +3.3VA GNDA PAGE01 GND N_IN 2 1 1 2 B TP3 TP2 R2 330 WP7104LGD D2 GND CON_2_TB A Q1 J2 MMBTA42 1 2 GNDA +3.3VA GND 5.1V D1 MMSZ5231BT1G User Interface LED_kVarh J9 A B CON_2_TB J6 B CON_2_TB GND R3 1 220 +3.3V TP4 TP1 WP7104LYD D4 220 R4 LED_USR +3.3V 1 D GND External isolated +3.3V, 200mA switched mode power supply CON_2_TB 2 VDDA 2 3 2 1 2 1 2 1 GNDA B V_OUT +3.3V 47UF + C7 D3 MMSZ5231BT1G 5.1V U2 SO 7 2 3 +3.3V 9 GND SPI1_SCK SPI1_MOSI RF_ATTN RF_RESET SPI1_MISO EXP HOLD MRAM WP VSS CS 8 VDD SCK SI MR25H10CDC 4 +3.3V 3 1 6 5 GND V_OUT 1UF MCF51EM256 PTE7/LCD5 PTC7/LCD4 PTC6/LCD3/CMP2P5 PTC5/LCD2/CMP1P5 PTC4/LCD1/CMP2O PTC3/LCD0/CMP1O BKGD/MS/PTC2 PTC1/KBI1P7/XTAL2/TX3 PTC0/KBI1P6/EXTAL2/RX3 RESET PTB7/RGPIO15/KBI1P5/TMRCLK2/AD15 PTB6/RGPIO14/KBI1P4/TMRCLK1/AD14 PTE6/SSB3/TX2 PTE5/SCLK3 PTE4/MISO3/MOSI3 PTE3/MOSI3/MISO3 PTB5/RGPIO13/SDA/CMP2P4 PTB4/RGPIO12/SCL/CMP2P3 PTB3/RGPIO11/KBI1P3/CMP2P2/TX1 PTB2/RGPIO10/KBI1P2/CMP2P1/RX1 VSS VDD PTB1/RGPIO9/KBI1P1/SSB3/TX2 PTB0/RGPIO8/KBI1P0/CMP1P1/RX2 PTE2/CMP1P2 C49 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 0.1UF C22 +3.3V 10K R11 LCD12 LCD13 LCD14 LCD15 LCD16 LCD17 LCD18 LCD19 LCD20 LCD21 LCD22 LCD23 LCD24 LCD25 LCD26 LCD27 LCD43 LCD42 LCD41 LCD40 LCD39 LCD38 IR_TX CON_2X20 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 SPI1_MOSI RF_CE 2 +3.3V 330 R14 TP9 +3.3V R6 330 4 1 2 GND TP6 3 R9 1.0K 1 2 2 ISO3 SFH6106-4 SFH6106-4 1 GND GND GNDA GNDA C45 ISO2 4 3 U6 1 2 3 4 5 2 D7 D6 RXD TXD DTR GND 1 3 5 7 9 2 4 6 8 10 CON_2X5 J5 RS232 Interface A J7 B CON_2_TB 1 Energy output pulse interface EOC_OE 1 EOC_OC 2 RS232 isolated (Half Duplex, max 19200 Bd) D8 R13 470 2.2UF C19 R7 4.7K (+12V) RTS GND C47 0.1UF C46 10UF GNDA Isolation barrier MMA7660FC NC2 RESERVED DVDD NC1 DVSS AVDD SDA AVSS SCL INT MMSD4148T1G 1 1 2 4 3 GND 10 9 8 7 6 Accelerometer Interface 10UF 0.1UF C44 GNDA C12 0.1UF VREFO C11 0.1UF VREFH C48 10UF +3.3VA C10 0.1UF +3.3VA C9 10UF +3.3V Place as close as possible to U1! C8 0.1UF +3.3V All caps in 0805 package Filters for MCU R61 1.0K R60 1.0K 3 SFH6106-4 V_BAT BAT54CLT1 ISO1 GND 6 4 2 +3.3V HDR 2X3 TSAL4400 D9 R8 680.0 GND RF_RTXEN IRQ +3.3V GND 1 D16 4 P12S1LZ 5 3 6 2 J4 TP7 TP5 SCL 5 /INT SDA 3 1 GND 100PF P12S1LZ SW2 3 1 4 2 100PF GND 5 1 6 4 3 P12S1LZ SW1 5 6 +3.3V 2 1 R1 4.7K RESET1 3 Buttons C13 GND SDA SCL RS232_TXD RS232_RXD EOC_PULSE OP506B Q3 +3.3V RF/ZigBee Interface GND J8 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 RF_CE RF_RTXEN IRQ 0.1UF C21 IR_RX +3.3V R58 10K GND RESET +3.3V R10 22K R12 1.0K 6 4 2 HDR 2X3 GND 5 3 1 J3 2 0.1UF C2 SW2 C17 SW1 RESET Infrared interface TP8 RF_RESET GND 100PF C20 IR_TX IR_RX 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 BDM Interface GD-3980P FP8 FP9 FP10 FP11 FP12 FP13 FP14 FP15 FP16 FP17 FP18 FP19 FP20 FP21 FP22 FP23 FP39 FP38 FP37 FP36 FP35 FP34 LCD5 LCD4 LCD3 LCD2 LCD1 LCD0 BKGD LED_USR /INT RESET SW1 SW2 VCCPRESENT LED_kVarh LED_kWh EOC_PULSE SDA SCL RS232_TXD RS232_RXD GND +3.3V BP0 BP1 BP2 BP3 FP0 FP1 FP2 FP3 FP4 FP5 FP6 FP7 FP24 FP25 FP26 FP27 FP28 FP29 FP30 FP31 FP32 FP33 LCD1 GND 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 Display LCD0 LCD1 LCD2 LCD3 LCD4 LCD5 LCD6 LCD7 LCD8 LCD9 LCD10 LCD11 LCD28 LCD29 LCD30 LCD31 LCD32 LCD33 LCD34 LCD35 LCD36 LCD37 V_OUT A DC_BIAS 1 2 1 5 2 DADM1 AD5 DADP2 DADM2 AD6 DADP3 DADM3 AD7 VREFO VREFL VSSA EXTAL1 XTAL1 VBAT TAMPER PTA0/RGPIO0/IRQ/CLKOUT PTE0/CMP1O/AD8 PTE1/CMP1P4/AD9 PTA1/RGPIO1/MOSI1 PTA2/RGPIO2/MISO1/AD10 VREFO 1 2 2 1 LCD24 LCD23 LCD22 LCD21 LCD20 LCD19 LCD18 LCD17 LCD16 LCD15 LCD14 LCD13 LCD12 LCD11 LCD10 LCD9 LCD8 LCD7 LCD6 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 MMSD4148T1G 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 EXTAL1 XTAL1 VBAT TAMPER IRQ RF_RESET RF_ATTN SPI1_MOSI SPI1_MISO 2 1 VCAP1 VCAP2 VLL1 VLL2 VLL3 VSS LCD24 LCD23 LCD22 LCD21 LCD20 LCD19 LCD18 LCD17 LCD16 LCD15 LCD14 LCD13 LCD12 LCD11 LCD10 LCD9/SSB2 LCD8/SCLK2 LCD7/MISO2 LCD6/MOSI2 PTA3/RGPIO3/SCLK1 PTA4/RGPIO4/SSB1 PTA5/RGPIO5/TPMCH0/AD11 PTA6/RGPIO6/TPMCH1/AD12 PTA7/RGPIO7/TPMCLK/CMP1P3/AD13 46 47 48 49 50 SPI1_SCK SPI1_SS RF_RTXEN RF_CE MMSD4148T1G 66 + J1 A B C D Schematics for Full Configuration of the Metering Board A.1 Schematics for Full Configuration of the Metering Board Figure A-1. Full digital configuration of the metering board schematic MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. A B C D R32 220K 2 3 GNDA - R33 100k MC33502DG 1 U7A + 8 4 A B 5 CT_IN- 1 TP19 CT_IN+ 2 CT= 1:2500 RC= 0.8mV/A J11 CON_2_TB TP14 R45 R40 39 39 1.8K R42 10K R51 10K R41 R35 47 10 PF C42 R46 12k 10 PF C32 1k R36 GNDA VLINE R30 4.7K VDDA DC_BIAS G1 = (1+2*R38/R46) G1 = 17.7 R54 = R46 1.8K R48 R29 100k DC_BIAS 0.6V R34 47k TP11 DC_BIAS 0.6V CURRENT SENSING USING CURRENT TRANSFORMER OR ROGOWSKI COIL Voltage measurement N_IN C25 1UF GNDA R57 220K GNDA R56 390 VDDA 5 6 2 3 - + U4A U4B 1 VDDA R54 100k 4 47 R49 Gtotal=312 3 PAD JUMPER J13 MC33502DG 7 GNDA 47 R44 J10 3 PAD JUMPER MC33502DG R38 100k GNDA V_OUT 1.2V +/-0.6V C30 1000pF LPF CUTOFF 3.4MHz V_OUT TP13 2 2 R21 1.8K 4 3 3 5 8 + - 4 1 1 LINE_OUT 10K R39 CT_I1- CT_I1+ TP18 R47 12k - U5B 3 2 1 VDDA MC33502DG U3A GNDA 10 PF R22 47k C23 10 PF R55 100k MC33502DG 7 GNDA MC33502DG 1 VDDA 3 C24 1000pF 10UF C28 R31 100k 4.7K R26 TP17 TP15 CT_I2- 1.2V -0.6V C33 1000pF CT_I2+ 1.2V +0.6V U3B R23 100k GNDA 47 R27 GNDA VDDA 100PF GNDA BAV99LT1 2 BAV99LT1 D14 1 2 BAV99LT1 D13 1 2 D12 1 BAV99LT1 2 D11 1 BAV99LT1 2 GNDA 0.1UF C40 VDDA 100PF C41 GNDA 0.1UF C50 VDDA Input protection VDDA GNDA VDDA GNDA LINE_IN LINE_OUT LINE_OUT LINE_IN VDDA D10 1 1 CT_IN- CT_IN+ VLINE 100PF C51 3 3 3 3 3 2 1 Note: C24,C29,C30,C33,C35 are low-pass filter capacitors. Place it as close as possible to ADC (U1) ! GNDA 0.1UF C38 VDDA Bypass capacitors 100PF 0.1UF GNDA C37 C36 VDDA C39 1.2V +/-0.6V SHUNT_HI LPF CUTOFF 3.4MHz GNDA 1000pF C29 TP12 Supply connection MC33502DG 7 VDDA SHUNT_LO 1.2V +/-0.6V 2 G2=R23/R26 G2=21.3 5 6 10 PF C27 SHUNT_LO LPF CUTOFF frequency f3dB = 1/(2PI*(R43+R52)*C33) f3dB = 1.7MHz 47 R52 47 R43 TP10 GNDA LPF CUTOFF 3.4MHz 47 R20 Gtotal=556 G1=R22/R24=R28/R25 G1=26.1 47k R28 R37 100k + U5A C43 5 6 2 3 10 PF C31 R24 1.8K R25 1.8K G2 = (1+2*R37/R47) G2 = 17.7 R55 = R47 10K R53 1.2V -0.6V C35 1000pF DC_BIAS 0.6V LINE_IN Shunt 150uOhm 1.2V +0.6V TP16 3 CURRENT SENSING USING SHUNT 8 + - 4 4 + - 8 + Freescale Semiconductor, Inc. - DC bias voltage 0.6 V A B C D Appendix A Schematics Figure A-2. Full analog schematic of the metering board MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 67 A B C D GND A 5 WP7104LSRD GNDA 0.1UF C5 +3.3VA Y1 1 4 2 GND 10K R18 TAMPER +3.3V 32.768KHz 3 P12S1LZ 1 4 +3.3V TAMPER1 10K R15 GNDA WP7104LSRD D5 2 1 6 V_OUT CT_I2SHUNT_LO SHUNT_HI DC_BIAS 2 2 GND 2 Optical Interface R5 330 LED_kWh C16 0.1UF 1uH LCD25 LCD26 PTD0/LCD27/KBI2P0 PTD1/LCD28/KBI2P1 PTD2/LCD29/KBI2P2 PTD3/LCD30/KBI2P3 PTD4/LCD31/KBI2P4/TMRCLK1 PTD5/LCD32/KBI2P5/TMRCLK2 PTD6/LCD33/KBI2P6 PTD7/LCD34/KBI2P7 LCD35/CLKOUT PTF0/LCD36 PTF1/LCD37/EXTRIG PTF2/LCD38/RX3 PTF3/LCD39/TX3 PTF4/LCD40/AD16 PTF5/LCD41/AD17 PTF6/LCD42/AD18 PTF7/LCD43/AD19 VDDA VREFH DADP0 DADM0 AD4 DADP1 U1 1 C4 100PF L2 1 4 5 D15 BATTERY 1 3V Battery GND BT1 SHUNT_LO SHUNT_HI CT_I2+ CT_I2- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 C18 0.1UF C15 0.1UF 0.1UF GND C1 0.1UF C14 GND C3 47UF 1uH 1 2 RS1 20S0271 2 V_OUT DC_BIAS ANALOG SENSING N_IN CT_I2+ CT_I2- SHUNT_LO SHUNT_HI LINE_OUT LINE_IN CT_I1+ CT_I1- + GND LCD25 LCD26 LCD27 LCD28 LCD29 LCD30 LCD31 LCD32 LCD33 LCD34 LCD35 LCD36 LCD37 LCD38 LCD39 LCD40 LCD41 LCD42 LCD43 +3.3VA VREFH CT_I1+ CT_I1- TP3 TP2 R2 330 WP7104LGD D2 GND +3.3VA GNDA +3.3VA GND 5.1V D1 MMSZ5231BT1G +3.3VA GNDA PAGE01 TP4 TP1 GND L_IN 1 R59 330 A N_IN 2 1 LED_kVarh J9 B CON_2_TB J6 B 2 GND CON_2_TB +3.3V External isolated +3.3V, 200mA switched mode power supply CON_2_TB VDDA 2 GNDA 1 2 1 V_OUT L1 VREFO B DC_BIAS +3.3V 100PF C6 47UF + C7 D3 MMSZ5231BT1G 5.1V GND MCF51EM256 V_OUT 1UF PTE7/LCD5 PTC7/LCD4 PTC6/LCD3/CMP2P5 PTC5/LCD2/CMP1P5 PTC4/LCD1/CMP2O PTC3/LCD0/CMP1O BKGD/MS/PTC2 PTC1/KBI1P7/XTAL2/TX3 PTC0/KBI1P6/EXTAL2/RX3 RESET PTB7/RGPIO15/KBI1P5/TMRCLK2/AD15 PTB6/RGPIO14/KBI1P4/TMRCLK1/AD14 PTE6/SSB3/TX2 PTE5/SCLK3 PTE4/MISO3/MOSI3 PTE3/MOSI3/MISO3 PTB5/RGPIO13/SDA/CMP2P4 PTB4/RGPIO12/SCL/CMP2P3 PTB3/RGPIO11/KBI1P3/CMP2P2/TX1 PTB2/RGPIO10/KBI1P2/CMP2P1/RX1 VSS VDD PTB1/RGPIO9/KBI1P1/SSB3/TX2 PTB0/RGPIO8/KBI1P0/CMP1P1/RX2 PTE2/CMP1P2 C49 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 3 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 Display LCD0 LCD1 LCD2 LCD3 LCD4 LCD5 LCD6 LCD7 LCD8 LCD9 LCD10 LCD11 LCD28 LCD29 LCD30 LCD31 LCD32 LCD33 LCD34 LCD35 LCD36 LCD37 10K GND 100PF C20 RS232_TXD RS232_RXD GND +3.3V RESET SW1 SW2 VCCPRESENT LED_kVarh LED_kWh R11 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 LCD12 LCD13 LCD14 LCD15 LCD16 LCD17 LCD18 LCD19 LCD20 LCD21 LCD22 LCD23 LCD24 LCD25 LCD26 LCD27 LCD43 LCD42 LCD41 LCD40 LCD39 LCD38 5 3 1 6 4 2 R58 10K HDR 2X3 J3 BDM Interface GD-3980P FP8 FP9 FP10 FP11 FP12 FP13 FP14 FP15 FP16 FP17 FP18 FP19 FP20 FP21 FP22 FP23 FP39 FP38 FP37 FP36 FP35 FP34 LCD5 LCD4 LCD3 LCD2 LCD1 LCD0 BKGD LED_USR BP0 BP1 BP2 BP3 FP0 FP1 FP2 FP3 FP4 FP5 FP6 FP7 FP24 FP25 FP26 FP27 FP28 FP29 FP30 FP31 FP32 FP33 LCD1 V_OUT 5 EXTAL1 XTAL1 VBAT TAMPER +3.3V GND RESET +3.3V C2 RS232_TXD RS232_RXD 2 TP5 GND 100PF ISO1 +3.3V 4 GND TP6 3 R9 1.0K 1 2 SFH6106-4 SFH6106-4 4 R6 330 5 3 6 2 P12S1LZ P12S1LZ SW2 3 1 4 2 100PF GND 5 1 6 4 3 P12S1LZ SW1 5 6 +3.3V 2 1 R1 4.7K RESET1 3 Buttons C13 GND 0.1UF SW2 C17 SW1 RESET 2 1 GND GND ISO2 GNDA GNDA 2 D7 D6 RXD TXD DTR GND 1 3 5 7 9 2 4 6 8 10 CON_2X5 J5 RS232 Interface RTS 1 RS232 isolated (Half Duplex, max 19200 Bd) D8 R13 470 2.2UF C19 R7 4.7K (+12V) MMSD4148T1G 1 1 2 4 3 GNDA Isolation barrier GNDA C12 0.1UF VREFO C11 0.1UF VREFH C48 10UF +3.3VA C10 0.1UF +3.3VA C9 10UF +3.3V Place as close as possible to U1! C8 0.1UF +3.3V All caps in 0805 package Filters for MCU 2 1 A 1 2 DADM1 AD5 DADP2 DADM2 AD6 DADP3 DADM3 AD7 VREFO VREFL VSSA EXTAL1 XTAL1 VBAT TAMPER PTA0/RGPIO0/IRQ/CLKOUT PTE0/CMP1O/AD8 PTE1/CMP1P4/AD9 PTA1/RGPIO1/MOSI1 PTA2/RGPIO2/MISO1/AD10 2 1 LCD24 LCD23 LCD22 LCD21 LCD20 LCD19 LCD18 LCD17 LCD16 LCD15 LCD14 LCD13 LCD12 LCD11 LCD10 LCD9 LCD8 LCD7 LCD6 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 MMSD4148T1G 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 VCAP1 VCAP2 VLL1 VLL2 VLL3 VSS LCD24 LCD23 LCD22 LCD21 LCD20 LCD19 LCD18 LCD17 LCD16 LCD15 LCD14 LCD13 LCD12 LCD11 LCD10 LCD9/SSB2 LCD8/SCLK2 LCD7/MISO2 LCD6/MOSI2 PTA3/RGPIO3/SCLK1 PTA4/RGPIO4/SSB1 PTA5/RGPIO5/TPMCH0/AD11 PTA6/RGPIO6/TPMCH1/AD12 PTA7/RGPIO7/TPMCLK/CMP1P3/AD13 46 47 48 49 50 MMSD4148T1G 68 + J1 A B C D Schematics for Low-Cost Configurations of the Metering Board A.2 Schematics for Low-Cost Configurations of the Metering Board Figure A-3. Low-cost configuration of the digital schematic of the metering board MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. A B C 1UF C25 GNDA 2 3 2 LINE_IN 5 1 3 3 3 VLINE MC33502DG Input protection BAV99LT1 D12 1 BAV99LT1 2 D11 1 - + U7A GNDA BAV99LT1 2 D10 1 VDDA LINE_OUT LINE_OUT LINE_IN VDDA GNDA GNDA R56 390 R21 1.8K 4 D 8 DC bias voltage 0.6 V TP11 GNDA VDDA 100PF 0.1UF 4 GNDA 0.1UF C50 VDDA 100PF C51 DC_BIAS 0.6V LINE_IN Shunt 150uOhm LINE_OUT Bypass capacitors C41 GNDA 3 R24 1.8K R25 1.8K VDDA MC33502DG 1 GNDA R57 220K R32 220K 3 Voltage measurement N_IN U3A TP10 10UF C28 R31 100k 4.7K R26 R33 100k 2 R34 47k SHUNT_LO U3B R23 100k R29 100k 1k R36 GNDA VLINE R30 4.7K VDDA R35 47 MC33502DG 7 1.2V +/-0.6V G2=R23/R26 G2=21.3 5 6 10 PF C27 SHUNT_LO C24 1000pF 2 GNDA LPF CUTOFF 3.4MHz 47 R20 Gtotal=556 G1=R22/R24=R28/R25 G1=26.1 47k R28 3 2 C23 10 PF R22 47k CURRENT SENSING USING SHUNT C40 VDDA Supply connection GNDA VDDA DC_BIAS 0.6V DC_BIAS 4 4 + 8 + - Freescale Semiconductor, Inc. - 5 GNDA 1000pF C29 TP12 SHUNT_HI 1.2V +/-0.6V GNDA 1.2V +/-0.6V 1 C30 1000pF LPF CUTOFF 3.4MHz V_OUT V_OUT LPF CUTOFF 3.4MHz TP13 47 R27 1 A B C D Appendix A Schematics Figure A-4. Low-cost analog schematic of the metering board with shunt resistor configuration MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 69 A B R32 220K R33 100k R34 47k 4 R29 100k J11 CT_IN- 1 5 TP19 CT_IN+ 2 CT= 1:2500 A B CON_2_TB TP14 R45 R40 39 39 1.8K R48 DC_BIAS 0.6V 1.8K R42 4 3 PAD JUMPER J13 47 R49 47 R44 J10 3 PAD JUMPER TP18 GNDA 3 V_OUT 1.2V +/-0.6V 3 C30 1000pF LPF CUTOFF 3.4MHz V_OUT TP13 LPF CUTOFF 1.7MHz CT_I1- 1.2V -0.6V C35 1000pF R35 47 CT_I1+ 1.2V +0.6V TP16 GNDA 1k R36 R30 4.7K VDDA VLINE Current sensing using Current Transformer Voltage measurement R57 220K 1 1 C N_IN 2 2 D 3 3 GNDA VDDA 100PF C51 2 Bypass capacitors GNDA 0.1UF C50 VDDA Supply connection GNDA VDDA 1UF C25 GNDA VDDA GNDA R56 390 R21 1.8K 2 3 1 MC33502DG BAV99LT1 2 BAV99LT1 D14 1 2 D13 1 1 1 3 3 3 DC_BIAS 0.6V BAV99LT1 2 D10 1 TP11 Input protection VDDA GNDA VDDA GNDA VDDA GNDA GNDA - + U7A DC bias voltage 0.6 V 2 8 70 4 5 CT_IN- CT_IN+ VLINE DC_BIAS A B C D Schematics for Low-Cost Configurations of the Metering Board Figure A-5. Low-cost analog schematic of the metering board with low-cost CT configuration MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. A B C D R57 220K R32 220K R33 100k R34 47k A 1 2 CT= 1:2500 J11 B CON_2_TB 5 TP19 CT_IN- CT_IN+ TP14 10K R51 10K 10 PF C42 R46 12k 5 6 2 3 - + U4A U4B 4 R54 100k 47 R49 Gtotal=312 3 PAD JUMPER J13 MC33502DG 7 GNDA 47 R44 J10 3 PAD JUMPER GNDA 1.2V +/-0.6V V_OUT 10K CT_I1- CT_I1+ 10K R53 3 R56 390 R47 12k - U5B 1 VDDA VDDA 2 3 10 PF R55 100k 1 47 R52 47 R43 GNDA TP17 DC_BIAS 0.6V CT_I2- 1.2V -0.6V C33 1000pF CT_I2+ 1.2V +0.6V TP11 TP15 MC33502DG - + U7A 2 DC_BIAS 2 LPF CUTOFF frequency f3dB = 1/(2PI*(R43+R52)*C33) f3dB = 1.7MHz MC33502DG 7 GNDA MC33502DG R37 100k + U5A C43 5 6 2 3 10 PF C31 1UF C25 GNDA R21 1.8K GNDA G2 = (1+2*R37/R47) G2 = 17.7 R55 = R47 TP18 1.2V -0.6V C35 1000pF 3 DC bias voltage 0.6 V R39 1.2V +0.6V TP16 C30 1000pF LPF CUTOFF 3.4MHz V_OUT TP13 MC33502DG 1 VDDA R35 47 R38 100k G1 = (1+2*R38/R46) G1 = 17.7 R54 = R46 1.8K R48 R45 R40 DC_BIAS 39 39 0.6V 1.8K R42 R41 10 PF C32 1k R36 R30 4.7K GNDA VLINE CURRENT SENSING USING CURRENTTRANSFORMER Voltage measurement N_IN R29 100k 4 2 2 8 4 VDDA 3 3 5 8 + - 4 1 1 8 4 + Freescale Semiconductor, Inc. - Figure A-6. Low-cost analog schematic of the metering board with full CT configuration MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 71 100PF C37 GNDA 0.1UF C38 VDDA Bypass capacitors GNDA 0.1UF C36 VDDA BAV99LT1 2 BAV99LT1 D14 1 2 D13 1 BAV99LT1 2 D10 1 Input protection VDDA GNDA VDDA GNDA VDDA GNDA GNDA 1 3 3 3 1 100PF C39 CT_IN- CT_IN+ VLINE Supply connection GNDA VDDA VDDA GNDA 0.1UF C50 VDDA 100PF C51 A B C D MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 72 Freescale Semiconductor, Inc. Appendix B Layouts B.1 Layouts for full configuration Figure B-1. Top side of the PCB MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 73 Layouts for full configuration Figure B-2. Bottom side of the PCB MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 74 Freescale Semiconductor, Inc. Appendix B Layouts B.2 Layouts for Low-Cost Configuration with CT Figure B-3. Top Side of the PCB with CT Low-Cost Configuration MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 75 Layouts for Low-Cost Configuration with CT Figure B-4. Bottom Side of the PCB with CT Low-Cost Configuration MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 76 Freescale Semiconductor, Inc. Appendix B Layouts B.3 Layouts for Low-Cost Configuration with Shunt Resistor Figure B-5. Top side of the PCB with shunt resistor configuration MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 77 Figure B-6. Bottom side of the PCB with shunt resistor configuration MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 78 Freescale Semiconductor, Inc. Appendix C BOM C.1 Bill of Materials for Full Configuration Table C-1. BOM report for full configuration Part Reference Quantity Description Manufacturer Part Number BT1 1 Battery holder CR2032 3V ROHS COMPLIANT Renata Batteries SMTU2032-LF C1,C2,C5,C8,C10,C11, C12,C14,C15,C16,C18 ,C21,C22,C36,C38,C4 0,C45,C47,C50 19 CAP CER 0.1UF 25V 10% X7R 0805 SMEC MCCC104K2NRTF C3,C7 2 CAP ALEL 47UF 6.3V 20% -- CASE C SMT PANASONIC EEE0JA470SR C4,C6,C13,C17,C20,C 37,C39,C41,C51 9 CAP CER 100PF 50V 10% C0G 0805 AVX 08055A101KAT2A C9,C28,C44,C46,C48 5 CAP CER 10UF 16V 10% X5R 0805 AVX 0805YD106KAT2A C19 1 CAP TANT 2.2UF 16V 10% -- 3216-18 KEMET T491A225K016AT C23,C27,C31,C32,C42 ,C43 6 CAP CER 10PF 50V 5% C0G 0805 KEMET C0805C100J5GAC C24,C29,C30,C33,C35 5 CAP CER 1000PF 50V 10% X7R 0805 AVX 08055C102KAT2A C25,C49 2 CAP CER 1UF 25V 10% X5R 0805 Panasonic ECJ2FB1E105K D1,D3 2 DIODE ZNR 5.1V 0.5W SOD123 ON SEMICONDUCTOR MMSZ5231BT1G D2 1 LED GRN SGL 2mA TH Kingbright WP7104LGD D4 1 LED YEL SGL 2mA TH Kingbright WP7104LYD D5,D15 2 LED RED SGL 2mA TH Kingbright WP7104LSRD Table continues on the next page... MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 79 Bill of Materials for Full Configuration Table C-1. BOM report for full configuration (continued) Part Reference Quantity Description Manufacturer Part Number D6,D7,D8 3 DIODE SW 100V SOD-123 ON SEMICONDUCTOR MMSD4148T1G D9 1 LED IR SGL 100MA TH VISHAY INTERTECHNOLOGY TSAL4400 D10,D11,D12,D13,D14 5 DIODE DUAL SW 215MA 70V SOT23 ON SEMICONDUCTOR BAV99LT1G D16 1 DIODE SCH DUAL CC 200MA 30V SOT23 ON SEMICONDUCTOR BAT54CLT1G ISO1,ISO2,ISO3 3 IC OPTOCOUPLER 100MA 70V SMD VISHAY INTERTECHNOLOGY SFH6106-4 J1,J2,J6,J7,J9,J11 6 CON 1X2 TB TH 5MM SP 394H -- LUMBERG INC KRM 02 J3,J4 2 HDR 2X3 TH 100MIL CTR 335H AU 95L SAMTEC TSW-103-07-S-D J5 1 CON 2X5 PLUG SHRD TH 100MIL CTR 358H AU 118L ADAM TECHNOLOGIES BHR-10-VUA J8 1 CON 2X20 SKT TH 100MIL CTR 335H SN SAMTEC SSW-120-01-T-D J10,J13 2 JUMPER 3 PAD 40MIL SQUARE SMT - NO PART TO ORDER N/A N/A LCD1 1 LCD DISPLAY 3V 64HZ TH S-TEK INC GD-3980P L1,L2 2 IND CHIP 1UH@10MHZ 220MA 25% TDK MLZ2012A1R0PT Q1 1 TRAN NPN AMP 0.5A 300V SOT-23 FAIRCHILD MMBTA42 Q3 1 TRAN PHOTO NPN 250mA 30V TH OPTEK TECHNOLOGY INC OP506B TAMPER1,SW1,RESE T1,SW2 4 SW SPDT PB 0.1A 30V TH ZIPPY TECHNOLOGY CORP P12S1LZ RS1 1 RES VARISTOR 275VRMS 10% 4.5kA 151J TH epcos B72220S0271K101 R1,R7 2 RES MF 4.70K 1/8W 1% 0805 BOURNS CR0805-FX-4701ELF R2,R5,R6,R14,R59 5 RES MF 330 OHM 1/8W 5% 0805 VISHAY INTERTECHNOLOGY CRCW0805330RJNEA R3,R4 2 RES MF 220 OHM 1/8W 5% 0805 YAGEO AMERICA RC0805JR-07220RL R8 1 RES MF 680 OHM 1/8W 1% 0805 YAGEO AMERICA RC0805FR-07680RL Table continues on the next page... MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 80 Freescale Semiconductor, Inc. Appendix C BOM Table C-1. BOM report for full configuration (continued) Part Reference Quantity Description Manufacturer Part Number R9,R12,R60,R61 4 RES MF 1.00K 1/8W 1% 0805 KOA SPEER RK73H2ATTD1001F R10 1 RES MF 22K 1/8W 5% 0805 BOURNS CR0805-JW-223ELF R11,R15,R18,R39,R41 ,R51,R53,R58 8 RES MF 10K 1/8W 5% 0805 VENKEL COMPANY CR0805-8W-103JT R13 1 RES MF 470.0 1/8W 5% 0805 BOURNS CR0805-JW-471ELF R20,R27,R35,R43,R44 ,R49,R52 7 RES MF 47 OHM 1/8W 5% 0805 Rohm MCR10EZPJ470 R21,R24,R25,R42,R48 5 RES MF 1.8K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-1K8BI R22,R28,R34 3 RES MF 47K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-47KBI R23,R29,R31,R33,R37 ,R38,R54,R55 8 RES MF 100K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-100KBI R26,R30 2 RES MF 4.7K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-4K7BI R32,R57 2 RES MF 220K 1/4W 1% 50ppm MELF0204 WELWYN COMPONENTS LIMITED WRM0204C-220KFI R36 1 RES MF 1K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-1KBI R40,R45 2 RES MF 39 OHM 200V 1% 50PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204C-39RFI R46,R47 2 RES MF 12K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-12KBI R56 1 RES MF 390 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-390RBI SJ1 1 JUMPER 2 PAD 40 MIL SQUARE SMT;NO PART TO ORDER N/A N/A TP1,TP2,TP3,TP4,TP5 ,TP6,TP7,TP8,TP9,TP 10,TP11,TP12,TP13,T P14,TP15,TP16,TP17, TP18,TP19 19 TEST POINT TH PAD 60 DRILL 35 DIAM, NO PART TO ORDER NA NO PART TO ORDER Table continues on the next page... MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 81 Bill of Materials — Others Components Table C-1. BOM report for full configuration (continued) Part Reference Quantity Description Manufacturer Part Number U1 1 IC MCU 32 BIT ColdFire VI 256K FLASH 16K RAM 2.5-3.6V/1.8-2.5V LQFP100 FREESCALE SEMICONDUCTOR MCF51EM256CLL U2 1 IC MEM MRAM 1Mb SPI 2.7-3.6V DFN8 EVERSPIN TECHNOLOGIES, INC MR25H10CDC U3,U4,U5,U7 4 IC LIN OPAMP DUAL RAIL-TO-RAIL 1.0-7.0V SO8 ON SEMICONDUCTOR MC33502DG U6 1 IC SENSOR ACCELEROMETER 2.4-3.6V DFN10 FREESCALE SEMICONDUCTOR MMA7660FC Y1 1 XTAL 32.768KHZ PAR 20PPM -- SMT Citizen CMR200T32.768KDZF -UT C.2 Bill of Materials — Others Components Table C-2. BOM report —other components (non included in schematics) QUANTITY DESCRIPTION MANUFACTURER PART NUMBER 1 Current Transformer Vacuumschmelze T60404-E4626-X131 1 Shunt 150 microOhm Zhongshan Weiqi Electronics Co WL150 1 Enclosure FIBOX PC 17/16-3 1 Open-frame AC/DC power supply XP Power ECL05US03-T 1 Receptacle Cannon 9-pin Tyco Electronics 1658609-4 2 Buttons termination - white ZIPPY TECHNOLOGY CORP - 1 Buttons termination - black ZIPPY TECHNOLOGY CORP - 1 Buttons termination - red ZIPPY TECHNOLOGY CORP - 1 Receptacle 10-pin, ribbon crimp Tyco Electronics 1658622-1 1 3V battery GP CR2032 20 cm Flat cable any acceptable - 2m Extension Cord 250V/16A any acceptable - 1 Outlet 250V/16A any acceptable - 1 Power connector SEZ HSV 35 MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 82 Freescale Semiconductor, Inc. Appendix C BOM C.3 Bill of Materials for Low-Cost (Basic) CT Configuration Table C-3. BOM report for low-cost (basic) CT configuration PART REFERENCE QUANTITY DESCRIPTION MANUFACTURER PART NUMBER BT1 1 BATTERY HOLDER CR2032 3V ROHS COMPLIANT RENATA BATTERIES SMTU2032-LF C1,C2,C5,C8,C10,C11, C12,C14,C15,C16,C18 ,C50 12 CAP CER 0.1UF 25V 10% X7R 0805 SMEC MCCC104K2NRTF C3,C7 2 CAP ALEL 47UF 6.3V 20% -- CASE C SMT PANASONIC EEE0JA470SR C4,C6,C13,C17,C20,C 51 6 CAP CER 100PF 50V 10% C0G 0805 AVX 08055A101KAT2A C9,C48 2 CAP CER 10UF 16V 10% X5R 0805 AVX 0805YD106KAT2A C19 1 CAP TANT 2.2UF 16V 10% -- 3216-18 KEMET T491A225K016AT C30,C35 2 CAP CER 1000PF 50V 10% X7R 0805 AVX 08055C102KAT2A C25,C49 2 CAP CER 1UF 25V 10% X5R 0805 Panasonic ECJ2FB1E105K D1,D3 2 DIODE ZNR 5.1V 0.5W SOD123 ON SEMICONDUCTOR MMSZ5231BT1G D2 1 LED GRN SGL 2mA TH Kingbright WP7104LGD D5,D15 2 LED RED SGL 2mA TH Kingbright WP7104LSRD D6,D7,D8 3 DIODE SW 100V SOD-123 ON SEMICONDUCTOR MMSD4148T1G D10,D13,D14 3 DIODE DUAL SW 215MA 70V SOT23 ON SEMICONDUCTOR BAV99LT1G ISO1,ISO2 2 IC OPTOCOUPLER 100MA 70V SMD VISHAY INTERTECHNOLOGY SFH6106-4 J1,J9,J11 3 CON 1X2 TB TH 5MM SP 394H -- LUMBERG INC KRM 02 J3 1 HDR 2X3 TH 100MIL CTR 335H AU 95L SAMTEC TSW-103-07-S-D J5 1 CON 2X5 PLUG SHRD TH 100MIL CTR 358H AU 118L ADAM TECHNOLOGIES BHR-10-VUA J10,J13 2 JUMPER 3 PAD 40MIL SQUARE SMT - NO PART TO ORDER N/A N/A Table continues on the next page... MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 83 Bill of Materials for Low-Cost (Basic) CT Configuration Table C-3. BOM report for low-cost (basic) CT configuration (continued) PART REFERENCE QUANTITY DESCRIPTION MANUFACTURER PART NUMBER LCD1 1 LCD DISPLAY 3V 64HZ TH S-TEK INC GD-3980P L1,L2 2 IND CHIP 1UH@10MHZ 220MA 25% TDK MLZ2012A1R0PT TAMPER1,SW1,RESE T1,SW2 4 SW SPDT PB 0.1A 30V TH ZIPPY TECHNOLOGY CORP P12S1LZ RS1 1 RES VARISTOR 275VRMS 10% 4.5kA 151J TH EPCOS B72220S0271K101 R1,R7 2 RES MF 4.70K 1/8W 1% 0805 BOURNS CR0805-FX-4701ELF R2,R5,R6,R59 4 RES MF 330 OHM 1/8W 5% 0805 VISHAY INTERTECHNOLOGY CRCW0805330RJNEA R9 1 RES MF 1.00K 1/8W 1% 0805 KOA SPEER RK73H2ATTD1001F R11,R15,R18,R58 4 RES MF 10K 1/8W 5% 0805 VENKEL COMPANY CR0805-8W-103JT R13 1 RES MF 470.0 1/8W 5% 0805 BOURNS CR0805-JW-471ELF R35,R44,R49 3 RES MF 47 OHM 1/8W 5% 0805 Rohm MCR10EZPJ470 R21,R42,R48 3 RES MF 1.8K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-1K8BI R34 1 RES MF 47K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-47KBI R29,R33 2 RES MF 100K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-100KBI R30 1 RES MF 4.7K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-4K7BI R32,R57 2 RES MF 220K 1/4W 1% 50ppm MELF0204 WELWYN COMPONENTS LIMITED WRM0204C-220KFI R36 1 RES MF 1K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-1KBI R40,R45 2 RES MF 39 OHM 200V 1% 50PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204C-39RFI Table continues on the next page... MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 84 Freescale Semiconductor, Inc. Appendix C BOM Table C-3. BOM report for low-cost (basic) CT configuration (continued) PART REFERENCE QUANTITY DESCRIPTION MANUFACTURER PART NUMBER R56 1 RES MF 390 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-390RBI U1 1 IC MCU 32 BIT ColdFire VI 256K FLASH 16K RAM 2.5-3.6V/1.8-2.5V LQFP100 FREESCALE SEMICONDUCTOR MCF51EM256CLL U7 1 IC LIN OPAMP DUAL RAIL-TO-RAIL 1.0-7.0V SO8 ON SEMICONDUCTOR MC33502DG Y1 1 XTAL 32.768KHZ PAR 20PPM -- SMT Citizen CMR200T32.768KDZF -UT C.4 Bill of Materials for Low-Cost Shunt Resistor Configuration Table C-4. BOM report for shunt resistor configuration PART REFERENCE QUANTITY DESCRIPTION MANUFACTURER PART NUMBER BT1 1 BATTERY HOLDER CR2032 3V ROHS COMPLIANT RENATA BATTERIES SMTU2032-LF C1,C2,C5,C8,C10,C11, C12,C14,C15,C16,C18 ,C21,C22,C40,C45,C4 7,C50 17 CAP CER 0.1UF 25V 10% X7R 0805 SMEC MCCC104K2NRTF C3,C7 2 CAP ALEL 47UF 6.3V 20% -- CASE C SMT PANASONIC EEE0JA470SR C4,C6,C13,C17,C20,C 41,C51 7 CAP CER 100PF 50V 10% C0G 0805 AVX 08055A101KAT2A C9,C28,C44,C46,C48 5 CAP CER 10UF 16V 10% X5R 0805 AVX 0805YD106KAT2A C19 1 CAP TANT 2.2UF 16V 10% -- 3216-18 KEMET T491A225K016AT C23,C27 2 CAP CER 10PF 50V 5% C0G 0805 KEMET C0805C100J5GAC C24,C29,C30 3 CAP CER 1000PF 50V 10% X7R 0805 AVX 08055C102KAT2A C25,C49 2 CAP CER 1UF 25V 10% X5R 0805 Panasonic ECJ2FB1E105K D1,D3 2 DIODE ZNR 5.1V 0.5W SOD123 ON SEMICONDUCTOR MMSZ5231BT1G Table continues on the next page... MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 85 Bill of Materials for Low-Cost Shunt Resistor Configuration Table C-4. BOM report for shunt resistor configuration (continued) PART REFERENCE QUANTITY DESCRIPTION MANUFACTURER PART NUMBER D2 1 LED GRN SGL 2mA TH Kingbright WP7104LGD D5,D15 2 LED RED SGL 2mA TH Kingbright WP7104LSRD D6,D7,D8 3 DIODE SW 100V SOD-123 ON SEMICONDUCTOR MMSD4148T1G D10,D11,D12 3 DIODE DUAL SW 215MA 70V SOT23 ON SEMICONDUCTOR BAV99LT1G ISO1,ISO2 2 IC OPTOCOUPLER 100MA 70V SMD VISHAY INTERTECHNOLOGY SFH6106-4 J1,J6,J9 3 CON 1X2 TB TH 5MM SP 394H -- LUMBERG INC KRM 02 J3 1 HDR 2X3 TH 100MIL CTR 335H AU 95L SAMTEC TSW-103-07-S-D J5 1 CON 2X5 PLUG SHRD TH 100MIL CTR 358H AU 118L ADAM TECHNOLOGIES BHR-10-VUA J10,J13 2 JUMPER 3 PAD 40MIL SQUARE SMT - NO PART TO ORDER N/A N/A LCD1 1 LCD DISPLAY 3V 64HZ TH S-TEK INC GD-3980P L1,L2 2 IND CHIP 1UH@10MHZ 220MA 25% TDK MLZ2012A1R0PT Q1 1 TRAN NPN AMP 0.5A 300V SOT-23 FAIRCHILD MMBTA42 Q3 1 TRAN PHOTO NPN 250mA 30V TH OPTEK TECHNOLOGY INC OP506B TAMPER1,SW1,RESE T1,SW2 4 SW SPDT PB 0.1A 30V TH ZIPPY TECHNOLOGY CORP P12S1LZ RS1 1 RES VARISTOR 275VRMS 10% 4.5kA 151J TH EPCOS B72220S0271K101 R1,R7 2 RES MF 4.70K 1/8W 1% 0805 BOURNS CR0805-FX-4701ELF R2,R5,R6,R59 4 RES MF 330 OHM 1/8W 5% 0805 VISHAY INTERTECHNOLOGY CRCW0805330RJNEA R8 1 RES MF 680 OHM 1/8W 1% 0805 YAGEO AMERICA RC0805FR-07680RL R9,R12 2 RES MF 1.00K 1/8W 1% 0805 KOA SPEER RK73H2ATTD1001F R10 1 RES MF 22K 1/8W 5% 0805 BOURNS CR0805-JW-223ELF Table continues on the next page... MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 86 Freescale Semiconductor, Inc. Table C-4. BOM report for shunt resistor configuration (continued) PART REFERENCE QUANTITY DESCRIPTION MANUFACTURER PART NUMBER R11,R15,R18,R58 4 RES MF 10K 1/8W 5% 0805 VENKEL COMPANY CR0805-8W-103JT R13 1 RES MF 470.0 1/8W 5% 0805 BOURNS CR0805-JW-471ELF R20,R27,R35 3 RES MF 47 OHM 1/8W 5% 0805 Rohm MCR10EZPJ470 R21,R24,R25 3 RES MF 1.8K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-1K8BI R22,R28,R34 3 RES MF 47K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-47KBI R23,R29,R31,R33 4 RES MF 100K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-100KBI R26,R30 2 RES MF 4.7K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-4K7BI R32,R57 2 RES MF 220K 1/4W 1% 50ppm MELF0204 WELWYN COMPONENTS LIMITED WRM0204C-220KFI R36 1 RES MF 1K 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-1KBI R56 1 RES MF 390 200V 0.1% 15PPM MELF0204 WELWYN COMPONENTS LIMITED WRM0204Y-390RBI U1 1 IC MCU 32 BIT ColdFire VI 256K FLASH 16K RAM 2.5-3.6V/1.8-2.5V LQFP100 FREESCALE SEMICONDUCTOR MCF51EM256CLL U3,U7 2 IC LIN OPAMP DUAL RAIL-TO-RAIL 1.0-7.0V SO8 ON SEMICONDUCTOR MC33502DG Y1 1 XTAL 32.768KHZ PAR 20PPM -- SMT Citizen CMR200T32.768KDZF -UT MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 87 MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 88 Freescale Semiconductor, Inc. Appendix D References D.1 References 1. http://cache.freescale.com/files/32bit/doc/ref_manual/MCF51EM256RM.pdf? fpsp=1&WT_TYPE=Reference Manuals&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET =Documentation 2. http://cache.freescale.com/files/sensors/doc/data_sheet/MMA7660FC.pdf?fpsp=1 3. http://cache.freescale.com/files/rf_if/doc/ref_manual/1322xLPNRM.pdf? fsrch=1&sr=1 4. http://cache.freescale.com/files/rf_if/doc/ref_manual/1322xSNRM.pdf? fsrch=1&sr=1 5. http://en.wikipedia.org/wiki/Electricity_meter. 6. http://en.wikipedia.org/wiki/File:WorldMap_Voltage%26Frequency.png 7. http://en.wikipedia.org/wiki/Power_factor 8. http://en.wikipedia.org/wiki/AC_power 9. http://en.wikipedia.org/wiki/Current_transformer 10. http://en.wikipedia.org/wiki/Rogowski_coil 11. http://www.powerstudies.com/articles/PowerFactorBasics.pdf 12. http://cache.freescale.com/files/microcontrollers/doc/app_note/AN2295.pdf? fsrch=1&sr=1 13. http://cache.freescale.com/files/rf_if/doc/user_guide/ZEDESDUG.pdf?fsrch=1&sr=1 14. AN4255: FFT-based Algorithm for Metering Application 15. Utility Meters/How To/Hacking in Energy Meters, Stephen Pickering 16. Utility Meters/How To/What Does an Electricity Meter Measure, Stephen Pickering MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 89 MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 90 Freescale Semiconductor, Inc. Appendix E E.1 Glossary Analog to Digital Converter — ADC Analog Front-End — AFE Automatic Meter Reading — AMR Bill of Materials — BOM Common-Mode Rejection Ratio — CMRR Current Transformer — CT Fast Fourier Transform — FFT General Purpose Input Output — GPIO Graphical User Interface — GUI Human Machine Interface — HMI Integrated Circuit — IC Inter-Integrated Circuit — IIC Keyboard Interrupt — KBI Light Emitting Diode — LED Liquid Crystal Display — LCD Microcontroller Unit — MCU Open-Collector — OC Printed Circuit Board — PCB Programmable Delay Block — PDB Programmable Analog Comparator — PRACMP MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 Freescale Semiconductor, Inc. 91 Root Mean Square — RMS Real Time Clock — RTC Serial Communication Interface — SCI Surface Mounted Device — SMD Switch Mode Power Supply — SMPS Serial Peripheral Interface — SPI Zero-Cross Detection — ZCD MQX-Enabled MCF51EM256 Single-Phase Electricity Meter Reference Design, Rev. 0 92 Freescale Semiconductor, Inc. How to Reach Us: Home Page: www.freescale.com Web Support: http://www.freescale.com/support USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, EL516 2100 East Elliot Road Tempe, Arizona 85284 +1-800-521-6274 or +1-480-768-2130 www.freescale.com/support Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) www.freescale.com/support Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064 Japan 0120 191014 or +81 3 5437 9125 support.japan@freescale.com Asia/Pacific: Freescale Semiconductor China Ltd. Exchange Building 23F No. 118 Jianguo Road Chaoyang District Beijing 100022 China +86 10 5879 8000 support.asia@freescale.com For Literature Requests Only: Freescale Semiconductor Literature Distribution Center 1-800-441-2447 or +1-303-675-2140 Fax: +1-303-675-2150 LDCForFreescaleSemiconductor@hibbertgroup.com Document Number: DRM121 Rev. 0 Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductors products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any liability, including without limitation consequential or incidental damages. "Typical" parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals", must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claims alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. RoHS-compliant and/or Pb-free versions of Freescale products have the functionality and electrical characteristics as their non-RoHS-complaint and/or non-Pb-free counterparts. For further information, see http://www.freescale.com or contact your Freescale sales representative. For information on Freescale's Environmental Products program, go to http://www.freescale.com/epp. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.