Project PlanRev. 0.1Page 1

Project Bluebird

University of Portland / School of EngineeringPhone 503 943 7314
5000 N. Willamette Blvd. Fax 503 943 7316
Portland, OR 97203-5798

Final Report

Project Yew: An In-line Power Monitor with Cost Analysis

Contributors:

ZubinBagai

Kevin Eldrige

Jon Worley

Advisors:

Dr. Robert Albright

Dr. Peter Osterberg

John Haner, Bonneville Power Administration (B.P.A.)

Approvals

Name / Date / Name / Date
Dr. Albright / John Haner, B.P.A.

Insert checkmark (√) next to name when approved.

University of PortlandSchool of EngineeringContact: J. Worley

Final ReportRev. 1.0Page 1

Project Yewup-EE-tr-10-03

Revision History

Rev. / Date / Author / Reason for Changes
0.85 / 03/22/10 / K. Eldrige, J. Worley & Z. Bagai / Initial draft
0.90 / 3/26/10 / K. Eldrige, J. Worley & Z. Bagai / Draft submitted to Dr. Albright
0.91 / 3/30/10 / K. Eldrige, J. Worley & Z. Bagai / Revisions made as per Dr. Albright’s comments
0.95 / 3/31/10 / K. Eldrige, J. Worley & Z. Bagai / Draft submitted to Industry Representative
1.0 / 4/09/10 / K. Eldrige, J. Worley & Z. Bagai / Revisions made as per comments made by Industry Representative

University of PortlandSchool of EngineeringContact: J. Worley

Final ReportRev. 1.0Page 1

Project Yewup-EE-tr-10-03

Acknowledgments

Team Yew would like to thank the MOSIS Educational Program[1] for making the MOSIS part of the project possible. We would also like to thank our Faculty Advisors, Dr. Robert Albright and Dr. Osterberg, for their guidance and advice. Thank you as well to our Industry Representative, John Haner, who took time out of his busy schedule to review our technical documents and offer helpful input for our design. Finally, we would like to thank Dr. Wayne Lu and Steve Westdalfor their voluntary assistance with our PIC micro-controller.

Table of Contents

Summary

Introduction

Background

Architecture

Methodology

Product Definition

Project Proposal

Functional Specification

Design

Component Selection

System Schematics

Design Document

Build and Debug

Components

Voltage Measurement

Current Measurement

MOSIS

Isolation ICs

PIC

LCD

Solid State Relay

Bread Board/Soldering

Order of Operations

Results

Technical

Power Sensing

Voltage Measurement

Current Measurement

Data Processing

PIC Microcontroller (PIC, for short)

MOSIS Chip

Actuate Display

Resolution of Voltage and Current Measurements

Process

Project Assumptions

Current and Voltage Sensor Accuracy

Software for MOSIS chip layout is reliable

We can program the PIC microcontroller by ourselves

The Device will be used in an area that has “Time-of-Use” Billing

The “present price” of electricity can be sent to the user by their utility

Appliances under test can be classified in one of three power factor classes

Milestones

Explanation of Missed Milestones

Purchase PIC Components

Sensor Circuits Built and Tested

PIC Programmed and Tested

System Integration Complete

Finish System Testing with CPLDs

System Testing Complete

Project Risks

Unfamiliarity with PIC programming

Delays ordering/receiving sensors from manufacturer

Failure of MOSIS chip

Step size of analog-to-digital converter is too large

Resource Requirements

Contingency Plan

Conclusions

Appendices

Appendix A. System Block Diagram

Appendix B. PIC Microcontroller Data-Flow Diagram

Appendix C. MOSIS Functional Block Diagram (Counter and Comparator)

Appendix D. MOSIS Counter Functional Diagram

Appendix E. MOSIS Counter Encoding

Appendix F. Power Sensing Schematic

Appendix G. Project Budget

Appendix H. Data Flow of Analog-to-Digital Converter

Appendix I. MOSIS Chip Gate Layout in B2 Logic

Appendix J. MOSIS Chip Layout in L-Edit

Appendix K: MOSIS Chip Pin Out

Appendix L: Power Factor Table

Appendix M: Testing Results (1st run-through)

Appendix N: Testing Results (2nd run-through)

Appendix O: PIC Microcontroller Assembly Code

University of PortlandSchool of EngineeringContact: J. Worley

Final ReportRev. 1.0Page 1

Project Yewup-EE-tr-10-03

List of Figures

Figure 1. Hardware Architecture

University of PortlandSchool of EngineeringContact: J. Worley

Final ReportRev. 1.0Page 1

Project Yewup-EE-tr-10-03

List of Tables

Table 1. Team Yew’s Milestones………………………...………………………………………….……13

University of PortlandSchool of EngineeringContact: J. Worley

Final ReportRev. 1.0Page 1

Project Yewup-EE-tr-10-03

Chapter / Summary
1

The goal of Team Yew’s design project was to build an in-line power monitor that provides the user not only with the power consumption information for the appliance that is plugged into a 120VAC socket, but also our monitor will provide a cost-analysis of the power consumption, putting the energy usage in terms of dollars. The main idea was to provide awareness to the user who may or may not have a good grasp of how much energy is required to power in-home devices and appliances, and the associated cost.

