You are on page 1of 29

Digital Wattmeter

Aaron Fogle & Pat Giles

May 3, 2012 Faculty Advisor: Dr. Gregory Bucks

Ohio Northern University

Summary
The goal of our project was to create a wattmeter and power factor reader that was affordable and had a digital display. This proved to be a decently challenging task to accomplish as several factors had to be considered.Such factors were how to interface with a circuit which had around 30 volts across it to a device which could power an LCD display without significantly modifying the behavior of the circuit. Other unforeseen issues did arise during development causing problems, such as switching microcontrollers half way through development and how to ensure the device would be as accurate as possible while still maintaining the other goals of the project. This required two components: a circuit to be designed to meet the specifications of the project, and a program written for a microprocessor which would sample the input and compute the results. All of this needed to be done on a small scale, designed for laboratory settings and affordable to our client. Completing this while still providing the desired functionality proved to be our biggest challenge in working on this project. This report will outline the problems encountered over the course of the year and how we went about resolving them.

Acknowledgement
The group would like to take this time to acknowledge the entire ECCS faculty at Ohio Northern University for their various contributions towards our efforts to finish this project. We would particularly like to thank our faculty advisor, Dr. Bucks, for many long afternoons talking to us about the issues we encountered, as well as providing a third opinion on a matter of discussion. We would also like to thank Dr. Vemuru, for assisting us in finding solutions to problems we just did not see any answers for. We also owe many thanks to Brad Hummel for assisting us in the building of the final prototype. Thanks all.

Table of Contents
1. Needs Statement 2. Objective Statement 3. Background Information 4. Marketing Requirements 5. Realistic Constraints 6. Objective Tree 7. Alternative Solutions - Decision Matrix 8. Functional Decomposition - Block Diagrams 9. Final Design and Integration 10. Test Plan 11. Design Verification 12. Cost of the Project 13. Time Schedule 14. Conclusion 15. References 16. Appendix A: Gantt Chart 1 1 2 5 6 7 8 9 10 10 13 17 18 26 21 21 23 24

List of Tables
Table 1. Marketing Requirements Table 2. Decision Matrix Table 3. Level 0: System Block Diagram Table 4. Level 1: Voltage Requirements Table 5. Level 1: Current Requirements Table 6. Level 1: Converter Table 7. Level 1: Microcontroller Table 8. Level 1: LCD Table 9. Verification of Microcontroller Functionality Table 10. Development Budget Table 11. Cost Per Unit Table 12. Labor Costs Table 13. Project Cost 5 9 10 11 11 12 12 12 19 20 20 20 20

List of Figures
Figure 1 Objective Tree Figure 2 Level 0 Block Diagram Figure 3 Level 1 Block Diagram Figure 4 Final Design Overview Figure 5 Device Schematic Figure 6 Voltage Division Verification Figure 7 Differential Op-amp Verification 7 10 11 13 15 18 19

Needs Statement
The ECCS department within Ohio Northern Universitys College of Engineering is currently using aged analog wattmeters to satisfy laboratory needs for its Circuits labs. This device takes a considerable amount of time to set up and use to obtain the desired measurements. In order to lighten the load on the students, there is need for a digital wattmeter which will allow measurements to be taken faster, easier, and more accurately than they can with the current equipment in use during their power factor experiment, as part of the Electronic Circuits course.

Objective Statement
The objective of this project is to design and prototype a small, cheap, and easily reproducible digital wattmeter. This wattmeter will replace the analog wattmeters being used in Circuits labs today. The device will have input and output terminals for connecting the device to the system under analysis, as well as a digital display to more accurately convey the measurements. The user will be able to incorporate this device within a circuit, between the power source and the load, and the device will in turn digitally display the wattage absorbed and power factor of the load. The meter will also display voltage and current. This design should be affordable and simple to manufacture so that it can be replicated easily. If cost and time allow, there will be a possibility of building 15 of these devices to be used by students in the Electronic Circuits course for their lab assignments.

