1. Introduction
Our objective is to design an energy monitoring device that could measure the energy consumption of a household appliance then data logs that information. Our product will be plugged into the wall outlet while the household appliance will be plugged directly into our product. In order to have both power monitoring and data logging functionalities, our product will consist of two devices – one for power monitoring, which we call the "agent", and the other for data logging. Our data logging device is our base station and we've called it the "command center".
The power monitoring market is relatively large. Therefore, our product must have several key features to allow it to stay competitive. One of our features is maintaining a measurement accuracy of +/- 10%. Not only do we want our product to monitor the energy consumption of an appliance, but also the overall energy consumption of the entire household. Consequently, the command center is able to communicate with a minimum of 15 agents. Our product must also be aesthetically pleasing, safe, and durable.
Our original design to satisfy these specifications was to make the communication between the agent and the command center wireless. However, due to time constraints and limited budget we made a design decision to abandon this notion. Additionally, we wanted to limit the size of the agent and the command center in order to make our product compact. Nevertheless, our current design is still very much intact such that both the functionality and the efficiency meet the product specifications.
After reviewing the customer requirements and product requirements, we came up with the product specifications below. Note that we will refer to the display/interface of the product as the "command center" and the part that measures the outlet itself as the "agent".
As previously mentioned, the product has two separate parts which we called the agent and the command center. The agent is the device that measures the energy usage of the outlet it is connected to. You connect the agent into the outlet and then connect the electrical appliance you wish to measure to the top of the agent. The agent will then transmit the measured information to the command center at regular intervals. The command center will use the data sent by the agent to calculate the cost pet unit time of running that outlet at its current state. It will display this information to the user.
As shown from Figure 5, the AC input will be “conditioned” such that the voltage will be reduced. This allows the AC/DC Converter to convert the AC voltage into DC. The DC voltage can then power our current sensor to measure the current consumed by the appliance or the load. The voltage conditioner also allows the voltage sensor to easily measure the voltage. Next, we have to filter the output of the current sensor and the voltage senor because of noise within the system. The cutoff frequency is about 100Hz which is sufficient because the desired signal is only 60Hz.
With the two measurement values, the ADC then converts the analog data into digital information for the MSP430 to process. Lastly, a simple battery is needed to power the MSP430. These next subsections will provide our module definitions and the schematics used in these subsections are in reference to the overall schematic in Appendix A.
The 120Vrms electrical outlet connects to a current load (e.g. lamp, toaster, fan, etc), therefore the first step for us was to use the transformer shown above to transform the 120Vrms into a much lower voltage. This made the voltage much more controllable and easier to manipulate. The Tamura 3FD-212 transformer that we used reduced the voltage from 120Vrms to 8.63Vrms. The following table shows the electrical specification for the Tamura Transformer:
These specifications assume that the transformer is operating at a room temperature of 25°C. The most important specification shows that the input voltage is 115-230V 50-60Hz. This is a good match for our application because we are dealing with 120Vrms (170V at peak) at a frequency of 60Hz. This meant that we have to recalculate our output voltage, which is 8.27Vrms, for an input of 115Vrms. If the input voltage is 125Vrms, then the output voltage is 8.99Vrms or 12.71V, which is tolerable.
The ratio is 115V/6.3V which is equivalent to 18.25 turns. However, after testing this module it appears that the turn ratio was actually 13.91 which means that the transformer has a 24% tolerance. As shown from specification 4 of Figure 7, our transformer has a voltage regulation error of 24% from full load to no load. We expected that our transformer will not be 100% accurate thus we made the necessary changes on the other modules in our design to compensate for the error. Also this transformer has a safety precaution for the input by providing a 100MΩ insulation resistance.
Then we verified that the maximum power of 1.1W was not exceeded. Our secondary connection was neither connected in parallel nor in series as shown in Figure 7, but rather, the two coils were completely disconnected and sent to different parts of our circuit. Thus each secondary coil had 8.63Vrms AC (at 120VAC) at 0.090Arms. This meant that the total power will be: 8.63 Vrms * 0.090Arms = 0.776W, which is much smaller than the maximum allowed power. According to the specifications and our tests that we will later discuss, our transformer has proven to function properly.
Another key factor that contributed into our bridge rectifier decision was cost. We had the option to either implement a full wave rectifier or a half wave rectifier. A full wave rectifier could be implemented with a small capacitor (C1 in figure 8) for output smoothing, while the half wave rectifier requires a much larger capacitor. Due to the cost of capacitors, we decided to implement a full wave rectifier. For our rectifier, we decided to use four 1N4007 diodes connected in a bridge rectifier fashion. Our diodes were purchased from Fairchild Semiconductors and each of the diodes cost 5 cents. Instead of purchasing a rectifier, buying diodes proved to be a lot cheaper. Table 2 shows the specifications of these diodes.
The wall voltage will have to peak past 348V (13.91 * 25 Volts, 13.91 is the ratio of the transformer) in order to disrupt the capacitor, which is highly unlikely. We have determined that these capacitors will have the values 10uF and 330 uF. The 10 uF capacitor is connected between the bridge rectifier and the voltage regulator, while the 330 uF capacitor is connected at the output of the voltage regulator. We needed a much higher capacitor at the output of the voltage regulator because we wanted our current sensor to maintain an accuracy of +/- 10%.
After defining the stages of this module, we proceeded to test its functionality. From our tests, the output of the voltage regulator was at a constant value of 5V as desired.
The schematic showed us the pin assignment, where pins 4 and 5 are used to tap into the circuit, while pins 1, 2 and 3 are used for Vcc, Ground and Vout, respectively. The sensor taps into the wire from the wall outlet leading to the main load (our common household appliance).
From our product specifications, we have determined that the maximum current of the appliance, disregarding the current spikes, will be about 20A. The hall-effect sensor will use its unique ability of measuring the electromagnetic field around a wire to give us a relatively precise measurement of the current in the form of a voltage.
Figure 11 below shows the electrical specifications of this current sensor:
There are a couple of specifications that are of particular interest to us. The primary sensed current Ip is limited to +/- 50A, which satisfies one of our product specifications. Also the supply voltage is +5V DC, with a +/-0.5V minimum and maximum offset. We were able to meet this specification fairly easily because of our careful voltage regulation to give us +5V.
The supply current is typically 7mA, which will not pose any trouble for us because it is completely insignificant compared to our assumed load current of about 20A. The main specification however was the sensitivity of our sensor, which was typically 40mV/A. This meant that for each ampere, the current sensor’s Vout will increase by 40mV. This should be precise enough if the current is relatively large, but it may cause an error at a lower amperage value. The actual typical Total Output Error (Etot) of this chip is +/-1%, which is crucial in satisfying the accuracy specification.
Another important specification was the Zero Current Output Voltage, which was Vcc/2. This allowed us to predict how the output behavior of the sensor: at 0A input, the output was 2.5V and, for example, if the current changes to +/- 2Ap, then the output will change by +/- 80mVp. This meant that we needed to bring the voltage down to be able to bring it to ADC, which can only handle voltage values from 0V-2.5V. This will not be hard to do and should be done by creating a simple voltage divider using the same resistances to bring it down to half of its original voltage. Two 1KΩ resistors in series were enough to reduce the voltage by a half (refer to Appendix A to see the schematic). Since the Vout from the current sensor is going to range from 0V to 2.5V instead of from 0V to 5V, our ADC was able to process the measurement.
Referring back to the Figure 12, let’s take a look at how the voltage sensor was actually implemented. First, we have a 120Vrms AC 60Hz input from the wall, which goes through the transformer as described in the sections above. Then the 8.63Vrms is supplied by the transformer on the secondary coil, which has peak values of +/- 12.2V. First we wanted to reduce the input voltage to +/- 1V.
We determined these resistor values by using following equation:
From this equation we substituted the variables with the following values and solved for R2, as shown below.
The result for R2 is approximately 28 kOhms. Just using a voltage divider to make the wave smaller was not be enough because our ADC cannot read in negative values, thus +/- 1V is not sufficient enough for our voltage sensor. The best scenario would be to have an output voltage that has a 2V peak to peak ranging from 0.250mV to 2.250V. In order to do this, we applied the following formula:
5V is the input voltage which was from the output of the voltage regulator. Those are the required resistor values to apply a DC offset of approximately 1.25V. Instead of using a 3.75 kOhms resistor and a 1.25 kOhms resistor, we used a 3.74 kOhms resistor and a 1.24 kOhms resistor because these values can be easily purchased. The next section will explain the function of the capacitor.
First off, we know that our signal is 60 Hz because we are measuring from a wall outlet. Knowing that, we easily calculated the resistor value and the capacitor value using the following formula:
The value for R and C is 27 kOhms and 0.01uF respectively. The result is 589.4Hz which is approximately equal to 600Hz. We wanted our low pass filter to pass data under 600Hz because some household appliances have ridiculously high frequency. After applying this filter, the output of the current sensor became much more stable as expected. Next since we applied this low pass filter to our circuit, a phase shift occurred in the output of the current sensor. Thus, in order to compensate for this phase shift we also added a low pass filter to the output of the voltage sensor. For that low pass filter, we used a 28 kOhms resistor and a 0.3uF capacitor. The result is an 18.95Hz low pass filter.
Due to the fact that the current sensor has internal capacitance, we made the low pass filters different in the voltage sensor and the current sensor. Although we do not have any calculations to justify the difference in the low pass filters, we have conducted tests that prove that the low pass filter made the phase shift from both the voltage and the current sensor approximately the same. The tests will be discussed later. Now is time to discuss the module definitions of the digital part.
The A/D converter converted the analog signals from the current and voltage sensor into its binary representations. This is so that the software of the MSP430 can comprehend the signals that the two sensors produce and use it as data in its code.
The reason why it is necessary that we have this converter is because we want the user to interact with an embedded device with a clean interface consisting of buttons and an LCD display. We went with this embedded system route because we felt that such a system allows the product to look good and be easy to use, both of which are important customer requirements.
Since our product is supposed to measure power, we need to multiply the values obtained by the current and voltage sensors together to get the power. We decided to do this by software. All this means is that it is necessary to convert the sensor signals to digital so that the software of the embedded device can manipulate them. The software codes for this are on Appendix C.
To implement the A/D converter on the MSP430, we have to assign bit values for the controls registers that will be used to execute the conversion. The ADC12CTL0 control register were assigned bit values so that the A/D converter will do the following:
In addition to setting up the control registers, we also created an interrupt that will execute right after the completion of each sequence of conversions. After each sequence of conversion, the outputs get stored in ADC12MEM0 and ADC12MEM1 conversion-memory registers.
These memory locations are not easily accessible to the software module. To make them accessible, we created an interrupt that will take the values from these conversion-memory registers and put them in a global two element array (labeled results[2] in the snippet of code) so that they could be accessed by the software module.
Basically, after knowing that the segments are active low, we can assign the LCD[ ] memory locations that control the logical values of each segment certain bit values so that specific segments become active. From the code above, the LCD constants we defined act as these bit values.
Now that all the modules are defined, we will explain the results of our tests.
The purpose of this section is to explain the functionalities of our product and the specifications that were met. It is also crucial to explain the system testing and results for our product. We created a generic PCB version of our product four days ago and it passed the system integration test which we imposed on it two days ago. We tested our product with both a high current load and a low current load. The results were promising.
Currently, our product satisfies most of the product specifications. Our product is able to maintain accuracy within 10%, consume less than 1W, communicate with at least 15 agents, store at least 100 data points, display the measurements in cost per hour, and function under standard US electricity specifications. However, the specified sizes of the agent and the command center were not achievable within our given time frame. Both the agent and the command center are larger than expected which also hampers the appearance of our product. In addition, our cost surpassed the 50 dollar mark. Nevertheless, our device meets all the functionality specifications.
Lastly, our command center has an easy to use interface in which the user can scroll through the options and input the electricity rate in kilowatt-hour. The interface allows the user to choose what to display on the LCD such as the energy or the cost. The last feature of the command center is that it allows the user to save certain data points into FLASH memory. These data points will not be deleted when the device is turned off.
As shown from the above table, on average the percentage error of our product is 4.316%. However, our device has a larger error toward small energy consumption appliances than big energy consumption appliances. Our device is built for measuring larger energy consumption devices. If we eliminate the error from the fan, then the average becomes 2.546%. Thus, our product is able to maintain an accuracy of at least +/- 10% (refer to Appendix C to see how we achieved this). There results shows that both the agent and command center functions properly. Once we finished testing our product, we proceeded to do the cost analysis.
Once we identified our market size, we performed a cost analysis. The following table shows the cost for each component of the product. You can see that the total cost in parts to make the agent and the command center are 5.377 and 24.862 dollars respectively. Knowing that the command center costs significantly more than the agent and that a customer will only need to buy one command center and can choose to buy multiple agents, it is best at a marketing point of view that the command center is sold at no profit and that we should make our profit entirely on the sales of the agent.
Each customer would on average purchase 5 agents. Ideally, we would make 25 dollars in profit for every unit sold, meaning that we would make a profit of 5 dollars for each agent sold. The production and distribution cost would cost 25 dollars per unit, which means that it will cost 4.17 dollars to product an agent or a command center. The initial investment would be 200,000 dollars for a manufacturing space, a marketing and distribution office, and assembly machines. Thus, we decided to make the agent cost 15 dollars each, and the command center will cost 29 dollars. And finally, there would be 500 units sold per month, which is generous seeing that our market size is 50 million. The following figure shows the graph of our Return On Investment.
We expect a break-even point after 16 months, and our large market size promises that we will continue to get revenue. Therefore, we expect to make profit after the break-even point.
Another change we could have implemented if we had more time would be using a custom PCB. This would not only make our product a lot cheaper, but it will also reduce the size of the agent immensely. Currently, the size of our agent is larger than the size of our command center.
Next, we will build our own microcontroller board instead of using a development board. If we build our own microcontroller board, we would be able to use a larger size RAM so that we could add more features to the command center. Ultimately, all these changes would have reduced the overall cost of our product drastically and make it an extremely competitive product on the market.
Basically, we were faced with a problem and we had to solve it without an answer key. More so, our project stresses the importance of working as a team. Teamwork is essential for success. If we had not worked as a team, then our project would have definitely failed. There were many different approaches in solving this problem, but our approach or solution is both efficient and accurate. Ultimately, our project furthered our knowledge on the principles of engineering.
The power monitoring market is relatively large. Therefore, our product must have several key features to allow it to stay competitive. One of our features is maintaining a measurement accuracy of +/- 10%. Not only do we want our product to monitor the energy consumption of an appliance, but also the overall energy consumption of the entire household. Consequently, the command center is able to communicate with a minimum of 15 agents. Our product must also be aesthetically pleasing, safe, and durable.
Our original design to satisfy these specifications was to make the communication between the agent and the command center wireless. However, due to time constraints and limited budget we made a design decision to abandon this notion. Additionally, we wanted to limit the size of the agent and the command center in order to make our product compact. Nevertheless, our current design is still very much intact such that both the functionality and the efficiency meet the product specifications.
After reviewing the customer requirements and product requirements, we came up with the product specifications below. Note that we will refer to the display/interface of the product as the "command center" and the part that measures the outlet itself as the "agent".
2. Product Specification
- The agent must be able to measure the electricity cost with an accuracy of at least +/- 10%. A +/-10% accuracy should be sufficient because, in 2006 , the highest cost of electricity in a particular region in the US was 23.35 cents per kilowatt meaning that a %10 percent error is only a difference of 2.335 cents per kilowatt. Yes, the amount will accumulate over a good number of months but, as you will find out, we will be designing this product to measure the cost per hour.
- The agent must be able to function under standard US electricity specifications (i.e., 120VAC and 60Hz). Our current market is the US. Before we begin to expand to other parts of the globe, we will first try to focus on succeeding in the US.
- The maximum current the agent can measure without incurring damage should at most be 60 amps. This is because out of all common appliances, the one that requires the most current only uses 16.67 amps. With consideration to electrical spikes, we decided that the maximum measurable current should double that. Hence, we went with 60 amps.
- The minimum distance between the command center and the agent must be one meter. This is to give the user easy access to the display and interface of the product.
- The user must be able to input the electricity rate in kilowatt-hour. This is because the cost of electricity differs from region to region, and company to company. To maximize our market size, it is necessary for the product to be relevant at different parts of the US.
- The product must be able to display the measurements in cost per hour. The reason why we chose “per hour” as our minimum is because, from our market research, customers found that anything higher than that, such as “per year”, is not helpful in monitoring their energy usage.
- The product must be able to store at least 100 data points. It is essential for our product to be able to data log the information. This allows the user to save money by using the stored information as a reference.
- The command center must be able to communicate with at least 15 agents. The reason why we chose 15 agents is because the average household has 15 outlets. We want the user to be able to monitor every outlet in his or her house. Since the average household has 15 outlets, it makes sense that the command center should be able to handle at least 15 agents.
- The size of the command center must be no bigger than 20cm x 20cm X 20cm and the weight should be no heavier than three kilograms. Although the command center is intended to remain in a fixed place in a household, we still want the user to be able to move it around.
- The size of the agent must be no bigger than 40mm x 40mm x 60mm and the weight must be no heavier than one kilogram. This agent size is only slightly bigger than the standard connector cord size of 23.9mm x 22.3mm, therefore the agent should be able to fit into cramped spaces and not block neighboring outlets. The weight of the agent does not really matter since the agent does not need to be moved around that much. However, it should be light enough so that you can move it around when you need to.
- The command center and each agent must not consume more than 1 watt. This is because the purpose of the product is to reduce electricity costs. Hence, the cost of running the product should not be more than running a low energy appliance such as a night light, which requires only 1 watt.
- The product should last at least twenty years. The user should not have to replace the product. It does not make sense to force the user to buy the product repeatedly in order to reduce his or her electricity costs.
- The total cost of parts to make a command center and an agent should be no more than 50 dollars. Not only is this to satisfy our budget of 50 dollars, but it is to ensure that we can tap our entire target market - from the middle class households to the working class ones.
- The product should be aesthetically pleasing. The command center should look slick since it would commonly be placed in a conspicuous place. The agent, on the other hand, will most likely be behind the entertainment unit, under the table, or some other hidden place, therefore it does not need to look as nice as the command center.
- The product should be safe. Safety is a high priority since this product will be used in households, some with children. Measuring AC power is also really dangerous.
- Some of these criteria does not apply to some of the modules. In order to satisfy the above requirements, we drew an artist rendition of our product as shown on the following figure.
Figure 4: Artist Rendition
3. Design Approach
For the majority of this section, we will provide an explanation of the inputs, functionality, implementation, and outputs of each module represented in our block diagram in Figure 5.
Figure 5: System Block Diagram
As shown from Figure 5, the AC input will be “conditioned” such that the voltage will be reduced. This allows the AC/DC Converter to convert the AC voltage into DC. The DC voltage can then power our current sensor to measure the current consumed by the appliance or the load. The voltage conditioner also allows the voltage sensor to easily measure the voltage. Next, we have to filter the output of the current sensor and the voltage senor because of noise within the system. The cutoff frequency is about 100Hz which is sufficient because the desired signal is only 60Hz.
With the two measurement values, the ADC then converts the analog data into digital information for the MSP430 to process. Lastly, a simple battery is needed to power the MSP430. These next subsections will provide our module definitions and the schematics used in these subsections are in reference to the overall schematic in Appendix A.
6.1 Voltage Conditioner
The voltage conditioner was implemented to reduce the high 120Vrms voltage (which is an AC voltage that has a peak of 170V) coming from the electrical outlet to 12.2Vrms. The original 120 Vrms is not ideal for circuitry containing low power components. We had to use low power components in our design because they are inexpensive compared to their high power counterparts. Furthermore, by voltage conditioning to a lower Vrms, our product would be safer for the user.6.1.1 Voltage Transformer
The figure below shows the transformer that we used in our voltage conditioner.
Figure 6: Tamura 3FD-212 Transformer
Figure 7: Electrical Specifications for Tamura Transformer
The ratio is 115V/6.3V which is equivalent to 18.25 turns. However, after testing this module it appears that the turn ratio was actually 13.91 which means that the transformer has a 24% tolerance. As shown from specification 4 of Figure 7, our transformer has a voltage regulation error of 24% from full load to no load. We expected that our transformer will not be 100% accurate thus we made the necessary changes on the other modules in our design to compensate for the error. Also this transformer has a safety precaution for the input by providing a 100MΩ insulation resistance.
Then we verified that the maximum power of 1.1W was not exceeded. Our secondary connection was neither connected in parallel nor in series as shown in Figure 7, but rather, the two coils were completely disconnected and sent to different parts of our circuit. Thus each secondary coil had 8.63Vrms AC (at 120VAC) at 0.090Arms. This meant that the total power will be: 8.63 Vrms * 0.090Arms = 0.776W, which is much smaller than the maximum allowed power. According to the specifications and our tests that we will later discuss, our transformer has proven to function properly.
6.2 AC to DC Converter
The alternating current to direct current converter is composed of two parts: the bridge rectifier and the voltage regulator as shown on Figure 8. The purpose of including this module is to supply the hall-effect current sensor with power and to offset the input sine signal for the voltage sensor which only accepts positive input values.
Figure 8: Schematics of the AC to DC Converter
6.2.1 Bridge Rectifier
In order to create a 5V supply for the hall-effect current sensor, we converted the 12.2V AC voltage into 12.2V DC voltage. AC voltages vary as a sine wave over time and are composed of negative values, therefore we have to convert the negative values into positive values. The bridge rectifier will invert the negative values. From our research, the voltage from wall outlets range from 115V to 125V. But due to other issues, voltage could also soar up to 130V. This meant that our bridge rectifier must be able to withstand a peak voltage of 9.35Vrms or 13.22V, or even higher.Another key factor that contributed into our bridge rectifier decision was cost. We had the option to either implement a full wave rectifier or a half wave rectifier. A full wave rectifier could be implemented with a small capacitor (C1 in figure 8) for output smoothing, while the half wave rectifier requires a much larger capacitor. Due to the cost of capacitors, we decided to implement a full wave rectifier. For our rectifier, we decided to use four 1N4007 diodes connected in a bridge rectifier fashion. Our diodes were purchased from Fairchild Semiconductors and each of the diodes cost 5 cents. Instead of purchasing a rectifier, buying diodes proved to be a lot cheaper. Table 2 shows the specifications of these diodes.
Table 2: Specifications of Rectifier Bridge
Peak Repetitive Reverse Voltage | 1000 Volts |
Operating Temperature | -55 to +175 C |
Power Dissipation | 3.0 Watts |
Maximum Reverse Current | 5.0 uA in 25 C; 50.0 uA in 100 C |
Forward Current | 1.0A |
Forward Voltage @ 1.0 A | 1.1V |
6.2.2 Filter Capacitor
There are two filter capacitors in this module - one for creating a ripple and the other for cancelling out noise. The capacitor also must be able to withstand 10.07V since that is close to the maximum voltage that will enter the capacitor. Due to the fact that there might be some outrageously high voltages, we decided to purchase the capacitor from Sparkfun for 45 cents. This capacitor is able to perform under 25V which should be able to satisfy the random voltage spikes of the wall outlet.The wall voltage will have to peak past 348V (13.91 * 25 Volts, 13.91 is the ratio of the transformer) in order to disrupt the capacitor, which is highly unlikely. We have determined that these capacitors will have the values 10uF and 330 uF. The 10 uF capacitor is connected between the bridge rectifier and the voltage regulator, while the 330 uF capacitor is connected at the output of the voltage regulator. We needed a much higher capacitor at the output of the voltage regulator because we wanted our current sensor to maintain an accuracy of +/- 10%.
6.2.3 Voltage Regulator
Due to the fact that the voltage from the wall outlet may provide extremely high voltage peaks, we implemented a voltage regulator to stabilize the voltage at 5V DC. After bridge rectifying and output smoothing, we get a voltage of 12.2V DC. However, we need 5V DC as the supply for the hall-effect current sensor. Also, the voltage from the electrical outlet can have extremely high voltage peaks which meant that the 12.2V DC may not be stable. A voltage regulator with the unstable 12.2V DC input was added to provide a constant 5V DC voltage. The LM7805 was the chosen voltage regulator. Typically the voltage input of this regulator is between 9V and 24V DC, but the maximum input is 35V. According to its specifications sheet, the LM7805 has an output voltage of 4.8 to 5.2V but typically the output is 5.0V, which was highly desirable. Table 3 shows the specifications of this 59 cent voltage regulator from Fairchild Semiconductors. However, according to the Iguana Lab, the input supply line may be quite noisy. In order to resolve this issue we added a noise canceling capacitor (C2 in figure 8). This ensured that the input voltage to the current sensor will be as accurate as possible.
Table 3: Specifications of the LM7805
Output Voltage Range: | 4.8 – 5.2 Volts, on average 5.0 Volts |
Ripple Rejection: | 120 Hz |
Peak Current: | 2.2 Amps |
Maximum input Voltage: | 35 Volts |
Operating Temperature Range: | 0 – 125 C |
Output Noise Voltage: | 42 uVolts per 1 Volt output |
After defining the stages of this module, we proceeded to test its functionality. From our tests, the output of the voltage regulator was at a constant value of 5V as desired.
6.3 Current Sensor
The hall-effect current sensor was one of the simpler parts in our circuit because we purchased a “ready-made” chip ACS752 that can measure current. It outputs an analog voltage signal in the form of a voltage sine wave proportional to the current sine wave being measured. Figure 9 below shows the physical appearance of our current sensor:
Figure 9: ACS752 Current Sensor
6.3.1 Current Sensor Allegro ACS752
The following figure shows the schematic provided by the Allegro ACS752 datasheet of the internal structure of the chip.
Figure 10: ACS752 Current Sensor Internal Schematic
From our product specifications, we have determined that the maximum current of the appliance, disregarding the current spikes, will be about 20A. The hall-effect sensor will use its unique ability of measuring the electromagnetic field around a wire to give us a relatively precise measurement of the current in the form of a voltage.
Figure 11 below shows the electrical specifications of this current sensor:
Figure 11: Electrical Specifications of ACS752
There are a couple of specifications that are of particular interest to us. The primary sensed current Ip is limited to +/- 50A, which satisfies one of our product specifications. Also the supply voltage is +5V DC, with a +/-0.5V minimum and maximum offset. We were able to meet this specification fairly easily because of our careful voltage regulation to give us +5V.
The supply current is typically 7mA, which will not pose any trouble for us because it is completely insignificant compared to our assumed load current of about 20A. The main specification however was the sensitivity of our sensor, which was typically 40mV/A. This meant that for each ampere, the current sensor’s Vout will increase by 40mV. This should be precise enough if the current is relatively large, but it may cause an error at a lower amperage value. The actual typical Total Output Error (Etot) of this chip is +/-1%, which is crucial in satisfying the accuracy specification.
Another important specification was the Zero Current Output Voltage, which was Vcc/2. This allowed us to predict how the output behavior of the sensor: at 0A input, the output was 2.5V and, for example, if the current changes to +/- 2Ap, then the output will change by +/- 80mVp. This meant that we needed to bring the voltage down to be able to bring it to ADC, which can only handle voltage values from 0V-2.5V. This will not be hard to do and should be done by creating a simple voltage divider using the same resistances to bring it down to half of its original voltage. Two 1KΩ resistors in series were enough to reduce the voltage by a half (refer to Appendix A to see the schematic). Since the Vout from the current sensor is going to range from 0V to 2.5V instead of from 0V to 5V, our ADC was able to process the measurement.
6.4 Voltage Sensor
Our voltage sensor consisted of only one type of components: resistors. There were a few different design options involving op-amps, but what seems to be the simpler and most efficient method was using resistors. The schematic of the voltage sensor is shown on the figure below. However, ignore the capacitor for now as it will be explained in the following subsection.
Figure 12: Schematic of Voltage Sensor
6.4.1 Series Resistors
The main purpose of the voltage sensor is to provide the information about the phase shift between the voltage curve and the current curve. The actual voltage could have been estimated to be around 120Vrms and we would still be within 5% of the actual value, but we would have to recalculated the VA value of the appliance instead of the actual average power, which includes a phase shift in its formula: P = V*I*cos(φ). The φ value could be as large as 60° in an average appliance. Also, because we used a voltage sensor, we should be more precise instead of just estimating the Vrms to be 120V.Referring back to the Figure 12, let’s take a look at how the voltage sensor was actually implemented. First, we have a 120Vrms AC 60Hz input from the wall, which goes through the transformer as described in the sections above. Then the 8.63Vrms is supplied by the transformer on the secondary coil, which has peak values of +/- 12.2V. First we wanted to reduce the input voltage to +/- 1V.
We determined these resistor values by using following equation:
Vout=Vin*R1/(R1+R2)
Vout=±12.1V*(2.5kΩ )/(R2+2.5kΩ )=±1V
Vout=5V*(1.25kΩ )/(3.75kΩ+1.25kΩ )=1.25V
6.5 Low Pass Filter
Since the power supply has a frequency of 60Hz, we needed to apply a low pass filter that is capable of passing the signal and eliminating any high frequency noise. Figure 13 shows the schematic of the low pass filter.
Figure 13: Schematic of Low Pass Filter
60 Hz<1/(2*pi*R*C)
The value for R and C is 27 kOhms and 0.01uF respectively. The result is 589.4Hz which is approximately equal to 600Hz. We wanted our low pass filter to pass data under 600Hz because some household appliances have ridiculously high frequency. After applying this filter, the output of the current sensor became much more stable as expected. Next since we applied this low pass filter to our circuit, a phase shift occurred in the output of the current sensor. Thus, in order to compensate for this phase shift we also added a low pass filter to the output of the voltage sensor. For that low pass filter, we used a 28 kOhms resistor and a 0.3uF capacitor. The result is an 18.95Hz low pass filter.
Due to the fact that the current sensor has internal capacitance, we made the low pass filters different in the voltage sensor and the current sensor. Although we do not have any calculations to justify the difference in the low pass filters, we have conducted tests that prove that the low pass filter made the phase shift from both the voltage and the current sensor approximately the same. The tests will be discussed later. Now is time to discuss the module definitions of the digital part.
6.6 Analog-to-Digital Converter
The A/D converter converted the analog signals from the current and voltage sensor into its binary representations. This is so that the software of the MSP430 can comprehend the signals that the two sensors produce and use it as data in its code.
The reason why it is necessary that we have this converter is because we want the user to interact with an embedded device with a clean interface consisting of buttons and an LCD display. We went with this embedded system route because we felt that such a system allows the product to look good and be easy to use, both of which are important customer requirements.
Since our product is supposed to measure power, we need to multiply the values obtained by the current and voltage sensors together to get the power. We decided to do this by software. All this means is that it is necessary to convert the sensor signals to digital so that the software of the embedded device can manipulate them. The software codes for this are on Appendix C.
6.6.1 Module Inputs
The inputs are analog signals from the voltage sensor module and the current sensor module. The signals will approximately be 60Hz sine waves ranging from 0V to 2.5V. Thus the full scale range is 2.5V and since this module will be a 12 bit A/D converter, the resolution of the module is,
resolution=(full scale range)/2^nbits =2.5V/2^12 =0.61mV
6.6.2 Module Schematics & Operations
The pins that we will use as inputs in the MSP430 are P6.0 and P6.1 which, on the Olimex board that we will be using, are accessed by connecting the inputs to pin A0 and A1 respectively as circled in Figure 14.
Figure 14: Olimex MSP430F449 board
- Use 2.5V as the reference generator voltage V+ref so that the full scale range of the input of this module will be 2.5V.
- Make it so that the sampling timer interval is only 4 ADC12CLK cycles so as to maximize the sampling frequency (or at least get it above the Nyquist frequency). The reason why we want to maximize the sampling frequency is because we want to avoid aliasing. We want to be able to sample and convert as many points in a single input wave as possible. Hence it is necessary to have a high enough sampling frequency.
- Use ADC12OSC as the clock source for the conversion and use a clock division of 1. This 5MHz clock source was selected because of its very high frequency compared to the 60Hz input signal. This combined with a clock division of 1 will maximize our sampling frequency.
- Configure the A/D converter to do sequence-of-channels conversions. This is because there are two input channels, hence it is necessary to use sequence conversions to convert the two inputs.
- Start the conversion at ADC12MEM0 conversion-memory register and end it at ADC12MEM1. These are the two conversion-memory registers that corresponds to each input.
These memory locations are not easily accessible to the software module. To make them accessible, we created an interrupt that will take the values from these conversion-memory registers and put them in a global two element array (labeled results[2] in the snippet of code) so that they could be accessed by the software module.
6.6.3 Module Outputs
The two outputs are 12-bit representations of the input signals. The module will output to a two element array of type long. It is up to the software module to use those values before the next conversion process replaces what is currently inside the arrays with new values. With the control registers configured as above, the conversion time period (i.e. the time between each sequence of conversions) equals,
((1⁄(the frequency of the selected sampling timer)) × the selected sampling timer interval) / (the selected clock divider)
= ((1⁄ADC12OSC)×SHT0) / ADC120 = ((1⁄50MHz)×4)/1 = 0.08ms
6.7 Interface - LCD Display and Buttons
As mentioned in the previous section, we want our product to have a clean interface consisting of an LCD display and four buttons. The Olimex board we are using already has these so it will not be an added expense. Both of these will be implemented by software – control registers will be assigned appropriate bit values and pins must be logically configured.6.7.1 Module Input – LCD Display
The software function that controls what gets displayed in the LCD will have two parameters: one of type int and the other of type char.6.7.2 Module Operation – LCD Display
In order to use the LCD, we must initialize the system meaning that the control registers for the LCD must be initialized (refer to Appendix C). As mentioned, the inputs of the LCD display module are two data parameters. The first parameter of type char will be used to determine what character gets displayed. The second parameter of type int will be used to determine the position of the displayed character.Basically, after knowing that the segments are active low, we can assign the LCD[ ] memory locations that control the logical values of each segment certain bit values so that specific segments become active. From the code above, the LCD constants we defined act as these bit values.
6.7.3 Module Ouputs – LCD Display
The output of this module is obviously the LCD segments being active, specifically certain pins of the LCD display segments being active low.6.7.4 Module Input – Buttons
There are four buttons available on the Olimex board that we will be using. As you can see in Figure 15, the pins B1-B4 are initially at logic high. When a button is pressed, the corresponding pin gets connected to ground and hence become logic low. Hence the buttons are active low.
Figure 15: Input Buttons
6.7.5 Module Operation – Buttons
The user will use the buttons to interact with the software of the embedded system. This means that we need to create a function that assigns the variable num a value that corresponds to the button being pressed. The pins for the buttons are P3.7-4, hence these are the pins we configured in the code. Depending on what button gets pressed, the variable num is assigned a certain value which will result to the myButton variable being assigned some other particular value; for example, if button P3.7 is pressed, num equals 1000XXXX (where X denotes either 0 or 1), and since the 1 in the top nibble of num is in position 7, then myButton equals to 4.6.7.6 Module Output – Buttons
The remaining software of the embedded device can therefore use the value of myButton, which is of type unsigned char, as a means to control the flow of the program. For example, a function in the program may be designed so that it is only called if myButton = ‘4’, which means that the user must press button P3.7 to call that function.Now that all the modules are defined, we will explain the results of our tests.
7. Product Results
On the left is the prototype without the casing. It is currently measuring the energy usage of a toaster.The purpose of this section is to explain the functionalities of our product and the specifications that were met. It is also crucial to explain the system testing and results for our product. We created a generic PCB version of our product four days ago and it passed the system integration test which we imposed on it two days ago. We tested our product with both a high current load and a low current load. The results were promising.
7.1 Product Functionality
The functionality of our product, the EMD, is to monitor the power consumption of common household appliances. It also has to be able to data log the information for future reference. Our device is divided into two parts – one for monitoring power, the agent, and the other for data logging, the command center. We want businesses, schools and households to use our product to give them a better understanding of energy usage. Consequently, with this knowledge, people can save money and preserve the environment.Currently, our product satisfies most of the product specifications. Our product is able to maintain accuracy within 10%, consume less than 1W, communicate with at least 15 agents, store at least 100 data points, display the measurements in cost per hour, and function under standard US electricity specifications. However, the specified sizes of the agent and the command center were not achievable within our given time frame. Both the agent and the command center are larger than expected which also hampers the appearance of our product. In addition, our cost surpassed the 50 dollar mark. Nevertheless, our device meets all the functionality specifications.
Lastly, our command center has an easy to use interface in which the user can scroll through the options and input the electricity rate in kilowatt-hour. The interface allows the user to choose what to display on the LCD such as the energy or the cost. The last feature of the command center is that it allows the user to save certain data points into FLASH memory. These data points will not be deleted when the device is turned off.
7.2 System Testing and Results
In order to test our product, we measured the energy consumption of certain household appliances. Then we compared our results with the results from National Grid’s industry grade power meter which has an accuracy of approximately +/- 0.02%. This means that if the measurements of our product are remotely close to the measurements of National Grid’s, then our product is accurate. The household appliances that we picked to test includes a toaster, a hair dryer, a fan and a coffee pot. We wanted to test appliances that range from little energy consumption to huge energy consumption. The following table illustrates the results of this test.
Table 4: Testing Results
National Grid’s | EMD | % error | ||
Toaster(setting = 1) | 801 | 776 | 3.141 | |
Toaster(setting = 2) | 1011 | 984 | 2.691 | |
Toaster(setting = 3) | 1210 | 1180 | 2.499 | |
Toaster(setting = 4) | 1430 | 1400 | 2.118 | |
Toaster(setting = 5) | 1621 | 1598 | 1.439 | |
Fan(Low) | 18 | 16 | 11.131 | |
Fan(Med) | 32 | 29 | 9.395 | |
Fan(High) | 48 | 44 | 8.353 | |
Hair Dryer(Low) | 1020 | 985 | 3.45 | |
Hair Dryer(Med) | 1341 | 1311 | 2.257 | |
Hair Dryer(High) | 1640 | 1620 | 1.240 | |
Coffee Pot | 197 | 189 | 4.081 | |
4.316 | Average Error |
8. Cost Analysis
In order to perform a cost analysis we first had to identify our market size. This product’s main target market is households in the US. There are about 100 million households in the US. Now assuming that only middleclass people whose income is over $40,000 are interested in this product, our market size will be reduced to about 50 million. This illustrates the scale of our market.Once we identified our market size, we performed a cost analysis. The following table shows the cost for each component of the product. You can see that the total cost in parts to make the agent and the command center are 5.377 and 24.862 dollars respectively. Knowing that the command center costs significantly more than the agent and that a customer will only need to buy one command center and can choose to buy multiple agents, it is best at a marketing point of view that the command center is sold at no profit and that we should make our profit entirely on the sales of the agent.
Table 5: Cost Analysis
Figure 16: ROI Graph
9. Recommendations
The best feature we could add to our product would be to add wireless communication so that our product would be more convenient and more aesthetically pleasing. In order to implement wireless communication, we will use a PIC processor to multiply the current signal and the voltage signal to get a single power signal. Using only one signal, we could easily transmit it wirelessly using a wireless transmitter and receive it using a wireless receiver.Another change we could have implemented if we had more time would be using a custom PCB. This would not only make our product a lot cheaper, but it will also reduce the size of the agent immensely. Currently, the size of our agent is larger than the size of our command center.
Next, we will build our own microcontroller board instead of using a development board. If we build our own microcontroller board, we would be able to use a larger size RAM so that we could add more features to the command center. Ultimately, all these changes would have reduced the overall cost of our product drastically and make it an extremely competitive product on the market.
10. Conclusion
Overall, our product has tested positive for the tests that we imposed. This design process gave us a better understanding of the difficulties that an engineer could face. Our project was more focused on the design process than the actual design itself. This allowed us to learn about the principles in marketing a product, researching the specifications, identifying the need, comparing against our competitors, and designing a product for test and for manufacturability.Basically, we were faced with a problem and we had to solve it without an answer key. More so, our project stresses the importance of working as a team. Teamwork is essential for success. If we had not worked as a team, then our project would have definitely failed. There were many different approaches in solving this problem, but our approach or solution is both efficient and accurate. Ultimately, our project furthered our knowledge on the principles of engineering.
This article was first published in 2007.
Comments
Post a Comment