Você está na página 1de 15

Microcontroller based universal power meter

1. INTRODUCTION
The past three decades have seen the introduction of a technology that has radically changed the way in which we analyze and control the world around us. Born of parallel developments in computer architecture and integrated circuit fabrication, the microprocessor or CPU on chip first became a commercial reality in 1971. Microcontrollers are hidden inside the surprising number of products now-a-days. Here, we present project synopsis for building up a Microcontroller Based Universal Power Meter. The report starts off with the Basic Block Diagram of the system and its description. The blocks shown are much generalized and can represent a general microcontroller application block. Then the details of every block are given later in hardware description. In this we have included the circuit diagrams and features of the different ICs we are using. Next we explain the software part of the project. This mainly deals with the calculations and interfacing of different chips with the controller. This needs a number of subroutines. And at last we will show, what we are looking in future regarding the topic and thus give an idea how the application of digital metering can change a number of things. The power measurement technique used in current time is electrodynamic type power meter which absorb some energy to work so it is not very much accurate and they are costly also and there is no theft detection technique used into that type of energy meter. Electronic meters are very complex so we are going to design a microcontroller based power meter.

2. PROJECT OBJECTIVE
Our objective is to design a microcontroller based universal power meter which is less complex and cheap with increased performance.
E.I. DEPARTMENT, SRMGPC, Lucknow 1

Microcontroller based universal power meter

3. PROPOSED METHODOLOGY
When a purely sinusoidal wave is used then by converting the signal into its DC form, would make the calculations of power much easier. But the actual wave is seldom purely sinusoidal and therefore assuming it DC would lead to wrong answers. So we take various samples over the wave by using Analog to Digital Converter (ADC). Thus by performing different calculations on this digitized signal, we can achieve better accuracy which not only depends on the ADC selected, but also the accuracy maintained in the calculations.

BLOCK DIAGRAM

Figure 3.0 Block diagram

This system consists of three main blocks as shown 1. Data acquisition 2. Data manipulation 3. Displaying the parameters

E.I. DEPARTMENT, SRMGPC, Lucknow

Microcontroller based universal power meter

3.1 DATA ACQUISITION


Data acquisition means acquiring the data and processing it as per the requirements so as to suit the controller. Here we have an analog data which we require to convert into the digital form for acquiring the three voltages and three currents of the star connected three phase system. Again care should be taken to check the ADC requirements so that the data is faithfully sampled.

3.2 DATA MANIPULATION


Data manipulation is nothing but performing a number of calculations on the data acquired to give us the required parameters needed. For this we are using the Atmega 16 architecture based 16 bit microcontroller. The chip is programmed to perform various tasks such as calculating the parameters and store the same in the on chip memory. Then interfacing the ADC, the display and the keyboard are also done with the same controller.

3.3 DISPLAYING THE PARAMETERS


Displays are the universal means of interacting with humans as far as outputting the data is concerned. We are using the intelligent display and the different parameters which are considered are as follows 1. RMS values of voltage and current 2. Average power 3. KVA rating

E.I. DEPARTMENT, SRMGPC, Lucknow

Microcontroller based universal power meter

4. HARDWARE REQUIREMENTS
4.1 MICROCONTROLLER
We are using the Atmega 16 microcontroller this is a low-power microcontroller based on the AVR enhanced RISC Architecture. By executing powerful instructions in a single clock cycle, the ATmega16 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed.

FEATURES
1. High-performance, Low-power Atmel AVR 8-bit Microcontroller. 2. Advanced RISC Architecture. 3. 32 x 8 General Purpose Working Registers Fully Static Operation up to 16 MIPS throughput at 16 MHz On-chip 2-cycle Multiplier 4. High Endurance Non-volatile Memory segments. 5. 16 Kbytes of In-System Self-programmable Flash program memory. 6. 512 Bytes EEPROM 1 Kbyte Internal SRAM 7. Write/Erase Cycles: 10,000 Flash/100,000 In-System Programming by On-chip Boot Program. 8. Programming Lock for Software Security JTAG (IEEE std. 1149.1 Compliant). 9. Programming of Flash, EEPROM and Lock Bits through the JTAG Interface.

E.I. DEPARTMENT, SRMGPC, Lucknow

Microcontroller based universal power meter

PIN DIAGRAM

Figure 4.1(a) Pin diagram of ATMEGA-16

E.I. DEPARTMENT, SRMGPC, Lucknow

Microcontroller based universal power meter

BLOCK DIAGRAM OF ATMEGA 16

Figure 4.1(b) Block diagram of ATMEGA-16


E.I. DEPARTMENT, SRMGPC, Lucknow 6

Microcontroller based universal power meter

4.2 PORT DESCRIPTION