Background Information
A wattmeter is a device which measures electrical power. The meter can be analog or digital, and either option comes with very different designs. The basic theory behind these meters is based on Ohms Law and Joules Law. In either case, the voltage and current from the measured circuit are the sources to find the power absorbed by the circuit. Although the basis for the wattmeter sounds simplistic, the design of such a device is not as intuitive. As stated previously, both analog and digital wattmeters already exist. Most analog wattmeters operate using the underlying principles of electrodynamics and magnetic fields. Simply put, when a voltage is induced across a resistive load, current flows and a magnetic field surrounds the device. This magnetic field can induce a current in a neighboring coil, causing a piece of metal to move, namely a needle. The needle can be calibrated to read wattage, based on the induced current. This analog setup is a very common design, and somewhat simple to produce. However, it is not incredibly accurate and requires tedious calibration. Newer technology has provided the ability to produce digital wattmeters. These meters usually have a digital display and are portable, resulting in a more versatile and easy to use product. Because these devices are digital, the analog approach is replaced with digital circuits to read in and compute measurements. Digital devices offer the ability to read measurements at any frequency (not just the typical 60Hz in America) and also compute many different quantities. Assuming the microcontrollers read in the magnitude and phase of the voltage and current, the device can compute peak, average, and apparent power, as well as power factor. Digital wattmeters provide versatile capabilities and accurate readings in a very short period of time. After calculations are complete, microcontrollers can output the data to a digital display, making it easier to take measurements on the fly. As time progresses, digital circuits prove to be the most
2

useful and effective method. With the falling price and improved capabilities of digital electronics, they (Digital Wattmeters) have become popular for conveniently measuring power consumption in household appliances with an eye toward saving energy and money.1 Simply put, power factor is a measure of how efficiently one utilizes power supplied. Most loads are primarily resistive loads, including lighting and some electrical appliances, and consume only real power. Devices which include a motor have an inductive component, and thus have a power factor less than one. Power factor is a number ranging from zero to one, with one being desirable; a power factor of one (unity) means all of the supplied power (real power) is being absorbed. Power supplied includes two components, real power and reactive power. Power factor is then the cosine of the angle difference between the voltage and current waveforms within the circuit. Unless the load includes components that absorb reactive power, a power factor less than one means the reactive power is not being utilized and is essentially returned to the source; thus, obtaining a higher power factor is desirable. A purely resistive circuit has voltage and current waveforms which are in phase, and thus power factor is unity. A lagging power factor exists when the phase angle of the current lags behind that of the voltage. This situation occurs with additional inductive loads. Accordingly, a leading power factor occurs when the current waveform leads the voltage in phase. This situation occurs with additional capacitive loads. Power factor can be corrected by placing reactive components in parallel with the load. As stated previously, digital wattmeters can be found commercially; however, the groups device will function on a smaller scale not currently available and include additional functionality. The available wattmeters on the market do not provide the ability to measure and display power factor within the same design. The design in this project will be able to sense the

phase difference between the voltage and current signals. Using this information, the wattmeter will calculate the power factor (whether leading or lagging) and display it digitally in a simple to read manner. This device will be more economical than competing devices. That is to say: it is cheaper and easier to use than competing devices. Other existing designs can be incorporated into our device; primarily, the ideas of how to allow a device to measure current and voltage currently employed in digital multimeters. One option to measure current is by using very small resistance in series with the load and measuring the voltage across that resistor. An alternative solution for measuring current is using an integrated circuit known as a Hall Effect Sensor, which converts a current signal into a voltage (readable by a microcontroller). To measure voltage a very large resistance (on the order of k to M) is placed in parallel with the load. The voltage across this resistance is equal to the voltage of the measured device. The design will also implement a currently-existing digital display for output.

Marketing Requirements
Table 1 lists the marketing and engineering requirements for the project. These requirements were initially given to the group by the customer, and are the basis on which the design will be researched and developed. In addition, justifications are listed to explain to the reader why these requirements have been set. Table 1. Marketing Requirements Engineering Justification Requirements The device should run The product should be able to be used on 120V AC or less. easily around the laboratory, able to plug into a 120V outlet. The device should have There will be input terminals and output input and output terminals possessing the ability to read terminals. voltage and current from measured device. Read up to 50W Device will read wattage accurately to accurately. 50W and display power factor (leading/lagging) as well to suit laboratory experiments. Total device should not This is based on component research and exceed $150. estimation of cost of circuitry and mounting. Possibility of producing The goal is to have a sufficient number to 15 units. outfit the College of Engineering's circuits laboratory.

