final report - teaching.up.eduteaching.up.edu/.../ay10/yew/documents/teamyew_fina…  · web...

47
University of Portland School of Engineering Phone 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: Zubin Bagai Kevin Eldrige Jon Worley Advisors: Dr. Robert Albright Dr. Peter Osterberg John Haner, Bonneville Power Administration (B.P.A.) Approvals UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: J. WORLEY

Upload: truongnhu

Post on 07-Feb-2018

215 views

Category:

Documents


1 download

TRANSCRIPT

Final Report

functional specificationRev. 0.8Page 10

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:

Zubin Bagai

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.

Project PlanRev. 0.1Page 16

Project Bluebird

(.........)

University of PortlandSchool of EngineeringContact: J. Worley

2

University of PortlandSchool of EngineeringContact: J. Worley

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. Albrights comments

0.95

3/31/10

K. Eldrige, J. Worley & Z. Bagai

Draft submitted to Industry Representative

Project PlanRev. 0.1Page 4

Project Bluebird

Final ReportRev. 0.91Page 30

Project Yewup-EE-tr-10-03

(.........)

Acknowledgments

Team Yew would like to thank the MOSIS Educational Program[footnoteRef: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 Westdal for their voluntary assistance with our PIC micro-controller. [1: The MOSIS Service, "MOSIS Educational Program (MEP)", Information Sciences Institute, University of Southern California, Marina del Rey, CA, http://www.mosis.com.]

Table of Contents

Summary1

Introduction2

Background3

Architecture4

Methodology4

Product Definition4

Project Proposal4

Functional Specification4

Design5

Component Selection5

System Schematics5

Design Document5

Build and Debug6

Components6

Voltage Measurement6

Current Measurement6

MOSIS6

Isolation ICs7

PIC7

LCD7

Solid State Relay7

Bread Board/Soldering7

Order of Operations7

Results9

Technical9

Power Sensing10

Voltage Measurement10

Current Measurement10

Data Processing10

PIC Microcontroller (PIC, for short)10

MOSIS Chip11

Actuate Display11

Resolution of Voltage and Current Measurements11

Process11

Project Assumptions11

Current and Voltage Sensor Accuracy12

Software for MOSIS chip layout is reliable12

We can program the PIC microcontroller by ourselves12

The Device will be used in an area that has Time-of-Use Billing12

The present price of electricity can be sent to the user by their utility12

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

Milestones13

Explanation of Missed Milestones14

Purchase PIC Components14

Sensor Circuits Built and Tested14

PIC Programmed and Tested15

System Integration Complete15

Finish System Testing with CPLDs15

System Testing Complete15

Project Risks15

Unfamiliarity with PIC programming15

Delays ordering/receiving sensors from manufacturer15

Failure of MOSIS chip16

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

Resource Requirements16

Contingency Plan16

Conclusions18

Appendices19

Appendix A. System Block Diagram19

Appendix B. PIC Microcontroller Data-Flow Diagram20

Appendix C. MOSIS Functional Block Diagram (Counter and Comparator21

Appendix D. MOSIS Counter Functional Diagram22

Appendix E. MOSIS Counter Encoding23

Appendix F. Power Sensing Schematic24

Appendix G. Project Budget25

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

Appendix I. MOSIS Chip Gate Layout in B2 Logic27

Appendix J. MOSIS Chip Layout in L-Edit28

Appendix K: MOSIS Chip Pin Out29

Appendix L: Power Factor Table30

Appendix M: PIC Microcontroller Assembly Code31

List of Figures

Figure 1. Hardware Architecture9

List of Tables

Table 1. Team Yews Milestones....13

Chapter

Summary

1

The goal of Team Yews 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 120 VAC 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 users appliance from receiving power if the energy rate[footnoteRef: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. [2: Both rate and price of electricity will be used to discuss how the electric utility is charging for power]

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.

2

Chapter

Introduction

2

This document is primarily designed for use by the faculty of the University of Portland, the members of Team Yew, the teams industry representative John Haner of 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.

2

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.

2

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:

1. Product Definition

1. Design

1. 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 Portlands 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 a appliance 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 resistor to 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 Design Document 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 1 M resistor in series with a 1 K 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 relay on 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.

PIC

The PIC is implemented in three phases: input, calculations, and output. The PIC takes in as input, the analog AC waves, representing current and voltage, and digitizes them using the internal analog-to-digital converter. It also takes a binary coded value for the 24 hour counter that keeps track of how long the power monitor has been active. The PIC is connected to a 4x4 matrix keypad which handles user input. The PIC then calculates, based upon these inputs, the total power used in $/kW-h, the duration, and the rate of energy at which this calculation was made. This information is then outputted to an LCD screen. The PIC also outputs the user entered present rate and maximum rate to the MOSIS for comparison.

LCD

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.

Solid State Relay

This is a pre-built IC that performs a single function. In order to incorporate it into our device we had soldered the four pins to wire which we then ran to other components. We did not use a bread board for this because we used the relay to switch power on or off, and the bread board could not have supported such high voltage values.

Bread Board/Soldering

Because of the number of components we needed to connect, we chose to solder parts of our project onto a circuit board, and use a bread board to connect other parts together. Future implementations of this project would probably benefit from a Preprinted Circuit Board, which would minimize the size of the prototype as well as the possibility for error.

Order of Operations

The order we chose to implement our project was largely based on when we had certain components available to work with. Most of the components mentioned above could be fully implemented independently and in parallel with other components. Once the components were ordered there was some lead time until we received them and we able to begin building.

For our design, we started with the MOSIS chip because of the hard deadline of November 30, 2009. We then worked on the building the Power Sensing Circuit, which included the Solid State Relay, two resistors, a fuse, and two Isolation ICs. At the same time, we also burned our CPLD and programmed the PIC microcontroller. Since each member had an area of expertise, we were able to work on these tasks in parallel.

Zubin had taken the microprocessor class, so he had access to source code to control the LCD from the PIC. Our project required minor modifications of this original source code in addition to major additional functionality in order to meet our needs.

Finally, we connected each of these technologies together and fitted them into a housing to protect them from coming into contact with any of the circuitry when power is being applied.

2

Chapter

Results

5

This chapter details how Team Yews project works and how our team was able to meet our requirement specifications. This chapter will go over technical details, as well as the process the team implemented to complete our work.

Technical

Our prototype consists of three main components: Power Sensing, Data Processing, and Actuate Display.

The Power Sensing component measures the power supplied by the electrical outlet (power absorbed by the appliance). This is accomplished by using a voltage divider circuit and a current sensor to individually measure accurate voltage and current values being drawn by the appliance.

The Data Processing component of our product consists of a MOSIS chip and PIC microcontroller. In this stage, the PIC takes the power measurement and multiplies it by the time duration that the appliance has been in use as well as the electric utility rate, yielding total energy cost in dollars, over a certain interval of time. The PIC microcontroller also handles the keypad for user input of a maximum electricity rate allowed. The MOSIS chip is used as a comparator circuit and a timing circuit to keep track of the time that the appliance has been in use. The comparator takes the user input of a maximum electricity rate and compare it to the current electricity rate.

The Actuate Display component outputs the rate input to the keypad, the total power consumed by the appliance (in Watts), the duration of use of the appliance (in hours), and the total energy cost (in dollars).

The top-level function block diagram of our prototype is shown in Figure 1, below.

Figure 1. Hardware Architecture

Power Sensing

The power sensing portion of our prototype consists of voltage and current measurements.

Voltage Measurement

Since the voltage varies out of the electrical outlet, we measure the voltage supplied to the appliance with a pair of resistors to get a more accurate power reading. The voltage out of a power outlet is too high to be sent directly to the PIC, so we use a voltage divider circuit to step down the voltage to an appropriate value (0-5 VAC). The PICs analog-to-digital step size is 19.5 mV, meaning that every 19.5 mV a unique digital value is assigned to the analog input signal.

Current Measurement

Since the current drawn varies from appliance to appliance, we measure the current with a sensor to acquire a more accurate power reading. The sensor uses a .015 Ohm current sensing resistor that transduces this current into a DC voltage output between 2.5 V and 5 V.

Data Processing

This phase of the prototype is implemented using a PIC microcontroller and a MOSIS chip. There is a bi-directional data flow between the PIC and MOSIS that is strictly an exchange of bits from the MOSIS to the PIC and vice versa. For more information about the bit data flow, please refer to the Appendix.

PIC Microcontroller (PIC, for short)

The analog voltage signals of voltage and current values are received by the PIC microcontroller from the voltage divider circuit and the current sensor. These signals are processed by the PICs internal analog-to-digital converter. The digitized values of voltage and current are multiplied together, whose product combined with the power factor is the real power (in Watts) that is being absorbed by the attached appliance.

The PIC microcontroller is connected to a keypad, which is used to input the maximum electricity rate the customer wishes to pay. The customer can also input the present electricity rate if a rate signal is not provided by the electric utility.

The PIC sends the above information to the MOSIS for comparison. The MOSIS chip will send a signal to the PIC with the results of the comparison. If the present electricity rate is greater than the maximum electricity rate, the PIC will display to the LCD screen the present electricity rate and the fact that it exceeds the maximum allowed rate.

If the present electricity rate is less than the maximum electricity rate, the PIC will take in as input from the MOSIS chip the duration (in hours and minutes) that the appliance has been drawing power. The duration will be multiplied by the present electricity rate and the power, resulting in the energy cost (in dollars) that the appliance has incurred.

The present electricity rate, power, duration, and energy cost are displayed to the LCD screen.

MOSIS Chip

The MOSIS chip will be used to measure the time that the appliance has been in use, and to compare a user-input electricity rate threshold against the present electricity rate. The chip will interface with the PIC so that the time can be sent to the LCD. The MOSIS will also use the comparator to decide whether or not to switch off power going to the appliance based on the user-input electricity rate threshold.

Actuate Display

The present electricity rate, power, duration, and energy cost are displayed to the LCD screen. A message indicating that the maximum price threshold has been exceeded will be displayed if the present rate happens to exceed the user inputted rate. The PIC microcontroller will drive the LCD screen, as well as send the above information to the screen.

Resolution of Voltage and Current Measurements

For our voltage measurement the range that we are anticipating, based on input from the Bonneville Power Administration, is from approximately 90 VAC - 130 VAC (RMS), which corresponds to ~127 VAC 184 VAC (zero-peak). After our voltage divider circuit pulls down this voltage, the expected range of voltages going into the PIC will be ~ 1.27 VAC 1.84 VAC. The voltage that will go into the PIC that represents the current going through the line will be from 1.5 VAC 2.25 VAC. This will represent 0 - 15 AAC (RMS) going through the line.

Process

There were some deviations that Team Yew had to take from the Development Plan, laid out in the Design Document in order to complete the project. Those differences are discussed in the following pages.

Project Assumptions

In our Design Document, we detailed the assumptions that we were going to make to help our project successfully come to fruition.

There exist purchasable sensors that will give us accurate values for current and voltage that are being used in an appliance.

We assumed that the software programs that produce a MOSIS chip layout are reliable and will produce a working schematic that can be made in a fabrication factory.

We must be able to learn how to program the PIC microcontroller by ourselves since most of us have never used one before.

We assumed that this project will be used in an area where the electricity rate may change at various times throughout the day and billing period.

For this device to be useful we assumed that there is a practical way in which the power utility company can get the present electricity rate to the user of the device.

All appliances that can be used in a home environment must be able to be classified into three different power factor classes so that the appliances power usage can be measured with acceptable accuracy.

Current and Voltage Sensor Accuracy

We assumed that we would be able to get good readings from the sensors that we purchased. At first we couldnt get any of our sensors to work. We then realized that it wasnt our sensors that were malfunctioning, but our oscilloscope wasnt properly reading the output of the sensors. We never were able to actually see the resulting waveforms coming out of the sensors, but we were able to get good readings from a DMM. So we know that they are there and accurate.

Software for MOSIS chip layout is reliable

We assumed that if we designed the MOSIS chip in B-Logic, we have proper software that would convert the design into a file that the fabrication lab could then use. This was partly accurate. The actual MOSIS chip works perfectly. The software accurately converted our files over to a file type that the fabrication lab could use to build the chip. The conversion to an .abl file was not so perfect though. We needed that to build our macro model CPLD, which never fully worked. The purpose of the CPLD was only for testing purposes. What really mattered was that the MOSIS worked, which it did.

We can program the PIC microcontroller by ourselves

We assumed that with our background in programming in assembly language, we would be able to program the PIC microcontroller when it came. There was a period of time that we needed to learn exactly what the differences were with this PIC, but we were able to successfully program the PIC

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

This device was designed to be used in an area where people can be billed different amounts for energy depending on what time of day it is.

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

It was assumed that our project would be used in a situation where a power utility could remotely transmit the rate of energy in real time to customers. This was so the device could automatically regulate the power switching relay based upon the rate of energy.

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

To make our design less complicated, we decided to assume that we could classify any appliances into three different categories. Each category would have a different power factor assigned to it. For example, any purely resistive load would fit into the class where the power factor is one. After substantial research, we were only able to come up with power factor ratings for a few household appliances. Given more time, we would suggest expanding this table by manually collecting the WATT rating and dividing it by the VA rating on multiple devices. For our power factor table, please see Appendix L.

Milestones

Table 1. Team Yews Milestones

Number

Description

Present

27 Oct 09

1

Project Pre-Approval Approved

09/03/09

2

Functional Specifications .9

10/2/09

3

Functional Specifications .95

10/09/09

4

Functional Specifications 1.0

10/19/09

5

Purchase Sensors

10/16/09

6

MOSIS Preliminary .edf

10/30/09

7

Product Budget

11/07/09

8

Obtain CPLDs

11/07/09

9

Make Voltage Divider Circuit

11/13/09

10

Full Functional PIC Outline

11/18/09

11

Design Document 0.90

11/25/09

12

MOSIS Chip Design Submitted

11/25/09

13

Compile .abl file

11/25/09

14

Order Relay (Switch)

11/27/09

14

Program Review #3

12/1/09

15

Design 0.95

12/4/09

16

Design 1.0

12/11/09

17

Purchase PIC components

12/18/09

18

January Program Review

1/12/10

19

Sensor Circuits Built and Tested

1/26/10

20

CPLD Programmed and Tested

1/31/10

21

PIC Programmed and Tested

2/12/10

22

February Program Review

2/23/10

23

System Integration Complete

2/26/10

24

Finish System Testing with CPLD(s)

2/5/10

25

Spring Break

3/8/10

26

Receive MOSIS Chip and Test in System

3/15/10

27

Implementation of Any Additional Features

3/19/10

28

System Testing Complete

3/26/10

29

March Program Review

3/30/10

30

Founders Day Presentation

4/13/10

31

Final Report Approved

4/20/10

All green colored milestones are milestones that we were able to successfully meet. All red milestones are milestones that we werent able to meet on time.

Explanation of Missed MilestonesPurchase PIC Components

Purchasing the PIC became a very tough decision for us, and we wanted to have as much knowledge about what PIC was right for us before we made a final decision. The PIC is the cornerstone of our project, and it is also the most expensive component. We had to make sure that we were choosing the right one before placing an order.

Sensor Circuits Built and Tested

The sensor circuits were built on time, but we werent able to test them because the oscilloscope that we were using was giving us inaccurate readings on the voltage waves that were coming out of the sensors. For a long time we thought that the readings were accurate so we spent most of our time trying to figure out why the sensors were performing the way they were, when in really the sensors were working the whole time, we just couldnt see that they were working.

PIC Programmed and Tested

Programming the PIC got delayed a few times for multiple reasons. At first it got delayed because we couldnt get the sensors to work so we werent able to send signals into the PIC that were useful. Also Zubin Bagai, our main PIC programmer, had planned a trip to India, and when he got back he caught an bad Indian flu which put the programming back multiple weeks.

System Integration Complete

System integration was pushed back because of problems with the sensing circuit and programming the PIC

Finish System Testing with CPLDs

The CPLDs that were burned with our design on them never worked properly so we could never fully test them with the rest of the system. Luckily the MOSIS chip worked when it arrived.

System Testing Complete

Again system testing was pushed back because of problems with earlier milestones

Project Risks

There were multiple steps to complete and several different parts to integrate for the prototype; new risks were introduced with each step.

Unfamiliarity with PIC programming

Delays ordering/receiving sensors from the manufacturers

Failure of the MOSIS chip

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

Unfamiliarity with PIC programming

We took a risk in deciding to use a PIC microcontroller. Only one team member had any experience in programming a PIC before. We had to assume that the tasks that the PIC needed to perform were going to be able to be programmed by one person.

Delays ordering/receiving sensors from manufacturer

There were risks involved with ordering all of our sensors from manufacturers. We never really knew if a part would work for our project until we received it and tested it in our system. Manufacturers are generally very slow in shipping parts. If we ever chose a sensor ended up not working, it would have been up to a few months for us to wait for a replacement.

Failure of MOSIS chip

Because of the way the MOSIS program worked, there isnt a lot of time between when the chip arrives, and when the project has to be done. If the design didnt work, it would have been hard to implement the functions in other ways in the time that we had left. We did have backup plans using the PIC, but it would have been time consuming to do so.

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

We were worried that our resolution for our analog-to-digital converter was not going to be good enough to get an accurate reading of power out. We determined though that while the resolution isnt perfect, it will capture voltage and current readings to an acceptable accuracy.

Resource Requirements

Our original project budget was estimated to be under the $250 threshold that is set as the allowance for teams, but we ended up going over that because of the scope of our project and the failure of some of our IC chips. We were able to justify going over our spending limit to get a PIC micro-controller that would be easier to replace if it burned out, and because a number of our circuitry components failed/did not work out and so we had to order new parts. These instances of failure were somewhat anticipated, but more of our parts ended up not working properly than we originally accounted for and resulted in a greater incurred cost than we originally thought would be required.

Our project was broken into many separate parts that were worked on simultaneously, and deadlines were put in place for each phase of the project. We had weekly team meetings set-up for status updates of each phase, and enough time was put in early on in the Spring Semester that the majority of that time was spent testing and debugging circuitry leading up to the debugging milestone date.

Contingency Plan

As previously mentioned, we had intended to accomplish our current measurement with the use of a Hall Effect probe. In the case that this transducer did not work out, we had a fall-back option of using a current-sensing resistor. When the Hall Effect probe did not result in accurate current measurements, we purchased some current sensing resistors and put one on the Neutral line to use a voltage difference across the resistor to measure current.

The MOSIS chip was designed and submitted to Dr. Osterberg for fabrication at the end of last November. The MOSIS was expected to return from Fabrication in the middle of March, 2010. There was the possibility that the MOSIS would come back and not work, and so to ensure that our project could function without the MOSIS we programmed a CPLD (Complex Programmable Logic Device) to use in its place. This allowed us to test/integrate our circuitry before the MOSIS arrived. We successfully burned a CPLD and tested its functionality, but discovered an error with part of the functions we had programmed, and thus we were unable to complete system testing until we received the MOSIS chip.

2

Chapter

Conclusions

6

Team Yews project over the last year was to design and build a power monitor, which would be able to measure power coming out of a household electric outlet, and display how much it costs to use that power. The other function that we built into the device is an automatic power shutoff if the rate of electricity becomes too high for the user. Thus far we have been successful in completing our device. We have been able to successfully create a MOSIS chip that can keep track of minutes and seconds, up to 24 hours. The chip can also compare the present rate of electricity and the maximum allowable rate of electricity, and automatically send a signal to our power sensing relay if the rate of electricity becomes too high. We were able to create optically isolated voltage and current sensors that will send sinusoidal signals that are between 0 and 5 V zero-to-peak. We have also created a successful analog-to-digital converter that can read in values of the sinusoidal waves, and give them accurate binary values that represent the signals that were coming in at that time. We were also able to create a keypad input that could be displayed on our LCD display screen.

Overall the project was very successful. Some goals and milestones proved to be too ambitious, but we learned a lot about what it takes to work as an engineer. The project taught us how to communicate our ideas in such a way that others can understand them, as a team you can then build off of those ideas to create a successful project. The project also proved that no matter how much our team planned for obstacles and barriers in our project, there always arose unexpected problems that became very time consuming. The project became a huge lesson to make as few assumptions as possible especially when planning out a schedule to get things done.

functional specificationRev. 0.8Page 9

Project bluebird

2

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

Line

Category

Description

# of Parts

Rate

Amount

Materials

Subtotal

1.0

Breadboard/Solder Board

1

$0

$0

1.1

Voltage Sensor

2

$5

$10

1.2

Current Sensor

2

$20

$40

1.3

Power Sockets and Box

1

$10

$10

1.4

PIC Microcontroller

2

$35

$70

1.5

1.6

Power Relay

LCD

2

1

$7.50

$15

$15

$15

1.7

Opto-Isolators

4

$2.50

$10

1.8

Push Buttons

18

$0.50

$9

1.9

Shipping

$25

TOTAL

$234

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

Device

PF (Avg)

Hairdryer, Toaster, Heater

1

TV (42" Flat Screen), Wireless Router, Coffee Brewer

0.70

DVR Receiver, DVD/Blu-ray Player

0.60

Laptop Computer (13"), Gaming System, Iphone

0.5

Printer

0.3

Appendix M: PIC Microcontroller Assembly Code

2

AC

Power

Sensing

Data

Processing

Actuate

Display

Prototype

Device

User

Input

Display

AC

Power Sensing

Data Processing

Actuate Display

Prototype

Device

User Input

Display

PIC

ADC

EEPROM

(EEPROM)

Total: 16 bits

Current

Voltage

Keypad 1

st

dimension

(4 bits)

Keypad 2

nd

dimension

(4 bits)

Hours

(5 bits)

Minutes: b6-b4 = 10's place, b3-b0 = 1's place

(7 bits)

Data Memory

(RAM)

Total: 50 bits

PF Class 1

(1 bit)

PF Class 3

(1 bit)

PF Class 2

(1 bit)

CLK

Phantom Price Signal

MOSIS

Power Sensing

On Device Buttons

C

L

K

1

0

b

i

t

s

Enter

(1 bit)

Maximum price

(8 bits)

Present price

(8 bits)

CPU

Program

Memory

Actuate Display

1

1

b

i

t

s

MOSIS

CLOCK

PIC

ADC

10 bits

CPU

Enter(1 bit)

EEPROM(EEPROM)

Total: 16 bits

Current

Voltage

Keypad 1st dimension(4 bits)

Keypad 2nd dimension(4 bits)

Present price(8 bits)

Maximum price(8 bits)

Hours(5 bits)

Program Memory

Minutes: b6-b4 = 10's place, b3-b0 = 1's place(7 bits)

Data Memory(RAM)

Total: 50 bits

PF Class 1(1 bit)

PF Class 3(1 bit)

PF Class 2(1 bit)

CLK

MOSIS

Phantom Price Signal

Power Sensing

On Device Buttons

MOSISCLOCK

CLK

Actuate Display

11 bits

MOSIS

text

PIC

8 bit Present Price

8 bit Max Price

1 bit Clock

1 bit Reset

7 bit Minutes

5 bit Hours

3 bit Relay Control

8 Bit

Comparator

24 Hour Counter

A

B

A>B

A=B

AB

A=B

A