While it is true that there are currently devices available that are power monitors, there are a few areas that we intended to improve upon the existing technology. We went to great lengths to make our device have very low power consumption, by choosing a small LCD display and IC chips that use very little power. We aimed to make the interface more engaging to the user by requiring information about the appliance inputted by the consumer via a keypad and by having the logic in our product prevent the user’s appliance from receiving power if the energy rate[2] is above a user-defined threshold. These features make the user more informed about the costs associated with use of different appliances and with time of use. We were aiming to make an innovation to the existing appliances by combining all of these capabilities into a single product.

The project design can be broken down into three distinct phases: Power Sensing, Data Processing, and Actuate Display. Power Sensing was accomplished through circuitry that captures the voltage and current values being used by the appliance that is plugged into our product. Data Processing was accomplished through the use of a PIC micro-controller and a MOSIS chip. The final stage, Actuate Display, required us to program the PIC to output user information to an LCD. For more specific information about the technologies being used in our project, see Architecture in this document.

It was expected that our end design would turn out noticeably larger, physically, than existing products. This is due mainly to the additional features that we wanted our prototype to have. By adding a key pad, a display, and two ICs, our product was necessarily larger in size simply because we did not have the technology at our disposal required for compressing the design. The overall goal of Team Yew was to design and build a working model, not a finalized marketable product.

University of PortlandSchool of EngineeringContact: J. Worley

Final ReportRev. 1.0Page 1

Project Yewup-EE-tr-10-03

Chapter / Introduction
2

This document is primarily designed for use by the faculty of the University of Portland, the members of Team Yew, the team’s industry representativeJohn Hanerof the Bonneville Power Administration (B.P.A.), as well as fellow students in the Electrical Engineering/Computer Science Department.

Contained in this document is a detailed explanation of the In-line Power Monitor with Cost Analysis, along with an analysis of how the project was implemented. The outcome of the project is also described and compared with the initial plans of implementation.

Along with the project description, the wiring diagrams used to implement the design, a finalized MOSIS diagram and layout, a Power Factor Look-up Table and the source code used to program the PIC microcontroller are included in this document.

University of PortlandSchool of EngineeringContact: J. Worley

Final ReportRev. 1.0Page 1

Project Yewup-EE-tr-10-03

Chapter / Background
3

The USA is the top consumer of energy and resources in the world. Many people do not have a good understanding of how they really use resources. With our monitor people will be able to start to realize how they are actually consuming energy with hopes that it will be easier to be able to start conserving energy. Power companies are starting to work on the “smart grid”, and a device like ours would help in defining the idea of a smart grid by potentially giving accurate data on how, when, and why a household uses energy.

Data relating to individuals’ power usage is the first step to being able to control how people use their energy. When power companies raise their rates during peak usage hours, a meter like this would be very useful in letting people know when that is happening so that the user can decide whether or not to use power during those hours. This would lead to savings on power bills if they decide not to use as much during peak hours. As a result there would be less of a demand on the power companies during times when they struggle to provide all of the power that the grid needs. In general, letting people know how much energy they are using is a way to educate people about the energy distribution as a whole. People know how much energy they are using each month for their entire house, but many times it is unclear what types of appliances are the ones that are really draining power. This device will give them insight pertaining to what their household energy consumption really is.

To display energy consumption by a device, it is important to understand how power is consumed. When measuring AC power (P), voltage (V), current (I), and power factor [PF = cos (θ)] have to be multiplied together. This accounts for phase difference (θ) between voltage and current that occurs because of reactive appliances, such as a motor, in appliances.

Generally it is assumed that the voltage supplied by a standard USA outlet is 120 VAC, and if that were true we would be able to measure power by simply monitoring how much current is being drawn by a load. However the voltage can vary anywhere from ~95-135 VAC, because it is much more important for a power utility to make sure frequency is regulated very strictly than it is to make sure voltage is regulated strictly. This means that for our project, merely assuming that voltage is constant, would not give a result that is accurate enough.

University of PortlandSchool of EngineeringContact: J. Worley

Final ReportRev. 1.0Page 1

Project Yewup-EE-tr-10-03

Chapter / Architecture
4

This chapter provides an in-depth description of how we built the Inline Power Monitor prototype. The technical details of the components we used can be found in the Results: Technical section of this document.

Methodology

The project consists of three distinct phases. Each of the following corresponds to a general period of development that addressed some aspect of the design. The phases are as follows:

  • Product Definition
  • Design
  • Build, Debug, and Evaluate

Within each of the aforementioned periods there were specific project milestones that were defined and completed. The following text provides a description of how Team Yew completed these phases of design.

Product Definition

This first stage required Team Yew to define the functionality of the Inline Power Monitor. The preliminary functional blocks were developed and operational specifications were outlined. This process was comprised of many discussions with professors to determine a plan of attack to accomplish our goal.

Project Proposal

The concept for this project was presented to the University of Portland’s School of Engineering faculty. This document was submitted in the first two weeks of the academic year. Our document was approved with no special conditions.