Marketing Requirements 1, 3, 4

1-4

1-3

1-4

1, 3, 4

Marketing Requirements 1. The system should be easy to use. 2. The system should read accurately. 3. The system should be inexpensive. 4. The system should be easy to reproduce.

Realistic Constraints
Performance o The system should be able to calculate and display the voltage and the current for a given load o The system should be able to calculate and display power factor for a given load, indicating whether the power factor is leading or lagging o The system should be able to measure and display up to 50 Watts accurately o The system should operate on 120V AC or less Functionality o The system will implement input and output terminals to be used for measuring voltage and current for a given load o The system should incorporate a digital display for ease of use o The product should interface with current measuring wires available in the Ohio Northern University Analog Electronics lab Economic o The total parts and manufacturing costs cannot exceed $150 per unit Health and Safety o The system will not expose humans to unhealthy levels of electromagnetic radiation o The circuitry inside the system should be protected from voltage or current levels that are too high for normal operation Manufacturability o The system must be manufactured on a circuit board, accompanied by a schematic demonstrating exact location of all components o The design should include only components that are readily available to anyone who wishes to replicate this design Operational o The system should be able to operate at all temperatures within 20C of room temperature in either direction Reliability o The system should be able to be used quickly and read accurately

Objective Tree
Figure 1 provides the objective tree. This figure begins the decision making process, offering the weights of the marketing requirements as well as a more detailed breakdown. Each criteria weight was assigned by the group members based off of research and logical reasoning. Simply put, the group concluded that the most important criteria is cost in order to save the department money and resources. To add, ease of use and accuracy are equally and nearly as important, as this device will be used for teaching purposes in the Electronics Laboratory. Finally, manufacturability is the final important category because multiple devices will eventually be produced.

Figure 1 Objective Tree showing project breakdown

Alternative Solutions and Decision Matrix


Table 2 provides the decision matrix which was used to select the best-fit design for the entire project. The three considered products are as follows: Modification of the analog wattmeters currently being used, retrofitting a digital display and proper circuitry Construction of a new device, using many integrated circuits for measurement calculations, manipulations, etc. and an inexpensive microcontroller for the digital display Construction of a new device, using minimal amounts of circuitry and implementing larger, more capable microcontrollers for measurement calculations, mathematical operations, analog to digital conversion, etc., as well as operating the digital display

As one can observe from Table 2, the group decided that the cost and manufacturability of the device weighed heavily on the selection of the most appropriate design. Thus, these factors were given higher weights because of the general expectation that the final product is to be reproduced and used within the universitys engineering department. Weights for each criterion were chosen based on constraints given by the costumer and the expected outcome for the project. Point values for cost were allocated from researching device components, and all other points were discussed and agreed upon between group members. Point values for manufacturability, safety and durability were a collective decision within the group. For these, a higher point value is desired. Overall, the group felt that the first two listed options offer great difficulty in modification or circuit layout to fit device requirements, as well as increasing risk of component failure. The third option, based mostly off of larger microcontrollers, incorporates
8

fewer parts and offers a significant amount of programmability, allowing the group to achieve the desired operability through the direct input of mathematical equations, device measurements, etc. Table 2.Decision Matrix Factor Cost Size Manufacturability Safety Durability Total: Weight 35 5 25 15 20 100 Retrofitting 150 320 4 9 7 48.9 Minimum 50 75 1 1 1 Integrated Circuits 150 100 4 9 8 53.6 Maximum 200 512 10 10 10 Microcontroller 100 125 3 9 9 64.4

Cost Size Manufacturability Safety Durability

Functional Decomposition of Final Solution


This section outlines the details of the device operation and specifications, from high level to low level. Level 0 corresponds to the overall basic functionality of the device essentially a black box kind of description. The Level 1 sequence that follows breaks the device down into its various sub-blocks, each with its corresponding description of the purpose and operation of the sub-block.
External Device Voltage

Digital Readout

External Device Current

Digital Wattmeter
AC Power

Output to Load

