0 évaluation0% ont trouvé ce document utile (0 vote)
95 vues49 pages
This document is a thesis submitted for the degree of Bachelor of Technology in Electrical and Electronics Engineering. It discusses measuring power consumption using an Arduino microcontroller. The thesis presents background on power measurement, describes the hardware and software components of the Arduino power measurement system, including the Arduino board itself, a data conditioning circuit, regulated power supply, and load circuit. Simulation and experimental results are shown for measuring power drawn by one, two, and three loads connected to the system. The thesis concludes that the Arduino provides an accurate and economic method for power measurement.
This document is a thesis submitted for the degree of Bachelor of Technology in Electrical and Electronics Engineering. It discusses measuring power consumption using an Arduino microcontroller. The thesis presents background on power measurement, describes the hardware and software components of the Arduino power measurement system, including the Arduino board itself, a data conditioning circuit, regulated power supply, and load circuit. Simulation and experimental results are shown for measuring power drawn by one, two, and three loads connected to the system. The thesis concludes that the Arduino provides an accurate and economic method for power measurement.
This document is a thesis submitted for the degree of Bachelor of Technology in Electrical and Electronics Engineering. It discusses measuring power consumption using an Arduino microcontroller. The thesis presents background on power measurement, describes the hardware and software components of the Arduino power measurement system, including the Arduino board itself, a data conditioning circuit, regulated power supply, and load circuit. Simulation and experimental results are shown for measuring power drawn by one, two, and three loads connected to the system. The thesis concludes that the Arduino provides an accurate and economic method for power measurement.
2012-2013 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING & TECHNOLOGY BACHUPALLY, HYDERABAD 500090
2012-2013
GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING & TECHNOLOGY
Hyderabad, Andhra Pradesh.
DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING
C E R T I F I C A T E
This is to certify that the project report entitled ARDUINO POWER MEASUREMENT that is being submitted by Ms. T.PadmaPriyanka, Ms. T.Prasanthi, Ms. D.Sujana, Ms. ZebaTanveer in partial fulfilment for the award of the Degree of Bachelor of Technology in Electrical and Electronics Engineering to the Jawaharlal Nehru Technological University as a record of bonafide work carried out by them under my supervision. The results embodied in this project report have not been submitted to any other University or Institute for the award of any graduation degree.
H.O.D Internal Guide
(P.M.SARMA) (P.SRIVIDYADEVI) Professor Assistant Professor
External Examiner
ACKNOWLEDGEMENT
This is to place on record our appreciation and deep gratitude to the persons without whose support this project would never see the light of day.
We wish to express our propound sense of gratitude to Mr. P. S. Raju, Director, G.R.I.E.T for his guidance, encouragement, and for all facilities to complete this project.
We also express our sincere thanks to Mr. P. M. Sarma, Head of the Department, Electrical and Electronics Engineering, G.R.I.E.T for extending his help.
We have immense pleasure in expressing our thanks and deep sense of gratitude to our guide Ms. P. SriVidyaDevi, Assistant Professor, Department of Electrical and Electronics Engineering, G.R.I.E.T for her guidance throughout this project.
We express our gratitude to Mr. E. Venkateshwarlu, Associate Professor, Department of Electrical and Electronics Engineering, Coordinator, G.R.I.E.T for his valuable recommendations and for accepting this project report.
Finally we express our sincere gratitude to all the members of faculty and our friends who contributed their valuable advice and helped to complete the project successfully.
The main objective of this study Arduino Power Measurement aims to measure power consumption with higher resolution. The goal of providing such data to a user is that they will optimise and reduce their power usage as poor power quality causes trouble in receptable equipment malfunctions. The demand for power has increased exponentially over the last century. One avenue through which todays energy problems can be addressed is through the reduction of energy usage in households. This has increased the emphasis on the need for accurate and economic methods of power measurement. The goal of providing such data is to optimize and reduce their power consumption. In this project various power measurement methods are described briefly and the cutting edge of Arduino power measurement is then discussed along with a detailed description of Arduino Power measurement. Some of the theory, hardware and software associated with this project are given. The importance, role of Arduino is discussed. The current and voltage signals from the load are stepped down and offseted before they are given to the Arduino. Load circuit, Offset circuit and their construction and functionality in the project are discussed. Power is rate of expending energy. For DC circuits and purely resistive AC circuits, power is product of voltage and current. For reactive AC circuits the product of r.m.s values of voltage and current is termed as apparent power (VA). Arduino is an open-source single board microcontroller, descendant of the open- source wiring platform designed to make the process of using electronics in multidisciplinary projects Arduino Sketch is programmed accordingly to give the average power consumed by the load. Using Processing and Megunolink softwares the output power is displayed graphically for better readability.
i
CONTENTS Abstract Contents.i List of figures.....iv CHAPTER 1: INTRODUCTION 1.1 Introduction..1 1.2 Project overview...2 1.3 Organisation of thesis.......2
CHAPTER 2: POWER AND ARDUINO POWER MEASUREMENT 2.1 Power..4 2.1.1 DC circuits....4 2.1.2 AC circuits....5 2.2 Components of power.5 2.2.1 Average power...5 2.2.2 Instantaneous power.......5 2.3 Power factor.6 2.4 Power measurement....6 2.4.1 Using various measuring equipments.................6 2.4.2 Power measurement using software........9 ii
CHAPTER 4: SIMULATION RESULT 4.1 Single load.................27 4.2 Two loads......29
4.3 Three loads..31 4.4 Varying loads...............33 CHAPTER 5: CONCLUSION 5.1 Conclusion..............34 5.2 Scope for work........34 References Appendix-A Appendix-B
iv
LIST OF FIGURES Fig. No Name of the Figure Page. No. 2.4(a) DC power measurement using ammeter and voltmeter 7 2.4(b) Electrodynamometer wattmeter 8 2.4(c) Digital wattmeter 8 2.4(d) Power triangle 9 2.4(e) Simulation circuit of 2-wattmeter method power measurement 10 3.1.1(a) Arduino 15 3.1.1(b) Arduino sketch 17 3.1.2 Processing sketch 20 3.1.3 Megunolink plot 21 3.2.1(a) Block Diagram of Arduino Power Measurement 22 3.2.2(a) Simulation circuit of data conditioning card in multisim 22 3.2.2(b) Simulation results of offset cards in multisim 23 3.2.2(c) Offset card hardware 23 3.2.3(a) Regulated DC supply circuit 24 3.2.3(b) Simulation result of regulated DC supply in multisim 25 3.2.3(c) Regulated DC supply hardware 25 3.2.4(a) Load circuit 26 3.2.4(b) Load circuit hardware 26 4.1(a) Serial monitor values for single load in Arduino 27 4.1(b) Megunolink plotting for single load 28 4.1(c) Graph for single load in Processing sketch 28 v
4.2(a) Serial monitor values for two loads in Arduino 29 4.2(b) Megunolink plotting for two loads 30 4.2(c) Graph for two loads in Processing sketch 30 4.3(a) Serial monitor values for three loads in Arduino 31 4.3(b) Megunolink plotting for three loads 32 4.3(c) Graph for three loads in Processing sketch 32 4.4(a) Megunolink plotting for varying loads 33 4.4(b) Graph for varying loads in Processing sketch 33
1
CHAPTER 1 Introduction
1.1 Introduction Power is rate at which electric energy is transferred by an electric circuit. Power is a important electrical quantity and everything in our world today depends on having the power to keep them running. It is necessary to measure the amount of electric power a power plant generates and a customer uses over a period of time. It helps in estimation of transmission losses between the generation- distribution and distribution-consumer apparatus. This estimation helps in power theft detection and to reduce the transmission losses. Measurement of electrical power may be done to measure electrical parameters of a system. In the existing power utility set up, consumers are presented with usage information only once a month with their bill. The length of time between updates about power usage is far too long for a consumer to observe a changed behaviours effect on power usage. In addition utility bills can be convoluted in how they present usage information, and a consumer may not be able to decipher changes in their power usage from the last bill. An opportunity to educate customers on power usage is lost because of these realities. If a person can know how much power is consumed, they may be more careful in the future about letting devices run when not needed. The goal of creating more awareness about energy consumption would be optimization and reduction in energy usage by the user. This would reduce their energy costs, as well as conserve energy.
The project Arduino Power Measurement, aims to determine power consumption and to display it graphically. The goal of providing such data to a user is that they will optimize and reduce their power usage. The arduino based power measurement aims to measure power consumption with higher resolution and consumes lesser power. 2
1.2 Overview: In the project Arduino Power Measurement, power consumed by the load is measure by using programming Arduino sketch. The load circuit comprises of resistive loads. The current flowing through the load circuit and the voltage across the load circuit are stepped down by using instrument transformers. These voltage and current signals are negative offsetted using data conditioning card and are then given to Arduino board. Power measurement is done by programming Arduino sketch. Power is rate of doing work. For DC circuits and purely resistive AC circuits, power is product of voltage and current. For reactive AC circuits the product of r.m.s values of voltage and current is termed as apparent power (VA). Arduino is an open-source single board microcontroller, descendant of the open- source wiring platform designed to make the process of using electronics in multidisciplinary projects. It is an electronics prototyping platform based on flexible and easy to use hardware cum software. Arduino uno, a microcontroller board based on the ATmega328 is used in this project. The power digitally measured using Arduino is displayed graphically by using Processing and MegunoLink softwares. 1.3 Organisation of thesis Chapter 1 presents introduction part and also a brief overview of the project. Chapter 2 presents the basic fundamentals of power, components of power, power factor, power measurement and also different types of power measurement. Chapter 3 deals with the hardware and software part of the project Arduino Power measurement. This hardware part consists of offset cards, regulated dc supply, load circuit and arduino hardware. The software part consists of programming parts of Arduino, Processing and Megunolink softwares 3
. Chapter 4 shows the simulation results of three loads using Arduino, Processing and Megunolink softwares and also simulation results for varying loads are shown using Processing and Megunolink softwares. Chapter 5 address the conclusion of the project and scope for work, which describes the different methods to extend the project in future.
4
CHAPTER 2 Power and Power Measurement
2.1 Power Power is rate of expending energy. The unit of power is Watt (joule per second (J/s)). For DC circuits and purely resistive AC circuits, power is product of voltage and current. For reactive AC circuits the product of r.m.s values of voltage and current is termed as apparent power (VA). The potential difference in volts between two points is equal to the energy per unit charge (in joules/coulomb) which is required to move electric charge between the points. Since the electric current measures the charge per unit time (in coulombs/second), the electric power p is given by the product of the current I and the voltage V (in joules/second = watts).
Where, Q is electric charge in coulombs t is time in seconds I is electric current in amperes V is electric potential or voltage in volts 2.1.1 DC Circuits In the case of resistive (Ohmic, or linear) loads, Joule's law can be combined with Ohm's law (V = IR) to produce alternative expressions for the dissipated power:
where R is the electrical resistance. 5
2.1.2 AC Circuits In alternating current circuits, energy storage elements such as inductance and capacitance may result in periodic reversals of the direction of energy flow. Active Power: The portion of power flow that, averaged over a complete cycle of the AC waveform, results in net transfer of energy in one direction is known as real power (active power). It is the power consumed by the resistive elements in the circuit. Active power is the power that is actually being consumed by the load. Reactive power: The portion of power flow due to storage elements that returns to the source in each cycle is known as reactive power. When the voltage and current are periodic with the same fundamental frequency, the instantaneous power is also periodic with twice the fundamental frequency. 2.2 Components of power 2.2.1 Average Power: Average power is defined as the energy transfer rate averaged over many periods of the lowest frequency in the signal. It is also defined as the average amount of work done or energy converted per unit of time. If W is the amount of work performed during a period of time t, the average power P avg over that period is given by the formula P avg = W/t 2.2.2 Instantaneous Power: The instantaneous power is then the limiting value of the average power as the time interval t approaches zero. P= Lim t0 P avg
Electric power is usually produced by electric generators, but can also be supplied by chemical sources such as electric batteries. Electric power is generally supplied to businesses and homes by the electric power industry.
6
2.3 Power factor: The ratio between real power and apparent power in a circuit is called the power factor. It's a practical measure of the efficiency of a power distribution system. For two systems transmitting the same amount of real power, the system with the lower power factor will have higher circulating currents due to energy that returns to the source from energy storage in the load. These higher currents produce higher losses and reduce overall transmission efficiency. A lower power factor circuit will have a higher apparent power and higher losses for the same amount of real power. The power factor is unity (one) when the voltage and current are in phase. It is zero when the current leads or lags the voltage by 90 degrees. Power factors are usually stated as "leading" or "lagging" to show the sign of the phase angle of current with respect to voltage. Purely capacitive circuits supply reactive power with the current waveform leading the voltage waveform by 90 degrees, while purely inductive circuits absorb reactive power with the current waveform lagging the voltage waveform by 90 degrees. The result of this is that capacitive and inductive circuit elements tend to cancel each other out. When the waveforms are purely sinusoidal, the power factor is the cosine of the phase angle () between the current and voltage sinusoid waveforms. Equipment data sheets and nameplates often will abbreviate power factor as "cos".
2.4 Power measurement: Power measurement is done for both AC circuits and DC circuits. Power can be measured by using different methods namely: Using various measuring equipments. By interfacing the circuit with any software
2.4.1 Using various measuring equipments Equipments which measure current, voltage, power are used. These methods are as follows: 7
a) Using Voltmeter and Ammeter: DC power can be measured by measuring Voltage and Current. Two circuits are shown for DC power measurement.
Figure 2.4(a): DC power measurement using Ammeter and Voltmeter The disadvantage of the above power measurement is: In the first circuit, Ammeter measures current which flow into the voltmeter and load. In the second circuit, Voltmeter measures voltage drop across the ammeter in addition to that dropping across the load. So the above method is not accurate. b) Using Wattmeter: 1. Dynamometer 2. Digital wattmeter Dynamometer: A dynamometer can measure power in both DC and AC systems. A dynamometer has two coils: static coil and movable coil. It uses the interaction between the magnetic fields produced by the currents in two coils or sets of coils to measure power. Torque is proportional product of current in current coil and current in voltage coil. The Accuracy of dynamometer is nearly 0.25 %. 8
Figure 2.4(b): Electrodynamometer Wattmeter Digital wattmeter (up to 100 kHz): A modern digital electronic wattmeter/energy meter samples the voltage and current thousands of times a second. For each sample, the voltage is multiplied by the current at the same instant; the average over at least one cycle is the real power. A computer circuit uses the sampled values to calculate RMS voltage, RMS current, VA, power (watts), power factor, and kilowatt-hours. The readings may be displayed on the device, retained to provide a log and calculate averages, or transmitted to other equipment for further use. Advantages of digital wattmeter: High-resolution Accuracy
Figure 2.4(c): Digital Wattmeter 9
c) Power Triangle Method: Real and reactive powers can also be calculated directly from the apparent power, when the current and voltage are both sinusoids with a known phase angle between them:
Figure 2.4(d): Power Triangle (Apparent power) 2 = (real power) 2 + (Reactive power) 2 Real power = (apparent power)*(cos) Reactive power = (apparent power)*(sin) 2.4.2 Power measurement using software:
a) Power measurement using Multisim: In Multisim power can be measured using various methods like 1-wattmeter method, 2-wattmeter method, 3-wattmeter method. One such method is discussed in detail here. Two wattmeter method: In this method power is measured for three phase balanced loads using two wattmeters. The total power consumed is calculated using the below formula. Total Power Consumed, W total = 3*(W 1 + W 2 ) Where, W 1 first wattmeter reading 10
W 2 second wattmeter reading Let us consider a three phase circuit having resistive balanced loads. Connect the circuit in multisim and the total power calculated is 900watts using the above formula.
Figure 2.4(e): Simulation circuit of 2-wattmeter method power measurement in multisim b) Power measurement using Labview: Power measurement can also be done using Labview software. Labview is a system design platform and development environment for a visual programming language. Labview ties the creation of user interfaces (called front panels) into the development cycle. Labview programs/subroutines are called virtual instruments (VIs). The graphical approach also allows non-programmers to build programs by dragging and dropping virtual representations of lab equipment with which they are already familiar. c) For a three-phase system, a single-phase wattmeter can be connected in each phase. Using this three-wattmeter configuration, the total real power can be obtained by adding the three wattmeter readings. 11
Total power consumed, P = P 1 + P 2 + P 3 Where, P 1 - wattmeter reading first phase P 2 - wattmeter reading second phase P 3 - wattmeter reading third phase The above methods implemented either in software or in hardware. Whereas in Arduino Power Measurement project, the load circuit is interfaced with Arduino board, and is then programmed for power measurement. This project can also be extended for power measurement in a three phase system. So this project is advantageous compared to other methods.
12
CHAPTER 3 System Design
3.1 Software 3.1.1 Arduino Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is a single board microcontroller, descendant of the open-source wiring platform designed to make the process of using electronics in multidisciplinary projects. Arduino Uno, a microcontroller board based on the ATmega328 is used in this project. The hardware consists of a simple open hardware design for the Arduino board with an on- board input/output support. The software consists of a standard programming language compiler and the boot loader that runs on the board. Arduino hardware is programmed using a Wiring- based language (syntax and libraries), similar to C++ with some slight simplifications and modifications, and a Processing-based integrated development environment. Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be stand-alone or they can communicate with software running on a computer (e.g. Flash, Processing, MaxMSP and Megunolink). The hardware reference designs (CAD files) are available under an open- source license; you are free to adapt them to your needs. The open-source Arduino environment makes it easy to write code and upload it to the i/o board. It runs on Windows, Mac OS X, and Linux. In addition to all the features of the previous board, the Uno now uses an ATmega8U2 instead of the FTDI chip. This allows for faster transfer rates, no drivers needed for Linux or Mac (in file for Windows is needed), and the ability to have the Uno show up as a keyboard, mouse, joystick, etc.
13
3.1.1.1 Arduino Hardware: An Arduino board consists of an 8-bit Atmel AVR microcontroller with complementary components to facilitate programming and incorporation into other circuits. An important aspect of the Arduino is the standard way that connectors are exposed, allowing the CPU board to be connected to a variety of interchangeable add-on modules known as shields. Some shields communicate with the Arduino board directly over various pins, but many shields are individually addressable via an IC serial bus, allowing many shields to be stacked and used in parallel. Official Arduinos have used the megaAVR series of chips, specifically the ATmega8, ATmega168, ATmega328, ATmega1280, and ATmega2560. A handful of other processors have been used by Arduino compatibles. Most boards include a 5 volt linear regulator and a 16 MHz crystal oscillator (or ceramic resonator in some variants), although some designs such as the LilyPad run at 8 MHz and dispense with the onboard voltage regulator due to specific form- factor restrictions. An Arduino's microcontroller is also pre-programmed with a boot loader that simplifies uploading of programs to the on-chip flash memory, compared with other devices that typically need an external programmer. At a conceptual level, when using the Arduino software stack, all boards are programmed over an RS-232 serial connection, but the way this is implemented varies by hardware version. Serial Arduino boards contain a simple inverter circuit to convert between RS-232-level and TTL-level signals. Current Arduino boards are programmed via USB, implemented using USB-to-serial adapter chips such as the FTDI FT232. Some variants, such as the Arduino Mini and the unofficial Board uno, use a detachable USB-to-serial adapter board or cable, Bluetooth or other methods. (When used with traditional microcontroller tools instead of the Arduino IDE, standard AVR ISP programming is used.) The Arduino board exposes most of the microcontroller's I/O pins for use by other circuits. The Diecimila, Duemilanove, and current Uno provide 14 digital I/O pins, six of which can produce pulse-width modulated signals, and six analog inputs. These pins are on the top of the board, via female 0.1 inch headers. Several plug-in application shields are also commercially available.
14
3.1.1.2 Arduino Software: The Arduino IDE is a cross-platform application written in Java, and is derived from the IDE for the Processing programming language and the Wiring project. It is designed to introduce programming to artists and other newcomers unfamiliar with software development. It includes a code editor with features such as syntax highlighting, brace matching, and automatic indentation, and is also capable of compiling and uploading programs to the board with a single click. There is typically no need to edit make files or run programs on a command-line interface. Although building on command-line is possible if required with some third-party tools such as Ino. The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of the same name), which makes many common input/output operations much easier. Arduino programs are written in C/C++, although users only need define two functions to make a runnable program: setup() a function run once at the start of a program that can initialize settings loop() a function called repeatedly until the board powers off It is a feature of most Arduino boards that they have an LED and load resistor connected between pin 13 and ground, a convenient feature for many simple tests. [29] The above code would not be seen by a standard C++ compiler as a valid program, so when the user clicks the "Upload to I/O board" button in the IDE, a copy of the code is written to a temporary file with an extra include header at the top and a very simple main() functionat the bottom, to make it a valid C++ program. The Arduino IDE uses the GNU tool chain and AVR Libc to compile programs, and uses avr to upload programs to the board. As the Arduino platform uses Atmel microcontrollers Atmels development environment, AVR Studio or the newer Atmel Studio, may also be used to develop software for the Arduino. The Arduino hardware reference designs are distributed under a Creative Commons Attribution Share-Alike 2.5 license and are available on the Arduino Web site. Layout and production files for some versions of the Arduino hardware are also available. The source code for the IDE and the on-board library are available and released under the GPLv2 license. Arduino and Arduino-compatible boards uses of shields, which are printed circuit boards that sit atop an Arduino, and plug into the normally supplied pin-headers. These are expansions 15
to the base Arduino. There are many functions of shields, from motor controls, to breadboarding (prototyping).
3.1.1.3 Features ATmega328 microcontroller Input voltage - 7-12V 14 Digital I/O Pins (6 PWM outputs) 6 Analog Inputs 32k Flash Memory 16Mhz Clock Speed The maximum values that Arduino can handle: Max frequency: 16MHz Max Voltage: 5V Max Current: 50mA
Fig: 3.1.1(a) Arduino 16
3.1.1.4 Pin description Arduino can be powered using power jack, USB port. Apart from this it can also be powered by using a external battery or AC to DC adaptor through pin V in . 5V, 3.3V: there is a inbuilt regulator on the board. Through this regulator a constant DC supply of 5V, 3.3V is provided. Reset: This pin enables to reset the micro controller. IOREF: This pin acts as reference to the inputs given to the arduino board. There are 6 pins A 0 A 5 through which analog input can be given to the arduino board. There are 14 digital pins 0-13. Among these (3,5,6,9,10,11) are PWM pins(pulse width modulation) from which analog output can be taken from the arduino board. There is a inbuilt LED on pin 13. AREF- This pin acts as reference to the analog inputs. R x ,T x are used for receiving and transmitting serial data. ICSP- (In circuit serial programming)- These pins enable the user to programme the chips on the circuit. 3.1.1.5 Arduino sketch Basically Arduino sketch consists of two main functions namely 1. Void setup() 2. Void loop() Void setup(): Setup () is called when a sketch starts. It is used to initialize variables, pin modes, start using libraries etc. The setup () will only run once, after each power up or reset of the Arduino board. 17
Syntax: Void setup () { Statements; } Void loop(): After creating a setup () function which initializes and sets the initial values, the loop () function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. It is used to actively control the Arduino board. Syntax: Void loop () { Statements; }
Figure 3.1.1(b): Arduino sketch
18
3.1.2 Processing sketch Processing is an open source programming language and environment for creating graphs, images, animations, and interactions. Initially developed to serve as a software sketchbook and to teach fundamentals of computer programming within a visual context, Processing also has evolved into a tool for generating finished professional work. Today, there are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning, prototyping, and production. Basically Programming using Processing software uses three main functions namely Void setup() Void draw() Void serialEvent()
3.1.2.1 Void setup() The setup () function is called once when the program starts. It is used to define initial environment properties such as screen size and background color and to load media such as images and fonts as the program starts. There can only be one setup () function for each program and it shouldn't be called again after its initial execution. Note: Variables declared within setup () are not accessible within other functions, including draw (). Syntax: Void setup () { Statements; }
19
3.1.2.2 Void draw() It is called directly after setup (), the draw () function continuously executes the lines of code contained inside its block until the program is stopped or no Loop () is called. draw () is called automatically and should never be called explicitly. It should always be controlled with no Loop (), redraw () and loop (). After no Loop () stops the code in draw () from executing, redraw () causes the code inside draw () to execute once, and loop () will cause the code inside draw () to resume executing continuously. The number of times draw () executes in each second may be controlled with the frameRate () function. There can only be one draw () function for each sketch, and draw () must exist if you want the code to run continuously, or to process events such as mouse Pressed (). Sometimes, you might have an empty call to draw () in your program. Syntax: Void draw () { Statements; } 3.1.2.3 Void serialEvent(): It is called when data is available. Use one of the read() methods to capture this data. The serialEvent () can be set with buffer () to only trigger after a certain number of data elements are read and can be set with bufferUntil() to only trigger after a specific character is read. The which parameter contains the name of the port where new data is available, but is only useful when there is more than one serial connection open and it's necessary to distinguish between the two.
Figure3.1.2: Processing Sketch 3.1.3 MegunoLink software MegunoLink is a free program to upload compiled binary files to the Arduino micro controller and monitor communications from the device. It allows you to go away from the simple Arduino development environment and use a more full featured environment. 21
Figure 3.1.3: Megunolink Plot
3.2 Hardware 3.2.1 Block diagram of Arduino Power Measurement 3.2.1.1 Description The block diagram of the project Power Measurement using Arduino is as shown. The load circuit consists of resistive loads which are bulbs each of rating 200watts. These loads are energized by single phase 230v DC AC supply. The current and voltage through the load are stepped down to safer values by using a current transformer and potential transformer respectively. As the AC signals cant be given to Arduino board, these signals are offsetted using voltage and current offset data conditioning cards. These cards are energized using regulated DC supply. The function of offset data conditioning cards is to clamp the AC signal with respect to a preset reference DC voltage. The output waves from the voltage offset card are given as analog input to Arduino board at pins A 0 and ground. Similarly the output from the current offset card is given as analog input to Arduino board at the pins A 2 and ground. Once the analog inputs are given to Arduino, the microcontroller on the board is programmed for the measurement of power in Arduino sketch. 22
Figure 3.2.1(a): Block diagram of Arduino Power Measurement
3.2.2 Offset data conditioning card 3.2.2.1 Function The function of offset data conditioning card is to clamp the given AC signal with respect to a reference DC voltage. The reference DC voltage is preset according to the components used in the circuit which intern depends on the maximum load rating.
Figure 3.2.2(a): Simulation circuit of offset data conditioning card in multisim 23
3.2.2.2 Description The circuit diagram of the offset data conditioning card is as shown. It consists of two op- amps, UA714CN which are operated in inverting mode. The first op-amp is used as a summing amplifier. It adds up the input signal with the DC reference voltage. The output of the first op- amp is inverted using the second op-amp which acts as an inverting amplifier. The output of this op-amp is taken out as the output of the offset data conditioning card.
Figure 3.2.2(b): Simulation results of offset card in multisim
Figure 3.2.2(c): Offset card hardware
24
3.2.3 Regulated DC supply Regulated DC supply of +12, 0, -12v is used to energize the offset data conditioning card. The circuit diagram of the regulated Dc supply card is as shown in figure. Here firstly the single phase 230v AC supply is stepped down to 15v AC by using a step down transformer.
Figure 3.2.3(a): Regulated DC supply circuit From this AC voltage all the harmonics are removed by using diodes and the output voltage is further converted to constant DC voltage by using regulators 7812 and 7912. From this voltage the distortions are removed by using capacitive filters. This circuit finally outputs a voltage of +12, 0, -12v.
25
Figure 3.2.3(b): Simulation circiut of regulated DC supply in multisim
Figure 3.2.3(c): Regulated DC supply hardware
3.2.4 Load circuit The load circuit consists of resistive loads which are bulbs as shown in the figure. These loads are each of wattage 200watts. The maximum load being used is 600watts.The current and voltage values of load are stepped down by using current transformer and potential transformer respectively. 26
Figure 3.2.4(a): Load circuit
Figure 3.2.4(b): Load circuit hardware
27
CHAPTER 4 Simulation results
4.1 Single Load When the first load having a rating of 200watts is switched on, the Arduino Serial monitor displays the average power consumed as 170watts in its COM window as shown in figure 4.1(a). Graphically it can be obtained using Megunolink software and Processing software. The figure 4.1(b) represents a graph between average power in watts and time in seconds using Megunolink software. Figure 4.1(c) represents the graph which is displayed using Processing software.
Figure 4.1(a): Serial monitor values for single load in Arduino
28
Figure 4.1(b): Megunolink plotting for single load
Figure 4.1(c): Graph for single load in Processing sketch
29
4.2 Two Loads When two bulbs each of rating 200watts is switched on, the average power values in the serial monitor shows nearly 410watts as shown in the figure 4.2(a). Due to transformer losses, the value in the serial monitor is displayed as 410watts instead of 400watts. The figure 4.2(b) represents a graph between average power in watts and time in seconds using Megunolink software. From this graph we can observe the change in average power consumed when the second load is switched on. Figure 4.2(c) represents the graph which is displayed using Processing software.
Figure 4.2(a): Serial monitor values for two loads in Arduino
30
Figure 4.2(b): Megunolink plotting for two loads
Figure 4.2(c): Graph for two loads in Processing sketch
31
4.3 Three Loads When three loads are switched on(having a total rating of 600watts), the average power values in the serial monitor shows nearly 660watts as shown in the figure 4.3(a). Due to transformer losses, the value in the serial monitor is displayed as 660watts instead of 600watts.The figure 4.3(b) represents a graph between average power in watts and time in seconds using Megunolink software. From this graph we can observe the change in average power consumed when the third load is switched on. Figure 4.3(c) represents the graph which is displayed using Processing software.
Figure 4.3(a): Serial monitor values for three loads in Arduino
32
Figure 4.3(b): Megunolink plotting for three loads
Figure 4.3(c): Graph for three loads in Processing sketch 33
4.4 Varying Loads
If the loads are increased and decreased in a step wise manner then the graphs obtained in Megunolink and Processing softwares will be as follows respectively.
Figure 4.4(a): Megunolink Plotting for varying loads
Figure 4.4(b): Graph for varying loads in Processing sketch 34
CHAPTER 5 Conclusion
5.1 Conclusion Power measurement is done for resistive loads up to a maximum load of 600watts using Arduino environment. Results for three loads are shown in simulation. Arduino Power Measurement is an advanced method of determining power and this method is more advantageous than other softwares such as Labview. The advantages of Arduino over other softwares are it simplifies the amount of hardware and software development needed inorder to get a system running. It is open source software and can be extended by experienced programmers. Arduino has simple and clear programming environment and also has a quicker writing code. From the above discussion Arduino Power Measurement is an advanced method of measuring power and can also observe it graphically.
5.2 Scope for work Proper performance, reliability, stability of power being consumed and generated must be ensured. Therefore it is necessary to measure, test and analyze the power consumption to every aspect of power system for its performance and behaviour, under normal as well as extreme operating conditions. The present project can be further extended for measuring the energy consumption in KWHs. This KWH reading can be provided to the user for their easy understanding. The same can be displayed graphically to observe the excess consumption of energy and can be minimized accordingly. Apart from this Arduino based wireless power meter can also be implemented. The Arduino based wireless power meter is a non-invasive current meter for household power with an Arduino interface. Current through the load is measured using split core current transformers. This data is then transmitted through the homes wireless router and back to the base station and 35
is represented visually to the user. This method provides the domestic power consumption accurately, safely, and with a relatively fast update rate, thus helping the user optimize and reduce their power usage.
Arduino program for measuring power and displaying graphically using MegunoLink
#include <GraphSeries.h> // Including the header file GraphSeries g_aGraphs[] = {"power(Watts)"}; // Plotting graph for power in Watts float Voltage = A0; //Defining and initializing the voltage float Current = A2; // Defining and initializing the current float I = 0; float V = 0; float P = 0; float P1 = 0; void setup() { Serial.begin(9600); pinMode(Voltage,INPUT); //Set voltage as input pin pinMode(Current,INPUT); //Set current as input pin pinMode(P1,OUTPUT); //Set power as output pin } void loop() { float realPower = 0; for(int i=0;i<400;i++) // Using for loop to calculate average power { float P = 0; V= ((analogRead(Voltage)-(2.3*204.6))/204.6)*(66.474*1.414); //Voltage from A0 is negative offsetted to get AC waveform and is then multiplied with transformation ratio of PT to get actual voltage waveform
I= ((analogRead(Current)-(2.22*204.6))/(204.6*20))*(76.667*1.414); //Current from A2 is negative offsetted to get AC voltage waveform, which is then converted to current by dividing voltage with appropriate resistance to get AC current waveform and is then multiplied with transformation ratio of CT to get actual current waveform P=V*I; // Voltage and current waves are multiplied at some instants realPower=realPower+abs(P); //Power is added after successive instants delay(0.05); } P1=realPower/400.0; // Above obtained power is averaged by number of instants Serial.println(P1); //Moving the value of average power to com window g_aGraphs[0].SendData(P1); // Displayed average power using MegunoLink }
APPENDIX-B
Program to display the average power in Processing software
import processing.serial.*; //Importing data from Arduino to processing software Serial port; int xPos=1; //Defining a variable for position of x int dely=10; // Defining a variable for position of y void setup() { size(1280,768); // Declaring the size of display screen port = new Serial(this, "COM5", 9600); // Set the com port same as that of Arduino port.bufferUntil('\n'); // Repeat the data until new line character is encountered } void draw() // used for 3D geometry { } void serialEvent (Serial port) { String inString = port.readStringUntil('\n'); // Reading the data from strings until new line character is encountered if (inString != null) // Checking if string is empty { inString = trim(inString); // This function removes the spaces from the beginning and end of string including tab spaces float inByte = float(inString); // Storing the new string as float inByte = map(inByte, 0, 1023, 0, height); // This function remaps the numbers in the string from one range to another
line(xPos,height,xPos,height - dely); // Line function with 4 parameters used to display 2D line stroke(inByte,0,255); // Used for colouring of line noFill(); // Disables the filling of geometry line(xPos, height- inByte, xPos, height); if (xPos >= width // Check for the position of x and width of screen { xPos = 0; // If xpos is greater than width of screen reinitialize it to zero position background(0); // Colouring of the background } else { xPos++; // If xpos is not greater than width of screen then incrementing its value } } }
Power of Habit: The Ultimate Guide to Forming Positive Daily Habits, Learn How to Effectively Break Your Bad Habits For Good and Start Creating Good Ones
The Complete HVAC BIBLE for Beginners: The Most Practical & Updated Guide to Heating, Ventilation, and Air Conditioning Systems | Installation, Troubleshooting and Repair | Residential & Commercial