Port A (PA7-PA0) Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics with both high sink and source capability. When pins PA0 to PA7 are used as inputs and are externally pulled low, they will source current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active. Port B (PB7-PB0) Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active. Port C (PC7-PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset. Port D (PD7-PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability.

E.I. DEPARTMENT, SRMGPC, Lucknow

Microcontroller based universal power meter

4.3 THE LCD DISPLAY


We are using an intelligent LCD display of two lines, 20 characters per line, that is interfaced with the controller. The display contains two internal byte-wide registers, one for commands and other for characters to be displayed. It also contains a user programmed RAM area that can be programmed to display any desired character to be displayed.

Figure 4.3 LCD display

4.4 VOLTAGE SENSING CIRCUIT As show in the circuit, the signal gets converted as follows
1. The voltage transformer converts the 230V to 5V. 2. The op-amp circuit gives us a DC shift of 2.5V DC and a voltage signal. 3. This wave then goes to the sample and hold circuit, whose output is connected to the ADC. 4. The ADC samples the signal and stores them in microcontrollers memory.

E.I. DEPARTMENT, SRMGPC, Lucknow

Microcontroller based universal power meter

Figure 4.4 Voltage sensing circuit

4.5 CURRENT SENSING CIRCUIT


1. The current is passed through high wattage resistance as shown. 2. Then the voltage drop across this resistor would give us a voltage which is proportional to the value of current. 3. For isolation purposes, a small pulse transformer of ratio 1:2 is used before the op-amp. 4. Then again the op-amp circuit gives the DC shift of 2.5V and desired voltage signal. 5. The sample and hold circuit holds the data when commanded. 6. The ADC samples the signal and stores them in microcontrollers memory.

Figure 4.5 Current sensing circuit

E.I. DEPARTMENT, SRMGPC, Lucknow

Microcontroller based universal power meter

5. Software Development
5.1 RMS OF VOLTAGE AND CURRENT
This subroutine finds out RMS voltage and current. In this routine we have proceeded in following way1. First all the instantaneous samples are squared and added. 2. Then mean of the final addition is found. 3. Final RMS is obtained by taking square-root of the mean value. Vrms = {( V1 + V2 +V3 +..................+Vn )/ n } Irms = ( { (I1 + I2 +I3 +..................+In )/ n }
2 2 2 2 2 2 2 2

5.2 AVERAGE POWER


The routine is used to find average power from the instantaneous values of the voltages and currents stored in the memory. In this subroutine samples are from memory are taken and multiplication of voltage and current is carried out and average is found to give the average power value. P = (V1 + V2+V3+..................+Vn )/ n V1 ,V2 , V3 ,....,Vn = Different values of the samples n = the number of samples taken.

5.3 KVA RATING


This routine is to find the VA rating. This routine obtains the same by considering the Vrms and Irms results. Thus by multiplying the Vrms and Irms we get the VA rating. P = (V1I1 + V2I2+V3I3+..................+Vn In)/ n
E.I. DEPARTMENT, SRMGPC, Lucknow 10

Microcontroller based universal power meter

5.4 DISPLAY SUBROUTINE


This is used to display the parameters. Ports of microcontroller are first configured as I/P or O/P and then required parameters are displayed. 1. First the LCD module is initialized. 2. Then the data for the first line to be displayed is sent. 3. A command for cursor shift is sent. 4. Then the numerical value of the answer to be displayed is converted to its ASCII value and then sent to the LCD module.

5.5 KEYBOARD INTERFACE


The keyboard used is 4 x 4 matrix keyboard. It is connected to port 1 and port 2 of the microcontroller. The keys are pulled to Vcc through 10K resistors. Port 1 is configured as input port and port 2 as output port. Key-press is detected by scanning the columns continuously looking for an active low pin.

6. THE FLOWCHARTS
The flowcharts show us how the data should flow in a logical manner so as to achieve the desired result. We can thus develop the program more easily with the reference of its flowchart. Here we present the different flowcharts required for the functioning.

E.I. DEPARTMENT, SRMGPC, Lucknow

11

Microcontroller based universal power meter

TO FIND VAVG AND VRMS

Figure 5.2 flowchart for Vrms

Figure 5.1 flowchart for Vavg

E.I. DEPARTMENT, SRMGPC, Lucknow

12

Microcontroller based universal power meter

TO FIND IRMS AND KVA RATING

Figure 5.1 flowchart for Irms

Figure 5.3 flowchart for KVA rating

E.I. DEPARTMENT, SRMGPC, Lucknow

13

Microcontroller based universal power meter

7.APPLICATION
The application area of the microcontroller based power meter is very vast. We can use this into the power plants, house hold usage and the laboratories purposes.

8.ADVANTAGES
1.Less loading error 2.High accurcy 3.Less complex 4.Cheaper than conventional wattmeter 5.Theft detection 6. More reliable

9. LIMITATIONS
1.External power supply is required. 2.Not used for very high voltages. 3.If supply is bypassed then this theft can not be detected.

E.I. DEPARTMENT, SRMGPC, Lucknow

14

Microcontroller based universal power meter

10. REFERENCES
[1] A Single Phase Microcontroller Based Energy Meter, P.A.V Loss, M.M. Lamego, G.C.D. Sousa and J.L.F Vieira, IEEE instrumentation and Measurement, Technology Conference, St. Paul, Minessota, USA, May 18-21,1998 [2] The Scientist and Engineer's Guide to Digital Signal Processing Second Edition by Steven W. Smith [3] Ramakant A. Gaykawad Op-amp And Linear Integrated Circuits [4] [5] www.nationalinstruments.com Adel S. Sedra & Kenneth C. Smith fifth edition Microelectronics Circuits New York Oxford University Press.

E.I. DEPARTMENT, SRMGPC, Lucknow

15

Você também pode gostar