Figure 2 Level 0 Block Diagram showing system inputs and outputs Table 3. Level 0: System Block Diagram Digital Wattmeter External Device: Outputs from device to measure current and voltage AC Power: 120V AC power Digital Display: Display of Measurements Output to External Device: A pass-through terminal to measure device current Receive voltage and current inputs from external device. Operating on 120V AC, must display power accurately up to 50W and power factor (leading/lagging) for the device.

Module Inputs Outputs

Functionality

10

External Device Voltage

Steppeddown Voltage Voltage Measurement Measured Current Measurement Output

External Device Current

Microcontroller (Arduino Mega)

LCD

Digital Readout

Current Measurement

Measured Current

DC Voltage

Converter

Output to External Device (for Current Measurement)

AC Power

Figure 3 Level 1 Block Diagram showing the blocks for each system component Table 4. Level 1: Voltage Requirements Voltage Measurement External Device Voltage: Device voltage signal Stepped-down device voltage Step down the voltage signal coming from device to a smaller voltage that can be accepted by microcontroller

Module Input Output Functionality

Module Input Output Functionality

Table 5. Level 1: Current Requirements Current Measurement Differential voltage across resistance Amplified voltage signal Differential op-amp circuit. This circuit amplifies a voltage measured across a resistance, to be sent to the microcontroller and converted into a current measurement

11

Module Input Output Functionality

Table 6. Level 1: Converter Converter 120V AC Power Stepped-down DC voltage (12V DC) Step down the voltage coming from outlet and convert to 12V DC to supply power to microcontroller and op amp.

Module Input

Table 7. Level 1: Microcontroller Microcontroller Stepped-down DC Voltage (12V DC) for module power Stepped-down AC voltage from transformer Measured current from device Measurements Compute and output desired measurements. These measurements include voltage, current, power (accurate up to 50W) and power factor (leading or lagging)

Output Functionality

Module Input Output Functionality

Table 8. Level 1: LCD LCD Measurements Digital Display Display measurement values received from microcontroller

12

Final Design and Integration

Figure 4 Final design overview Figure 4 offers a more detailed picture of the internal operation of the wattmeter. As described in the Objective Statement and Marketing Requirements sections, the design includes two input and two output terminals, allowing the device to be integrated between the source and load. The microcontroller accepts analog waveforms as inputs and outputs digital signals to the display. In order to measure voltage, the final design incorporates a simple voltage divider; this branch of the circuit must step down the peak voltage of the incoming signal to less than 5V, as the controllers analog inputs can safely accept values of 5V peak or less. For measuring current, the device includes a differential op-amp circuit. In short, this component amplifies a differential voltage measured across a resistance which is placed in series with the load. It is important to note that this op-amp circuit serves a few purposes to isolate the microcontroller from a potentially high input voltage, accept a small input voltage, and to amplify the input voltage for increased accuracy in calculations. A Hall Effect Sensor, mentioned previously, was not

13

incorporated in the design because a commercial device that can measure low currents (between 100-500 mA) was not found. An upper current limit of 500 mA (based on expected values during laboratory experiments) has been set for this device, thus the maximum gain for the differential op-amp circuit (across a resistance of 2-2.5) was designed to be approximately four times the input voltage. More details on the internal circuitry are discussed later on in this section, including descriptions as to why each component was chosen. After the voltage and current waveforms are stepped-down and amplified respectively, the signals are sampled and digitized by the microcontroller. Because the ADC inside the controller samples much faster than the incoming 60 Hz signals, obtaining one full period of the waveforms accumulates data quickly; thus, the microcontroller is programmed to save to memory the peak of each waveform and the timestamp of when this peak occurred, all during two full periods. Following this, the code recovers the loads voltage and current by utilizing hard-coded resistor values from the surrounding circuitry. The magnitudes of both signals are then multiplied to compute real power. Finally, the timestamps of each peak are utilized to convert to a phase angle (using the time of the current peak minus the time of the voltage peak). The cosine of this phase angle then represents the power factor of the load. If the power factor angle is negative, the load current is said to be lagging the voltage. Alternatively, a positive power factor angle results in the current leading the voltage. As a reference, the AC motors being used in the circuits lab are inductive, resulting in the initial expected power factor to be lagging. After all values are computed properly, results for load voltage, current, real power and power factor are displayed simultaneously.

14