Functional Specification

This document went into great detail about how our device would function. It summarized how parts of the project would function, and provided some rough ideas about specific parts to be used. Our industry representative gave us a tremendous amount of feedback that allowed us to see the complexities of our project which helped us more clearly define our design. This Functional Specification highlighted what our prototype would do, and laid the groundwork for our more-detailed Design Document.

Design

This phase of the project was filled with many hours of research which led to part selection, design schematics, and other definitions required to meet our specifications. We made detailed wiring diagrams and created a document that theoretically could lead another group of people to build our prototype with no prior knowledge of the project.

Component Selection

The next focus of the project was to find components that would provide us with the functionality that we sought. We knew that our project broke down into three distinct phases; Power Sensing, Data Processing, and Actuate Display.

The Power Sensing part of our project needed to accomplish three things. First, we needed to precisely measure voltage from a 120 VAC outlet. Second, the circuitry needed to precisely measure the current draw of aappliance under test. Third, the circuitry needed to provide isolation between our prototype and the appliance under test such that if our circuitry failed, the appliance under test would not be damaged. The voltage out of an outlet can fluctuate from ~95-135 VAC, and we wanted to be able to accurately measure its value. To do this we used two resistors in series to measure the voltage and divide it down to a lower value. To measure current we used a 0.015 Ohm current sensing resistorto transduce current flow into a DC voltage. To provide isolation, we chose an optical-isolation IC and a solid-state relay.

The Data Processing part of our project was done with the use of a MOSIS chip and a PIC microcontroller.

We decided to use an 18F8722 PIC microcontroller, because we were familiar with PIC technology and had experience with this specific chip. Thus, familiarity and the fact that it provided us with enough input/output pins were the main draws to using this technology.

The Actuate Display uses a 2 line, 80 character LCD display, which is driven by the PIC. This was done, because we have experience with outputting to an LCD through a PIC and again used familiarity as our guiding principle in choosing this technology.

System Schematics

When we finished selecting our components, we went about drawing up schematics that detailed the interface between all of our system components. These schematics were then reviewed by advisors and our industry representative to check for mistakes.

Design Document

The DesignDocument detailed exactly how to build the Inline Power Monitor with Cost Analysis. The purpose of the Design Document was to organize all of the relevant information about the prototype, and provide the details such that another group of people could read the document and build the prototype from it.

Build and Debug

After the completion of the Design Document, we went on winter break. Following the Semester break, we used the Design Document to guide our construction. We built each of the subsystems on a bread board or solder board, and then debugged them extensively. When a sub-system was fully tested and confirmed to be functioning as expected, we connected it to another subsystem and then debugged this interface. By using this iterative process, we were able to build in parallel and then combine our individual work and move forward rapidly.

At first we were interested in soldering a lot of our components together to compress our design as much as possible. This choice of implementation, however, only complicated our debugging process. As we went about debugging subsystems, we discovered wiring errors or even failed ICs that then had to be de-soldered to fix. After several weeks of work, we decided to change our plan of attack to using a bread board for as much of our design as possible. This allowed for easier debugging, and for easier replacement of failed circuitry.

Components

Our project consists of several different technologies: MOSIS, PIC, LCD, Solid-State Relay, Resistors, and Isolation ICs. Each of these required a different implementation approach.

Voltage Measurement

The voltage measurement was very straight forward to figure out. Once we decided upon the isolation ICs that we were going to use in our project, we knew that we needed a low voltage value to send into the input of these ICs. To accomplish this, we decided on a 1MΩ resistor in series with a 1KΩ resistor. This voltage divider circuit allowed us to divide a 120 VAC waveform by 1000, and send this low voltage directly into the Isolation ICs.

Current Measurement

After settling on the Isolation ICs, we knew that we need a voltage to send into its inputs. Our first choice to accomplish the current measurement was a Hall-Effect Probe that would transducer the magnetic field from a current-carrying wire into a voltage between 2.5 and 3.125 VDC. We tried to make it work, but we were never able to get an accurate reading out of the transducer. Our fall-back option was to insert a very small resistor (0.015 Ω) on the Neutral line. We would then run a lead from the high (V+) side of the resistor and one from the low (V–) side of the resistor. Giving a voltage difference Vin to the Isolation ICs.

MOSIS

The MOSIS chip is used for implementing functions that pertain to counting time and switching the solid-state relay on and off. For debugging purposes, a 95108 CPLD was burned using an .abl file made from the original design. After much debugging, it was found that the CPLD burning process actually had some flaws. One particular flaw showed up in the counter function of the CPLD. The MOSIS chip does not have any flaws. It is able to keep track of time, and switch the relayon and off at appropriate times.

Isolation ICs

These are pre-built ICs that perform multiple functions for our prototype. First and foremost, they optically isolates high voltages from low voltages in our circuitry. Initially we tried to solder these on a board so that we had all of our power sensing components (Relay, Resistors, Fuse, and Isolation ICs) on a small circuit board. This implementation did not end up working, and so we wired these ICs into our circuit design using a bread board, which allowed for easier debugging and modifications to the circuitry.