Figure 5 Device Schematic Figure 5 depicts the actual schematic of the device, aside from the microcontroller. Excluding the resistor labeled R10, all resistances are based off of components readily available in the component stock in the circuits laboratory. These resistors are inexpensive, and all are rated at .25W with tolerances of 10%. Due to such large tolerances, actual resistor values can vary significantly compared to nominal. The last resistor, R10, was chosen separately based on having a low resistance (thus causing minimal voltage drop between source and load) and having a higher power rating (accounting for the maximum allowable current of 500 mA). The two potentiometers, labeled R11 and R12, are in place to help create a nominal differential op-amp circuit. To explain, resistors R4 and R7 are nominally equal, as well as R5 and R6. The slide potentiometers in turn make up for the differences within each pair. In addition, the basic diode labeled D1 cuts off any negative swing from the voltage measurement; this is in place because the analog pins on the microcontroller board are rated at 05V peak. Also, the zener diode located in parallel with R2 is designed to conduct when the
15

voltage reaches 5V (caused by too high input terminal voltage), thus preventing damage to the microcontroller. Furthermore, a fast-acting in-line fuse rated at .5A is incorporated in series with the load, preventing current from reaching dangerous levels. If the current does reach a dangerous level, the fuse will blow and the user must then remove the lid and replace the fuse. The op-amp chosen for this design is the Texas Instruments TLV2401IP. This integrated circuit is a rail-to-rail operational amplifier, meaning the output waveform can nearly reach the minimum and maximum values of supply voltage. Fortunately, the op-amp and microcontroller accept an identical supply voltage within a certain range; thus, both components are supplied with power from a single 12V DC adapter, which plugs directly into a 120V AC outlet. Finally, the microcontroller being used in the final design is the Arduino Mega. The group acquired a smaller, older version, known as the Arduino Duemilanove for much testing and development, but eventually decided the chip did not include a sufficient amount of memory to execute the code successfully. A list of parts for a complete device, as well as instructions for producing one unit, are provided in a secondary document. In addition, the information is provided on the groups project web page and the data disc, which includes the necessary electronic files to complete the project. Data sheets for the zener diode, op-amp, and microcontroller are referenced with the construction materials.

16

Test Plan
The testing of this system included verification of all designs of individual components using PSPICE for simulation. Each circuit component was tested via repeated trials of the same experiment for the desired output. This means the output voltage and current of each block was measured using existing equipment in the lab to verify desired values were fed to the microcontroller. The results of these experiments were consistent with calculated values and values measured with other devices for verification. In addition, several iterations of the microcontrollers code were initially tested for operation using test input signals. After the test code was verified functional, additional iterations were executed in conjunction with the physical circuitry. Values displayed on the device were compared to measurements taken with lab equipment to verify accuracy. Finally, the device was tested by using it in the same lab assignment that a student would. Output of the system was verified by comparing the results with calculated values, as well as values measured using other existing devices found in the Analog Electronics lab.

17

Design Verification
To verify operation of the design, results from two basic areas will be reported: circuit board functionality and microcontroller functionality. To begin, it is important to prove that the circuit board outputs signals between 0-5V peak to the microcontroller. The following figures verify the desired outcome.

Figure 6 Verification of the voltage division circuitry Figure 6 depicts the operation of the voltage divider. Channel 1 in the picture shows a maximum of 43.6V, which is the peak voltage of the transformer supplying power. Channel 2 demonstrates the waveform being fed to the microcontroller for calculating input voltage; note that the Channel 2 waveform peaks just below 4V.

18

Figure 7 Verification of the differential op-amp circuit Additionally, Figure 7 demonstrates the operation of the differential op-amp circuit. Here, a voltage of approximately 560mV is measured across the 2.2 resistor (Channel 1). Channel 2 then shows the output of the op-amp to be about 2V peak. One must note that the output voltage will increase as the current is increased. The negative swing of the signal is eliminated due to the characteristics of the op-amp. This, however, will not affect calculations. To verify operation of the microcontroller, measured and calculated values within the prototype are compared to actual values, as shown in Table 11 below. Table 9. Verification of Microcontroller Operation Arduino Actual 41.712 43.8 Voltage (V) 0.123 0.241 Current (A) 2.561 5.2779 Power (W) .74 lag .739 lag PF The group understands that the values are far from matching at the time the report is being written. The accuracy of the device code is still in the process of being modified before the design is completely finalized.
19

Cost of the Project


The cost of this project can be divided into three different categories: device development, cost per produced unit, and labor. Table 12 demonstrates the cost for physical development of the product. The total for development is higher than that of a single unit due to extra costs accrued for intermediate testing and integration. Table 13 highlights the cost to produce a single unit. It is broken down into the cost of each basic component that will be used in the design plus extra products purchased and used for device development and testing. Table 14 shows the labor costs associated with development of the product. Labor costs are based on a $30/hour wage and hours worked per week are estimated based off of tasks to be completed (See Gantt Chart). Finally, Table 15 provides the total cost of the entire project, development and manufacturing of fifteen units.

Table 10. Development Budget Estimated Component Cost Microcontroller $90.00 Circuit Elements $15.00 LCD Screen $15.00 Case $6.50 Total $126.50 Table 12. Labor Costs Term Hours Cost Fall 180 $5,400.00 Spring 300 $9,000.00 Total 480 $14,400.00

Table 11.Cost Per Unit Estimated Component Cost Microcontroller $60.00 Circuit Elements $6.00 LCD Screen $15.00 Case $6.50 PCB Board $3.00 DC Adapter $10.00 Total $100.50 Table 13. Project Budget Labor $14,400.00 Parts/Development $1,634.00 Total Cost $16,034.00

20

Time Schedule
Appendix A contains the Gantt Chart demonstrating the time schedule for the entire project, as well as the individual tasks associated with completion of the project.

Conclusion
While the first part of this project mostly involved research and spending time in the requirements phase of the project, the second semester was primarily comprised of implementation and testing phases. As time moved on, the group encountered a mix of problems on a weekly basis. Whenever a problem arose, it was first discussed with the advisor, then carried out to other faculty and resources as needed. At this final juncture, the group considers the project mostly a success. The prototype implemented on the bread board communicates successfully with the microcontroller. The case is on its way to completion, and one PCB has been fully completed. The groups goal was to have one fully working prototype finished by the end of the semester, but many accuracy issues came about on a weekly basis. In light of the previous paragraph, the current issues facing the group lie mainly within the microcontroller. Several sources of inaccuracy could be involved, stemming from some of the following sources (but not limited to): Accuracy of measurement equipment in the lab. It is important to note that the oscilloscope displays voltages out to only two decimal places. To add, measuring exact resistor values at values in the k and above range is difficult for current equipment to remain consistent. The ADC of the microcontroller can only measure discrete values.
21

Sampling and storing peak values and peak times may have mismatches. Possible rounding of values affecting the final outcome. On top of current accuracy issues, the group acknowledges that future improvements

couldcertainly be added. One possible addition is using the microcontroller to detect resistances instead of hard-coding values. Along with this, reproducing the unit would be less tedious because hard-coding values is not required. However, constructing an ideal differential op-amp will still be required. To add to reproduction improvements, more efficient ways of permanently wiring components together could be addressed. Also, the group would like to see a plug-andplay style port to supply power to the unit, instead of a fixed, permanent cable. Finally, additional safety features may be added, such as a fuse in the return path from the load (in case the user connects a large voltage across both negative terminals). Overall, the group has gained sufficient knowledge in the engineering process, from obtaining customer requirements, to testing, to completing a design. It has been a successful year and the group is pleased to submit the design to the Engineering Department for further verification and ultimate use.

22

References
1. Arduino: Forum 2008.Arduino <http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1205745528> 2. Barett, J.T. How Does a Wattmeter Work? eHow.com <http://www.ehow.com/how-does_5030222_wattmeter-work.html> 3. Electric Power 2011. Wikipedia <http://en.wikipedia.org/wiki/Electric_power> 4. Grover, Sam Wattmeter Basics 2010. eHow.com <http://www.ehow.com/list_7505223_wattmeter-basics.html> 5. Kenneth, Joseph Digital Wattmeter 2008. <http://rjpaladin.multiply.com/journal/item/1> 6. Linear scale analog watt meter <http://kd1jv.qrpradio.com/lspwmtr/linear_analog_SWR_meter.HTM>

23

Appendix A: Gantt Chart

24

You might also like