Sie sind auf Seite 1von 31

PROJECT TITLE DESIGNING A REAL TIME ELECTRICITY USAGE MONITOR Chapter 1 CHAPTERS 1. SYNOPSIS 1.1. METHODOLOGY 2.

BLOCK DIAGRAM 2.1. BLOCK DIAGRAM DESCRIPTION 3. OVERALL CIRCUITS 3.1 TRANSMISSION SECTION 3.2 RECEVIER SECTION 4. POWER SUPPLY 4.1 BLOCK DIAGRAM 4.2 EXPLANATION 4.3 CIRCUIT DIAGRAM 4.4 WORKING PRINCIPLE 4.4.1 TRANSFORMER 4.4.2 BRIDGE RECTIFIER 4.5 IC REGULATOR 4.5.1 CIRCUIT DIAGRAM 4.5.2 EXPLANATION 4.5.3 VOLTAGE LIMITATIONS OF IC PARTS 5. IR-SPEED SENSOR 5.1 CIRCUIT DIAGRAM 5.2 EXPLANATION 6. MICROCONTROLLER 6.1 INTRODUCTION 6.2 PIN DIAGRAM OF MICROCONTROLLER 6.2.1 PIN DESCRIPTION 6.3 ARCHITECTURE OF 89C51 6.4 MEMORY ORGANIZATION 6.5 ADDRESSING MODES 6.6 REGISTER INSTRUCTION 6.7 INTERRUPTS 6.8 OSCILLATOR AND CLOCK CIRCUIT 6.9 APPLICATIONS OF MICROCONTROLLER 7. LCD DISPLAY 8. TRANSMISSION SECTION 8.1 CIRCUIT 8.2 FSK MODULATION 8.2.1 CIRCUIT DESCRIPTION 8.3 RF TRANSMITTER 9. RECEVER SECTION 9.1 CIRCUIT 9.2 RF RECEIVER 9.3 FSK DEMODULATOR 10. COMMUNICATION SYSTEM 10.1 CIRCUIT 10.2 RS232 10.3 CIRCUIT WORKING DESCRIPTION 11. PROGRAM 12. ADVANAGES AND APPLICATIONS 12.1 ADVANTAGE 12.2 APPLICATION 13. CONCLUSION 14. REFERANCES Abstract Currently the ZESA in balking on the project to installed Prepaid Energy meter i PAGE NO.

n every household slowly removing the dominance of electromagnetic energy meter used bef ore. This project mainly outlines the designing of a working model of a prepaid energ y meter which is cost effective compared to the existing ones. It starts by explaining some advantages offered by using prepaid energy meter an d it also traces the technologies behind the existing Prepaid Energy, that is how they are recharged. It goes on to explain the designing of model of keypad recharge energy meter. From the investigation carried out, to come up with a cost effective and more re liable energy meter, ICs where used to measure the voltage and current consumed by the load an d also to perfume the calculation of energy consumed in watt second (W\s). From the conclusion made in this project, we can conclude the designed prepaid e nergy meter can be modified for commercial use and it is able to offering better adva ntages to both the power utility company and the customer compared to electromagnetic mete r, although it still need some improvement in certain areas. Introduction Digital Energy Meters An electric meter or energy meter is a device that measures the amount of electr ical energy consumed by a residence, business, or an electrically-powered device. Electric meters are typically calibrated in billing units, the most common being the kilowatt hour. A periodic reading of electric meters establishes billing cycles and energy use d during a cycle. In setting when energy savings during certain periods are desired, meters may me asure demand, the maximum use of power in some interval. In some areas, the elec tric rates are higher during certain times of day, to encourage reduction in use . Also, in some areas meters have relays to turn off nonessential equipment. TECHNOLOGY: The deployment of electronic energy meters has gained a great deal of momentum o ver the past several years. This is due to their two main advantages over the tr aditional electromechanical designs: improved accuracy and an expanded set of fe atures. Current microcontroller technology allows designers to build meters that are competitive in price with traditional devices, while maintaining the requir ed accuracy of 1% for domestic applications. Microcontrollers also allow the easy incorporation of added features, such as rms voltage and current and peak deman d metering, as local electric utility companies desire to implement them.

CHAPTER 1 Project scope This project mainly concentrates on designing an electricity monitoring device w hich is easy to use and which does not require a technician or electrician to in stall it at home or business premises. Background of the project In Zimbabwe at the present moment there is need of saving electricity because th e current electrical supply to consumers is scarce, other ways have been put in place in order to save electricity, and these include: use of incandescent lamps i.e. energy savers

use of alternative sources of energy e.g. installing solar geysers use of electric jugs to boil water The sum total of these methods is not an effective way of saving electricity, an alternative way is to use single phase energy watt meters to monitor your home or business electricity consumption through the month. This phenomenon is not ye t well adapted by many consumers in Zimbabwe. Unlike the main energy meter, an i n-home display is a quick and easy way for consumers to see what the cost of run ning their appliances is. Monitoring your monthly electric consumption can be us ed to project your monthly bill. There are a vast range of these meters; the issue is to carefully select a meter which would best help to achieve the desired goal. The watt meters are grouped as whole house meters and others that only measure power consumption of individu al appliances. Whole house watt meters are more attractive than those that measu re the power consumption of individual appliances. It is a necessity to introduce the watt meters to the consumers, and this desig n focuses on designing a whole house wattmeter which is quite advantageous to us e than watt meters that only show the power consumption of individual appliances . The advantages are as follows: keeps up with technological advances and hence can compete on the market It's easy to install and simple to use. Sends signals on instantaneous electric power over house wiring by power line carrier so that the display device can be installed in any room and simply plugged into the wall. This confers a substantial time savings in installation and set-up. Accurate meter reading and billing and no problems due to faulty reading meters People save money on their electric bills by showing them exactly where they are consuming energy and how even small changes in their electricity usage can save money. Problem statement At the present moment electrical energy is on high demand, and its generation is unable to meet the demand. Consumers are paying a lot of money on their electri city bills. The need to save electricity due to the increased consumption of e lectricity in residential areas has alarmed the designing of a real time electri city usage monitor. Objectives The main objective of the project is to design a device for measuring th e power consumed by all appliances at domestic level. The device should: Provide the measurement in real time, Should show an increase or drop in the reading if more devices are plugg ed or unplugged respectively. After coming up with a design, a prototype has to be made. The device must consume less energy so that it is not a burden to the co nsumer. To analyse the existing technologies of monitoring electricity and come up with a suitable technology that is ideal for the local market. Most importantly the device must record the power consumption and the re spective cost of power consumption on a particular day in real time. The device must show the cumulative power consumption and cost for the m onth. Justification The need to save electricity due to the increased consumption of electricity in residential areas has alarmed the designing of a real time electricity usage mon itor. The device will help residents to monitor their electricity consumption an d to know which appliances take the greatest amount of energy consumption and th e ones that take the least amount of power. The theme of the project is, ``Meter ing displays should be provided for each individual household in a form that is accessible, attractive and clear``.

CHAPTER 2 Applications in industry that employ electricity monitoring i.e areas wh ere system is applicable Types of monitoring devices and Evaluation of technology and cost of technology Applicability of technology to local situation Specific details pertaining to the schematic Description of the meter available Comparing metering devices How much can be saved by employing the meter Graph of comparisons Cable size calculations Types of cables and ones applicable Conduct cost analysis Power consumption calculations of the device Meter connection to the distribution box System response to an input and possible errors Detailed explanation of the meter functioning Energy ICs ade, sa2002hpa, cs5566 2.1 Introduction In this chapter we are going to describe the various types of energy meters avai lable i.e. their principle of operation, purpose, advantages and disadvantages a nd a general description of their architecture. The various types are the common electromechanical induction meter, smart meters, prepaid energy meters, electro nic meters and home energy monitors-which are the main objective of the project. The basic principle behind the operation of energy meters is the use of a curre nt sensor to measure the current. The measurement can then be displayed using an alogue or digital methods. The electromechanical induction meter is the only met ering system that uses analogue display and it is slowly being phased out while the rest uses a digital display. Smart meter: These meters record the amount of electricity consumption for a certain period of time. The recorded data is then sent to the utility company for monitoring an d billing purposes. Smart meters can transfer data from and to the meter, i.e. i t is a two way communication. . Basic electronic meters are not just more cost-effective than mechanical meter s, but offer further benefits: measurement accuracy of the electronic meter is a bout an order of magnitude better than that of a mechanical meter, while power c onsumption is lower by about two orders of magnitude. The electronic energy mete r is also better protected against tampering than its mechanical predecessor, an 2.2 literature review In-home display of energy use or cost An in-home display can be used to display information such as current energy use and cost. An in-home display of energy of energy use or cost provides immediate and simple feedback. Turning on a light or an electric stove increases energy u sage and causes the display to change significantly. This is direct feedback of the energy consumption, and makes this meter attractive and gives information to the consumer about an instantaneous increase in the energy consumption. With th e main energy meter a small increase in the consumption does not give a change i n the meter reading. To realise a change of one unit on the main energy meter, i t takes some time before this is shown to the consumer but with an in-home displ

ay a real time feedback is noticed. Indeed, with everything off, it easy it is e asy to see the amount of electricity consumed by electronics that are in the {off} position. This saves to notify the consumer which devices worth to keep plugged in even if they are in the off mode and the devices which must be unplugged eve n if they are off. These devices are called vampire loads. This how the theme of the project is achieved; ``Metering displays should be provided for each indiv idual household in a form that is accessible, attractive and clear``. This kind of display can help consumers to reduce their electrical bills. The meter can be programmed to show the current cost of electricity, the current rate of use, and cost of electricity for previous day, week, and month. This di splay is unique and different from most metering displays. Plug-in meter These meters are plugged into the wall outlet and the device you wish to measure its power consumption is plugged into the meter. The device is used to measure the power consumption of gadgets such as refrigerators, washing machines and any other home electrical appliances. Energy saving power strip Power strips are used to measure the power consumption of loads connected to it, it has many sockets where you plug in the appliances. It can turn on and off th e appliances connected to it. They work just like a plug-in power meter except t hat they measure the power being used by multiple devices plugged into the power strip. The plug-in meter and the power strip meter are both good at detecting v ampire loads. These loads are from power that continues to be consumed after a d evice is shut off. Even though vampire loads may be small they add cost to your energy bill 24/7. Real time monitors This type of meter reads the pulse signal from the existing utility meter and re cords the measurement in KWh. The data is transmitted to the display situated in a secure place in the home. The added benefit is that you can see the entire el ectrical load on your home as it happens i.e. in real time. This is such that if an appliance is turned on the power consumption rises up instantaneously and li kewise drops when it is turned off. The display can be programmed that you can t ranslate the KWh to dollars. Energy monitor: Sensor and display type Energy-monitoring sensor tracks and reduces energy consumption. This system lets small-to medium-sized commercial and industrial users gather and analyze energy consumption data. The sensor provides communications interfaces and data-integr ation capabilities to help with the development of effective energy-management s trategies. It can measure electrical loads of individual power panels, subpanels and plant equipment; connect to existing monitoring devices, instrumentation an d building automation systems; and accept pulses from utility meters and other s ub-metering devices. Data can then be sent to online energy-monitoring software portals like Google Power Meter and Pulse Energys Pulse for presentation and anal ysis, or to local databases for integration with business systems. Electromechanical Induction Meter (Standard Meter): In conventional electricity billing system, the bill is taken after the utilizat ion of energy. This system has many problems such as the human errors in taking readings and during keeping records. To overcome all such problems we are develo ping the prepaid electricity billing system It is a meter which counts the number of turns an aluminium disc does. The amoun t of electricity used is directly proportional to the number of revolutions of t he aluminium disc. The electricity is measured in kilowatt-hours and the rate of charge remains constant all over the day. These types of meters are commonly us ed on single phase alternating current supply. Disadvantages In conventional electricity billing system, the bill is taken after the utilizat ion of energy. This system has many problems such as the human errors in taking

readings and during keeping records.

The major building blocks of this project are: Microcontroller based control system with regulated power supply. GSM Modem for remote communication Electromagnetic Relay and Relay Driver for Power Supply Control. Digital Energy Meter. LCD Display to display the meter readings. Energy monitoring using RF transmitters This system is not available but it sis a system that can be developed to monito r electricity by the Electricity Department This type of meter uses wireless transmission protocol to transmit electricity u sage data from the electro-mechanical meter to the Electricity Department and to transmit back the bill amount to the consumer. The system is used to transmit t he number of units the number of units consumed by the consumer. RF transmitters are used to transmit the data in this system. Transmission side

Receiver section

Principle of operation The system uses an infrared sensor to monitor the speed of rotation of the alumi nium disk of the electro-mechanical meter. An infrared sensor senses the number of rotations of energy meter and it gives a signal to a signal conditioning circ uit. This circuit delivers the output in terms of pulses to the microcontroller. The number of units consumed is indicated in the display. The system will trans mit data at a certain date of the month; this is done by the microcontroller whi ch sends data to an encoder. The encoded signal is then transmitted through RF t ransmitter. The RF receiver receives the transmitted signal and then it is given to the decoder. The decoded signal is transferred to a PC. The data is processe d and the bill is sent to the consumer through the system. Requirements for the project IR transmitter and receiver. Microcontroller LCD display Encoder. RF transmitter RF receiver Decoder. PC IR-speed sensor This is a circuit designed to monitor the speed of rotation of the aluminium dis c. The disc is rotated across the USLOT. The USLOT consists of IR transmitter an

d receiver which should be placed straight in line with each other. The infrared sensor and senses the rotation of the disc and the associated circuits generate s a pulse which is proportional to the energy usage and this pulse is sent to th e microcontroller which displays the energy usage. IR transmitter and receiver circuit Disc IR Led Photodiode USLOT

FSK modulation Frequency-shift keying (FSK) is a form of frequency modulation in which the modu lating signal shifts the output frequency between predetermined values. Usually, the instantaneous frequency is shifted between two discrete values termed the m ark frequency and the space frequency. Continuous phase forms of FSK exist in wh ich there is no phase discontinuity in the modulated signal. The example shown a t right is of such a form. Other names for FSK are frequency-shift modulation an d frequency-shift signaling. Advantages of the system The electricity department will serve money used to send people to colle ct metering data; some places are too remote that this system is of so much help . Disadvantages

Prepaid electricity billing system using GSM technique In conventional electricity billing system, the bill is taken after the utilizat ion of energy. This system has many problems such as the human errors in taking readings and during keeping records. To overcome all such problems we are develo ping the prepaid electricity billing system This system consists of one card pla ced at consumer end, which will be connected to the meter. It takes pulses from meter as input and accordingly decrements the number of units. The number of uni ts will be displayed on 7-seg display. The supply will be circulated in the hous e through relay. At electricity board another unit will be used which will be in terfaced to the PC. This unit consists of micro controller, RS 232, switching IC 4052, GSM Port/handset etc For recharging, the meter number and recharge code c an be sent as a SMS, using Handset. The GSM Port/Handset connected to unit at el

ectricity board will receive this SMS and compare meter number and recharge cod e with its data base. When it finds the meter number and code it will send messa ge to GSM Port/handset connected at consumer unit. When this message is received will be received the recharge will be done. The unit at electricity board will consists of micro controller, RS 232,GSM Port / Handset. The unit will be connected to the PC. The database for meter number a nd recharge code will be stored in the PC. For this purpose VB will be used as f ront end. The database can be done using MS Excel or MS Access. The recharge can be done by sending SMS from handset. The SMS will contain the r echarge code. This message is received at GSM port connected at main unit. The m essage will be decoded and recharge will take place.

Prepaid energy meter using GSM This project deals with GSM based electricity prepaid billing system for domesti c power billing & transmission. In this project Embedded based prepaid energy meter with the GSM module at customer side will read the consumption of energy & send the signal to the server for update and control the customer meter. Control the customer meter means seve r after receiving signal it will update the particular meter and then check remaining ba lance & send the signal to the customer meter then customer meter will update. If server dete cts any meter balance unit zero then it disconnects the power supply by sending the signal to particular meter via GSM. When the user sends request for recharge his meter then the serve r search that particular meter ID for recharge the same meter. User can also interact wit h the control

unit using GSM meter for Balance enquiry. This project is divided into major par t that is briefly described in the following section. 1) The customer (meter) side. 2) GSM architecture.

3) Server side with GSM module.

Prepaid energy meter using GSM block diagram The customer side (GSM prepaid meter)

Server side

ABSTRACT: Every month we can see a person standing in front of our house from Electricity board or water Board whose duty is to read the energy meter/water meter and h andover the bills (electric or water) to the owner of that house . This is nothi ng but meter reading. According to that reading we have to pay the bills. The ma in drawback of this system is that person has to go area by area and he has to r ead the meter of every house and handover the bills. The Electricity board and W ater authority has to give privileges for these people to do their duty monthly. The thing is, Government will not appoint any particular persons for this duty. The people working in these boards will go on a particular day and do their dut y leaving all their pending works. Due to this, their work will be delayed and t his is great loss for government. To overcome this drawback we have come up with an idea and this idea will help the government and it will save the time of the employees working in these boards as system supports if we use smartcard to imp lement prepaid energy meter then it will be helpful to store data in a smartcard of that user. The aim of the project is to automate the prepaid billing of energy meter and wa ter meter. In this project the front end is User friendly and the employees can work on this software with minimum knowledge of Computers. Employees can read th e meter by sitting in the Office. For front end designing Java is used. COMPONENTS USED:

Microcontroller Real Time Clock EEPROM Memory LCD Power Supply GSM modem

: AT89C51 : DS1307 : AT24C04 (4K) : 2x16 characters : 5v DC : 900/1800 MHz

SOFTWARES USED: Embedded KEIL m-vision WORKING PRINCIPLE: This project is useful for billing purpose in Electricity board and in w ater authority. Instead of going to every house & taking the readings, in this p roject by just sending an SMS we can receive the readings of the house and we ca n recharge the electric bill. This system uses Java Basics software, which is de signed as the application platform to send or receive SMS using the Modem, then process and stores the data. Java software has two main functions 1) to interact with Modem and read the COM port 2) maintain the database. In this project the micro controller & the GSM unit is interfaced with t he Energy meter/water meter of each house. Every house has a separate number, wh ich is given by the corresponding authority. The GSM unit is fixed in the energy meter/water meter. The amount of consumption is stored in memory authority as SMS. Using th is software we can send the SMS through Modem to that particular number which is assigned by these authorities and wait for the response. On other end the modem will receive the data in the form of a command and informs the controller to do the readings. After the readings the controller will send data to the modem. M odem, in turn sends data to the other end. In the office the GSM unit will recei ve the data and the Java software will calculate the total consumption. The numb er assigned by the authorities is Unique. Using GSM we can get the response very fast due to which time is saved. After completion of the pulse the power will c ut again consumer wants to send an SMS for recharge. This is due to reduce illegal power using with out paying the money. GSM modem (900/1800 MHz) Semens GSM/GPRS Smart Modem is a multi-functional, ready to use, rugged unit that can be embedded or plugged into any application. The Smart Modem can be control led and customized to various levels by using the standard AT commands. The mode m is fully type-approved, it can speed up the operational time with full range o f Voice, Data, Fax and Short Messages (Point to Point and Cell Broadcast), the m odem also supports GPRS (Class 2*) for spontaneous data transfer. Smart card Many companies provides a range of smart card solutions and primarily works to p rovide solutions for cashless catering in Education schools, colleges, universit ies and businesses, and also to provide turn-key loyalty solutions for all secto rs of business, including retail, salon & beauty and the restaurant and hotel in dustry.

Electronic meter The power used is displayed on an LCD, while advanced electronic meters can be r ead automatically using communication ports like optical port, RS232 or RF modul

es. These meters use a current transformer or shunt, energy metering IC and LCD display. The IC measures voltage and current, and generates a pulse output propo rtional to power. In addition to measuring energy usage used, electronic meters can also record other parameters of the load and supply such as maximum demand, power factor and reactive power factor used e.t.c.

L Load N Real Time Clock (RTC DS1307) This is used to maintain the current time in off line processing. The DS1307 Ser ial Real-Time Clock is a low power; full binary-coded decimal (BCD) clock/calendar plus 56 bytes of NV SRAM. Address and data are transferred serially via a 2-wire, bi-directional bus. The clock/calend ar provides seconds, minutes, hours, day, date, month, and year information. The end of the month dat e is automatically adjusted for months with fewer than 31 days, including corrections for leap year . The clock operates in either the 24-hour or 12-hour format with AM/PM indicator. The DS1307 has a buil t-in power sense circuit that detects power failures and automatically switches to the battery su pply. Features: It uses I2C protocol _ Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month , and day of the week, and year with leap-year compensation valid up to 2100. _Two-wire serial interface Consumes less than 500nA in battery backup mode with oscillator running Vital role of Real-time clock in Remote billing of energy meter/water meter using GSM modem is Electronic Meters: These meters have an electronic display and make use of wireless technologies li ke Bluetooth, GSM and GPRS to transfer information about electrical consumption. They have inbuilt automatic sensors which helps to detect electrical energy the ft or meter tampering. Advantages . Basic electronic meters are not just more cost-effective than mechanical meter s, but offer further benefits: measurement accuracy of the electronic meter is a bout an order of magnitude better than that of a mechanical meter, while power c onsumption is lower by about two orders of magnitude. The electronic energy mete r is also better protected against tampering than its mechanical predecessor, an GSM based energy meter GSM based remote energy meter monitoring The purpose of the system is remote monitoring and control of the Domestic Energ y meter. This system enables the Electricity Department to read the meter readin gs regularly without the person visiting each house. This can be achieved by the

use of microcontroller unit that continuously monitors and records the energy m eter readings in its permanent memory location. This system also makes use of a GSM modem for remote monitoring and control of energy meter. The microcontroller based system continuously records the readings and the live meter reading can be sent to the Electricity Department on request. This system also can be used to disconnect the power supply to the house in case of non-pay ment of electricity bills. The design has 3 major sections: Client side (Consumer) Server side (Electricity board) Transmission protocol (GSM) Client side (Consumer) This side consists of the electronic meter and the embedded system designed to b e interfaced with it. The system consists of a microcontroller used to interface the Meter and the GSM module. The module accepts data from the microcontroller and sends it to the server. At the server the data is processed and sent back to the client.

Server side (Electricity board) The server side has the GSM reception module interfaced directly to a computer ( server). The server is programmed to display all necessary details. After receiv ing data, the server processes it and sends it back to the client for display at client side. An LCD at the client side displays the information from the server i.e. bill description. Server side

Transmission Channel The GSM transmission is used to establish connection between client and server.

Once the connection is established, the consumers energy meter is on real time co nversation with the server. Since we have to transmit data over a distance of ma ny kilometers, GSM proves to be very efficient. Advantages of GSM Cheap to transmit data, unlike sending people to monitor Less risk of loss of data Transmitter section This section transmits the amount of energy consumed in units. The pulses from t he digital meter is the input to the microcontroller, the pulse is directly prop ortional to the power consumption. An energy IC is used to generate the pulses. The output of IC is connected to the counter input of the controller through an Optocoupler. Optocoupler provides the electrical isolation between circuits and it allows signal transfer without coupling wires, capacitors or transformers. P IC16F877A Microcontroller is used to count the pulses and after a specific prese t number of pulses it increments the unit. MAX232 is used as an interface betwee n PIC and the GSM module. This is to ensure that the data is transmitted seriall y to the GSM. The unit value is transmitted through GSM. An LCD module interface d with the PIC connected to the meter displays the pulses as count, instantaneou s units consumed and the bill. Receiver section This section deals with the processing of data received from different consumers . The server sends a request to the module installed at consumers end along with the specific address from where unit details have to be transmitted back. When t he required information is transmitted back, the server reads and stores it. It then issues appropriate billing function. This bill is then transmitted back to the consumer where the bill details are displayed on an LCD. Advantages Effective and efficient billing method Reduces financial costs to the electricity board i.e. cost of sending mo nitors to take the meter readings and also administrations costs are minimized. Time is saved Disadvantages High cost of initial investment into the system. GSM modem (900/1800 MHz) Semens GSM/GPRS Smart Modem is a multi-functional, ready to use, rugged unit that can be embedded or plugged into any application. The Smart Modem can be control led and customized to various levels by using the standard AT commands. The mode m is fully type-approved, it can speed up the operational time with full range o f Voice, Data, Fax and Short Messages (Point to Point and Cell Broadcast), the m odem also supports GPRS (Class 2*) for spontaneous data transfer. Units of energy The most common unit of measurement on the electricity meter is the kilowatt hou r, which is equal to the amount of energy used by a load of one kilowatt over a period of one hour, i.e. 3,600,000 joules. Electricity meters operate by contino usly measuring the instantaneous electrical power (watts) which is the integrate d against time to give energy used (joules, kilowatt hours etc).

Current sensors The basic principle behind the operation of energy meters is the use of a curren t sensor to measure the current. The measurement can then be displayed using ana logue or digital methods. Two types of sensors are available, a shunt and clip-o n current transformers. This method of measuring AC electrical energy does not r equire breaking of the mains wire, which makes it safe. The current sensor is cl ipped-on to the wire, and the sensor measures the current flowing in the live or neutral mains wire. Simply clipping on the sensor to the mains wire will allow electrical energy used by the whole house to be measured. Using a shunt for current sensing A shunt is basically a resistor working as a potential divider and is used as a current sensor in energy meters. The values of the shunt used in energy meter ap plications are typically (0.001-100). For cost reasons smaller values are used. To improve low current measurements, larger resistance are used. A shunt is a co st-effective solution for single phase distribution system. A shunt has many adv antages over current transformers: Shunts do not suffer from the DC saturation effect. Also, the phase response of a shunt is linear across the complete range of the input current. A disadvantage of shunts is that they are purely resistive, a shunt dissipates m ore power in the form of heat when high current is passed through it, increasing the overall power consumption of the energy meter. Using a current transformer for sensing A current transformer can be used as a sensor to measure the current passing thr ough the single phase lines. The turn ratio of the current transformer determine s the current in the secondary coil of the transformer. The turn ratio of the cu rrent transformer must be chosen in such a way that the current transformer does not get saturated over the full dynamic range of the energy meter. In a case wh en the current from the second coil an input to a microcontroller, a load resist or is used to convert the secondary current of the current transformer into the voltage signal. The voltage level of this signal must remain within the limits o f the analogue to digital converter used in the design of the meter. Energy Metering ICs Electronic energy meters are replacing traditional electromechanical meters in m any residential, commercial and industrial applications because of the versatili ty and low-cost afforded by electronic meter designs. This revolution has been r ealized due to the evolution of energy ICs. These meters can offer more features that were impractical with the old mechanical designs. Some of the features int roduced by the evolution of energy metering ICs are: Temper detection- to protect against meter tampering and theft of servic e . It also can measure and record energy usage at different times of the day, so utilities can bill customers for energy based on time of usage. An electronic energy meter also can enable automatic meter reading (AMR) , whereby energy metering data is transmitted to the utility over an RF, power l ine or even infrared communications link. Improved accuracy and lower power consumption. . With a mechanical meter , the error in the basic energy usage measurement is on the order of 1%. But wit h an electronic implementation, it is possible to reduce that error to less than 0.1%.

Single phase energy metering ICs with integrated oscillator The AD71056, ADE7768, andADE7769 are single-phase ICs that provide watt-hour inf ormation using pulse outputs that directly drive a stepper motor counter. The AD 71056, ADE7768, andADE7769 are pin reduced versions of ADE7755, with the enhance ment of an on-chip, precision oscillator circuit that saves as a clock source fo r the IC. The direct interface to low resistance, low cost shunt resistors also help to lower the cost of a meter built with AD71056, ADE7768, or ADE7769. The p roducts are pin compatible. The AD71056 and ADE7769 accumulate bi-directional po wer information, and the ADE7768 accumulates power only in the positive directio n providing flexibility for various billing schemes. The ADE7769 indicates the p ower is below the no load threshold by holding the calibration frequency pin hig h. This is useful to indicate a tempering or mis-wired condition. . The ADE7761 has the additional capability of billing the energy based on one current input i f the voltage input and the return current are missing. ADE7880 It is a new energy-metering IC, which offers real-time harmonic analysis for ene rgy meters and power quality monitoring equipment. It is designed for poly-phase meters, the ADE7880 energy-metering IC offers complete harmonic analysis, inclu ding magnitude and phase information, and delivers better than one percent accur acy over a dynamic range of 2000:1 up to the 63rd harmonic. 78M6612 The 78M6612 is a highly integrated, single phase AC power measurement and monito ring IC. It has four analogue inputs for measuring up to two AC loads or wall ou tlets. The 78M6612 device also include an 8-bit MPU core with 32KB of embedded F LASH, a UART interface, and a number of GPIO for easy integration into any power supply or outlet monitoring unit. The 78M6612 monitors the AC line voltages, fr equency, and load current. The embedded firmware calculates items such as RMS li ne voltage and RMS load current, watts, VA, VAR and power factor. The real time data is transmitted via serial interface to a PC for display. FM7755 The FM7755 is a high accuracy electrical measurement IC, it adopts CMOS technolo gy. The analogue circuitry in the FM7755 is in the data sampling, ADC and refere nce voltage supply. All other signal processing (e.g. multiplication and filteri ng) is carried out in the digital domain. This approach provides superior stabil ity and accuracy over extreme environmental conditions and over time. The energy meter using the FM7755 has several advantages such as low cost, high precision, low power consumption, good reliability and well adaptability to environment. I t is a single phase energy metering IC. Product pinout Description ADE7566,Single-Phase Energy Measurement IC With 8052 MCU, RTC, And LCD D river The ADE7566/ADE7569 integrate Analog Devices, Inc. Energy (ADE) metering IC analog front end and fixed function DSP solution with an enhanced 8052 MCU c ore, an RTC, an LCD driver, and all the peripherals to make an electronic energy meter with an LCD display ... ADE7569,Single-Phase Energy Measurement IC With 8052 MCU, RTC, And LCD D river The ADE7566/ADE7569 integrate Analog Devices, Inc. Energy (ADE) metering IC analog front end and fixed function DSP solution with an enhanced 8052 MCU c ore, an RTC, an LCD driver, and all the peripherals to make an electronic energy meter with an LCD display ... ADE7762,Polyphase Energy Metering IC With Phase Drop Indication The ADE7762 is a high accuracy polyphase electrical Energy Measurement I C. The ADE7762 specifications surpass the accuracy requirements as quoted in the IEC62053-21 standard. The only analog circuitry used in the ADE7762 is in the analog-to-digital ... ADE7752B,3-Phase, 3-Wire, And 4-Wire Energy Metering IC With Pulse Outpu

t The ADE7752B is a high accuracy polyphase electrical Energy Measurement IC. The ADE7752B specifications surpass the accuracy requirements as quoted in t he IEC62053-21 standard. The only analog circuitry used in the ADE7752B is in th e analog-to-digital ... MCP3905,Energy-Metering ICs With Active (Real) Power Pulse Output MCP3905 The MCP3905/MCP3906 devices are energy-metering ICs designed to support the IEC 62053 International Metering Standard Specification. They supply a frequency output proportional to the average active (real) power, as well as a higher-frequency ... MCP3905A,Energy Metering ICs With Active Real Power Pulse Output MCP3905A The MCP3905A/MCP3905L/MCP3906A devices are energy-metering ICs designed to support the IEC 62053 international metering standard specification. They supply a frequency output proportional to the average active real power, a s well as a ... MCP3905L,Energy Metering ICs With Active Real Power Pulse Output MCP3905L The MCP3905A/MCP3905L/MCP3906A devices are energy-metering ICs designed to support the IEC 62053 international metering standard specification. They supply a frequency output proportional to the average active real power, a s well as a higher-frequency ... MCP3906,Energy-Metering ICs With Active (Real) Power Pulse Output MCP3906 The MCP3905/MCP3906 devices are energy-metering ICs designed to support the IEC 62053 International Metering Standard Specification. They supply a frequency output proportional to the average active (real) power, as well as a higher-frequency ... MCP3906A,Energy Metering ICs With Active Real Power Pulse Output MCP3906A The MCP3905A/MCP3905L/MCP3906A devices are energy-metering ICs designed to support the IEC 62053 international metering standard specification. They supply a frequency output proportional to the average active real power, a s well as a higher-frequency ... MCP3909,Energy Metering IC With SPI Interface And Active Power Pulse Out put MCP3909 Energy Metering IC with SPI Interface and Active Power Pulse Out put The MCP3909 device is an energy-metering IC designed to support the IEC 6205 3 international metering standard specification. It supplies a frequency output proportional to the ... STPM01,Programmable Single Phase Energy Metering IC With Tamper Detectio n The STPM01 is designed for effective measurement of active, reactive and apparent energy in a power line system using Rogowski Coil, Current Transformer and Shunt sensors. This device can be implemented as a single chip 1-phase ener gy meter or as a ... STPM11,Single Phase Energy Metering IC With Pulsed Output And Digital Ca libration The STPM11, STPM12, STPM13, STPM14 family is designed for effective meas urement of active energy in a power line system using a Rogowski Coil, current t ransformer and shunt sensors. This device is specifically designed to provide al l the necessary ... AS8118,Single Phase Instantaneous Energy Metering IC With On-chip Digita l Calibration And Programming The AS8118 is a very accurate single-phase bi-directional instantaneous Energy Measurement integrated circuit, which surpasses all the accuracy requirem ents for IEC1036 alternating current static watt-hour meters. The measured energ y is converted into ... AS8168,Single Phase Average Energy Metering IC With On-chip Digital Cali bration And Programming The AS8168 is a very accurate single-phase bi-directional average Energy Measurement integrated circuit, which surpasses all the accuracy requirements f or IEC1036 alternating current static watt-hour meters. The measured energy is c onverted into pulses ...

AS8218,Highly Integrated Single Phase 2-Current Energy Metering Integrat ed Circuits With Microcontroller, RTC, Programmable Multi-Purpose I/Os And LCD D river The AS8218 / AS8228 are highly integrated CMOS single-phase energy meter ing devices for fully electronic LCD meter systems. The AS8218 / AS8228 have bee n designed to ensure the meters full compliance with the international Standards IEC6052 and ANSI. ... AS8267,Single Phase 2-current Energy Metering System IC With Integrated Measurement Front-end, MCU, RTC, 9 X Programmable I/O And 80-segment LCD Driver, Embedded 32kByte Flash Memory, Temperature Sensor The AS8267 / AS8268 are highly integrated CMOS single-phase energy meter ing devices for fully electronic LCD meter systems. The AS8267 / AS8268 have bee n designed to ensure a meters full compliance with the international Standards I EC62052 and ANSI. ... SC7755,ELECTRICITY POWER METER CIRCUIT The SC7755 is a high accuracy electrical Energy Measurement IC that can provides superior stability and accuracy over extremes in environmental conditio ns and over time. The SC7755 does not exhibit any creep when there is no load. T he SC7755 supplies ... SC3333,ENERGY METERING IC WITH PULSE OUTPUT The SC3333 is a high accuracy electrical Energy Measurement IC that can provides superior stability and accuracy over extremes in environmental conditio ns and over time. The SC3333 does not exhibit any creep when there is no load. T he ... SC7751,ELECTRICITY POWER METER CIRCUIT The SC7751 is a high accuracy fault-tolerant electrical Energy Measureme nt IC that can provides superior stability and accuracy over extremes in environ mental conditions and over time. The SC7751 does not exhibit any creep when ther e is no load. The ... ADE5569,Single-Phase Energy Measurement IC With 8052 MCU, RTC, And LCD D river The ADE5166/ADE5169/ADE5566/ADE5569 integrate Analog Devices, Inc., ener gy (ADE) metering IC analog front end and fixed function DSP solution with an en hanced 8052 MCU core, a full RTC, an LCD driver, and all the peripherals to make an electronic ... ADE7166,Single-Phase Energy Measurement IC With 8052 MCU, RTC, And LCD D river The ADE7566/ADE7569/ADE7166/ADE7169 integrate Analog Devices, Inc., ener gy (ADE) metering IC analog front end and fixed function DSP solution with an en hanced 8052 MCU core, an RTC, an LCD driver, and all the peripherals to make an electronic energy ... ADE7751,Energy Metering Ic With On-chip Fault Detection - Analog Devices The ADE7751 is a high-accuracy, fault-tolerant electrical energy measure ment IC that is intended for use with 2-wire distribution systems. The part spec ifications surpass the accuracy require- ments as quoted in the IEC1036 standard . The only analog ... ADE7753,Active And Apparent Energy Metering Ic With Di/dt Sensor Interfa ce - Analog Devices The ADE7753 is an accurate active and apparent energy measurements IC wi th a serial interface and a pulse output. The ADE7753 incorporates two second or der sigma delta ADCs, a digital integrator (on CH1), reference circuitry, temper ature sensor, and all ... ADE7755,Energy Metering Ic With Pulse Output - Analog Devices The ADE7755 is pin compatible with the AD7755. The only difference betwe en the ADE7755 and the AD7755 is that the ADE7755 features a synchronous CF and F1/F2 outputs under all load conditions. The ADE7755 is a high accuracy electric al energy ... ADE7756,Active Energy Metering Ic With Serial Interface - Analog Devices

The ADE7756 is a high-accuracy electrical power measurement IC with a se rial interface and a pulse output. The ADE7756 incorporates two second-order sig ma-delta ADCs, reference circuitry, temperature sensor, and all the signal proce ssing required to ... ADE7758,Poly Phase Multifunction Energy Metering Ic With Per Phase Infor mation - Analog Devices The ADE77581 is a high accuracy 3-phase electrical energy measurement IC with a serial interface and two pulse outputs. The ADE7758 incorporates secondorder - ADCs, a digital integrator, reference circuitry, temperature sensor, and all the signal ... ADE7759,Active Energy Metering Ic With Di/dt Sensor Interface - Analog D evices The ADE7759 is an accurate active power and Energy Measurement IC with a serial interface and a pulse output. The ADE7759 incor- porates two second orde r - ADCs, a digital integrator (on CH1), reference circuitry, temperature sensor , and all the signal ... ADE7760,Energy Metering Ic With On-chip Fault Detection - Analog Devices The ADE7760 is a high accuracy, fault tolerant, electrical energy measur ement IC intended for use with 2-wire distribution systems. The part specificati ons surpass the accuracy require- ments as quoted in the IEC61036 standard. The only analog ... ADE7761,Energy Metering Ic With On-chip Fault And Missing Neutral Detect ion - Analog Devices The ADE7761 is a high accuracy, fault tolerant, electrical energy measur ement IC intended for use with 2-wire distribution systems. The part specificati ons surpass the accuracy require- ments as quoted in the IEC61036 standard. The only analog ... ADE7763,Single-phase Active And Apparent Energy Metering Ic - Analog Dev ices The ADE77631 features proprietary ADCs and fixed function DSP for high a ccuracy over large variations in environmental conditions and time. The ADE7763 incorporates two second- order, 16-bit - ADCs, a digital integrator (on Ch1), re ference circuitry, ... ADE7769,Energy Metering Ic With Integrated Oscillator And No-load Indica tion - Analog Devices The ADE77691 is a high accuracy electrical energy metering IC. It is a p in reduction version of the ADE7755 with an enhanced, precise oscillator circuit that serves as a clock source to the chip. The ADE7769 eliminates the cost of a n external crystal ... Hot categories Regulators Linear Voltage Regulators Low Drop Out Regulators Shunt Regulators Switching Regulators DC-DC Converters DC-DC Controllers Charge Pumps Step-down Step-up Power Factor Controllers Battery Chargers Battery Protectors & Monitors Display & LED Power www.tcil-india.com CHAPTER 3 DESIGN

Component details Specification of components Current requirements, of components Cost analysis and availability

MY DESIGN FLOW DIAG Liquid crystal display Liquid crystal displays are an easy way of display information to the user; para llax errors introduced by analogue meters are removed. They provide useful inter face to the user, the display can be one line or two lines, each line has 16 cha racters. Messages giving the user instructions can be displayed and these applic ations make the device easy to use, a program in the microcontroller provides th ese instructions. Liquid crystal display (LCD) is used in this project instead of LEDs or analogue display, this is due to the declining prices of LCD, the ability to display num bers, characters and graphics, incorporation of a refreshing controller into the LCD thereby relieving the CPU of the task of refreshing the LCD and also the ea se of programming for characters and graphics. Pin description of an LCD The LCD used in this project is a 162 character and a description of the pins and how it is programmed is given in the section below: Fig showing LCD pins VCC, VSS, VEE The voltage Vcc and Vss are provided +5V and ground respectively, while VEE is u sed for controlling LCD contrast. Variable voltage between ground and Vcc is us ed to specify the contrast of the characters on the LCD. RS (register select) There are two important registers inside the LCD. If RS is 0, the instruction co mmand code register is selected allowing the user to send a command such as clea r display, .etc. If RS is 1, the data is selected, allowing to send data to be di splayed on the LCD. R S (read& write) The R W input allows to write information from it. R W is 1, when it reads and R W is 0, when it is writing. EN (enable) The enable pin is used by the LCD to latch information presented to its data pin s. When data is supplied to the data pins, a high power, a high-to-low pulse mus t be applied to this pin in order for the LCD to latch in the data present at th e data pins. D0-D7 (data lines) The 8-bit data pins, D0-D7, are used to send information to the LCD or read the contents of the LCD~s internal registers. To display the letters and numbers set RS equal to one. When RS is 0 the LCD will be receiving information. The busy flag is D7 and can be read when R W is 1 and RS is 0, as follows: if R W is 1 a nd RS is 0, when D7 is 1, the LCD is busy taking care of internal operations and will not accept any information. When D7 is 0, the LCD is ready to receive new information. Ways to display price signals The most common and attractive way is use of LCD. Several other ways can be used

to display cost signals, ranging from stoplights to plug-in LED indicators or a lphanumeric LEDs. LED dis plays are available in seven segment and starburst for mat. Seven-segment display handle all numbers and a limited set of letters. Star burst displays can display all letters. Seven-segment LED displays were widespre ad use in the 1970s and 1980s, but increasing use of liquid crystal displays, wi th their lower power consumption and greater display flexibility, has reduced th e popularity of numeric and alphanumeric LED display. MICROCONTROLLER 6.1 INTRODUCTION 6.2 PIN DIAGRAM OF MICROCONTROLLER 6.2.1 PIN DESCRIPTION 6.3 ARCHITECTURE OF 89C51 6.4 MEMORY ORGANIZATION 6.5 ADDRESSING MODES 6.6 REGISTER INSTRUCTION 6.7 INTERRUPTS 6.8 OSCILLATOR AND CLOCK CIRCUIT 6.9 APPLICATIONS OF MICROCONTROLLER PIC16F877A The microcontroller used in this project is PIC16F877A, it has 40-pins. It can b e programmed over 10,000 times and it is very easy to program. The microcontroll er used here is the PIC 16F877A. PIC is a family of Harvard architecture microco ntrollers made by Microchip Technology, derived from the PIC1640 originally deve loped by General Instrument s Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller". It is widely used due to its low cost, wide availability, large user base, extensive collection of application no tes, availability of low cost or free development tools, and serial programming (and re-programming with flash memory) capability. Microcontroller is a true com puter on a chip. It also has additional features needed to make a complete compu ter like ROM, ROM, parallel input-output, serial input-output, counters and a cl ock circuit. A microcontroller is an integrated circuit used for the purpose of controlling some device hence the name microcontroller. Pin diagram of the microcontroller The pin diagram for the microcontroller is shown below:

Some of the core features of PIC16F877A are: High performance RISC CPU Only 35 single word instructions Operating speed of about DC-20MHz clock input It has a large interrupting capability-up to 20 sources Programmable code protection Extended temperature ranges The characteristics of the PIC16F877A microcontroller are: 8K X 14 program memory 368 X8 user RAM register 40 bi-directional ports Internal oscillator Interrupts The PIC contains 2 separate memory blocks, which can be accessed simultaneously Program memory Data memory

Reset signal In order that the microcontroller can operate properly, a logic 0 (0V) must be a pplied to the reset pin RS. The push button connecting the reset pin RS to power

supply VCC is not necessary. However, it is almost always provided because it e nables the microcontroller safe return to normal operating conditions if somethi ng goes wrong. 5V is brought to this pin, the microcontroller is reset and progr am starts execution from the beginning. Clock signal Even though the microcontroller has a built-in oscillator, it cannot operate wit hout two external capacitors and quartz crystal which stabilize its operation an d determines its frequency (operating speed of the microcontroller). The value o f the capacitors used does not need to be precise, there should be in the range 22-30pf and the crystal ranges 4-20MHz SA2002H Description The SA2002H is a CMOS mixed signal analogue or digital integrated circuit, which performs power or energy calculations across a power range of 1000:1. The integ rated circuit includes all the required functions for single phase power and ene rgy measurement. The SA2002H generates pulses, the frequency of which is proport ional to the measured power consumption. One frequency output (FOUT) is availabl e. The pulse rate follows the instantaneous power consumption measured. This is the energy or power measurement IC, this is an enhancement of the SA9620 H. The addition of an internal oscillator in the chip makes the difference betwe en the two ICs. The IC is a single phase bi-directional power or energy metering integrated circuit that generates a pulse rate output with a frequency proporti onal to the power consumption. The SA2002H performs a calculation for active pow er. The method of calculation takes the power factor into account. Energy consum ption can be determined by the power measurement being integrated over time. Features of the SA2002H Bi-directional power and energy measurement Adaptable to different types of current sensors i.e. shunts current tran sformers or a combination of both. Operates over a wide temperature range (negative 25 to +85 degrees Celsi us) Precision oscillator on-chip Total power consumption rating below 25mW. Pin configuration Power calculation In the circuit below, the voltage drop across the shunt is converted to a current by means of resistors R1 and R2. The current sense input saturates at an input current of 25A peak. For the voltage sensor input, the mains voltage 220 VAC is divided down through a divider (R3, R4 and P1). The current into the A D converter input is set at a nominal mains voltage, via resistor R5 (1MOhm). P1 m ay be varied for calibration purposes. The current input measured at a known in put voltage the frequency is measured. The pulse on FOUT corresponds to an energy consumption given by: vi/f Where v, i and f are input voltage, current and output frequency respectively.

Power cable A cable is needed to transmit all the power usage to a meter located in any room of preference by the electricity monitor customer. If planning to do cable sizi ng for a real installation, there is need to calculate the cable size depending on the maximum current to be transmitted in the cable and make sure that you com

ply with all electrical regulations. . POWER SUPPLY 4.1 BLOCK DIAGRAM 4.2 EXPLANATION 4.3 CIRCUIT DIAGRAM 4.4 WORKING PRINCIPLE 4.4.1 TRANSFORMER 4.4.2 BRIDGE RECTIFIER 4.5 IC REGULATOR 4.5.1 CIRCUIT DIAGRAM 4.5.2 EXPLANATION 4.5.3 VOLTAGE LIMITATIONS OF IC PARTS Power supply All digital circuits require regulated power supply. The block diagram of the po wer supply is shown below:

The power supply supplies the required energy for both the microcontroller and the associated circuits. It is the most essential part of the circuit because to run the constituent ICs circuit has to be provided with the correct amount of p ower. These ICs can run on DC power. Hence the required DC supply has to be gene rated. Description Power supply is essential in any project, a description of the various part of t he power supply below: Transformer: the function of the transformer is to step downthe voltage level fr om the available from the available 220V A.C to the desired voltage. Bridge rectifier: the function of the rectifier is to convert the alternating v oltage signal into a unidirectional voltage. This function is provided by semico nductor diodes connected in bridge configuration. Diodes 1N4007 are used as rect ifiers. Ripple rejection: the output voltage of the rectifier is unidirectional but puls ating. A capacitor of 1000Pf is used for ripple rejection. Regulation: To obtain a constant voltage specific ICs are used as voltage regula tor. Voltage regulator LM7805 is used to obtain a 5V DC. The ICs have three term inals an input, an output and a ground terminal. Voltage regulators comprise a class of widely used ICs. Regulator IC units conta in the circuitry for reference source, comparator amplifier, control device, and overload protection all in a single IC. Although the internal construction of t he IC is somewhat different from that described for discrete voltage regulator c

ircuits, the external operation is much the same. IC units provide regulation of either a fixed positive voltage, a fixed negative voltage, or an adjustably set voltage. Voltage regulator circuit

GND Fig 3. Voltage regulator cct Power supply circuit Working of the bridge rectifier: The bridge wave rectifier is used in power supply circuit. AC 220V of input sign al is given to the bridge wave rectifier circuit. During positive half cycle of the circuit diodes D1 and D3 will conduct, which produces the rectified outputs of the load. During the negative half cycle diodes D2 and D4 will conduct to pro duce the rectified output at the load. The load contains bypass capacitor, which bypasses the AC components and produces only DC components to the next circuit. Next is the IC7805, which acts as a voltage regulator to produce a positive 5V of power supply required for LCD and the KEYPAD 3x4 matrix keypad will be used It is more convenient than 4x4 y to interface with the PIC. KEYPAD 3x4 matrix keypad will be used It is more convenient than 4x4 y to interface with the PIC. in this project. because it is easy to use, also it is eas in this project. because it is easy to use, also it is eas

CHAPTER 4 PROGRAMMING THE PIC16F877A

13. PIC PROGRAM #include<pic.h> #include"lcd.h" #include"string.h" void lcd_data(unsigned char);

void lcd_command(unsigned char); void lcd_puts(const char *); void initial(void); void lcd_goto(unsigned char ); void lcd_clear(void); void delay(void); void lcd_data1(unsigned char); void lcd_command1(unsigned char); void lcd_puts1(const char *); void initial1(void); void lcd_goto1(unsigned char ); void lcd_clear1(void); void delay1(void); void transmit(unsigned char); void send_string(const char *str); char recieve(void); void dec_con(unsigned char); void dec_con1(unsigned char); void eeprom_write1(unsigned char ,unsigned char); void eeprom_write(unsigned char ,unsigned char); bank1 unsigned char count=0,unit=0,con[4]; bank1 unsigned char number1[12]="9847423116"; bank1 unsigned char bill[5]="BILL",sent[10]="AT+CMGR="; bank2 unsigned char amount[10]="00000*",flag=0; main() { unsigned char j,rec[16],dummy_data,MSG_LOC,del[10]="AT+CMGD=", data[8]="00000*" ,number[11]; unsigned char unsigned int i; TRISC=0XC0; PORTC=0X00; TRISD=0X00; PORTD=0X00; TRISB=0x01; RB1=0; TXSTA=0X24; RCSTA=0X90; SPBRG=25; initial(); lcd_puts("POWER METER"); ////// to display POWER METER for(i=0;i<10;i++) { delay(); } lcd_goto(0xc0); ///// display on next line delay(); lcd_puts("Done by K V V S"); for(i=0;i<25;i++) { delay(); ///// display waits } lcd_goto(0xc0); delay(); count=eeprom_read(0x01); ///// reads count from eeprom unit=eeprom_read(0x02); ///// reads unit from eeprom eeprom_write1(0x0b, * ); INTEDG=1; INTE=1; while(1)

{ GIE=1; lcd_clear(); delay(); lcd_goto(0x80); delay(); dec_con(unit); decimal lcd_data(con[3]+0x30); lcd_data(con[2]+0x30); lcd_data(con[0]+0x30); delay(); lcd_data( : ); delay(); dec_con(count); lcd_data(con[2]+0x30); lcd_data(con[0]+0x30); delay(); lcd_goto(0xc0); delay(); lcd_puts(bill); delay(); i=0; j=2; do { i++; j++; data[i]=eeprom_read(j); } while(data[i]!= * ); i=1; while(data[i]!= * ) { lcd_data(data[i]); delay(); i++; } while(recieve()!= + ); for(i=0;i<12;i++) { rec[i]=recieve(); } GIE=0; MSG_LOC=rec[11]; lcd_command(0x01); delay(); lcd_puts("MSG RECIEVED"); delay(); for(i=0;i<8;i++) { transmit(sent[i]); } transmit(MSG_LOC); transmit(0x0d); transmit(0x0a); for(i=0;i<39;i++) { dummy_data=recieve(); }

///// convertion of unit to

///// displays unit on lcd

////// displays "bill" on lcd

/////// read bill amount from eeprom

////// display bill on lcd

////msg alert from gsm /// "+CMTI "SM",1 recieved //// save msg location ///// display msg recieved

//// command AT+CMGR= /// msg locaction sending /// sending enter key /// leaving 39 bytes of data

for(i=0;i<10;i++) { number[i]=recieve(); number[10]= \0 ; for(i=0;i<27;i++) { dummy_data=recieve(); } j=-1; do { j++; data[j]=recieve(); while(data[j]!= * ); delay(); delay(); delay(); if(strcmp(number,number1)==0) if(data[0]== R ) { dec_con(unit); lcd_command(0xc0); delay(); lcd_puts("SENDING UNIT"); delay(); send_string("AT+CMGS="); send_string(number1); transmit(0x0d); transmit(0x0a); transmit( # ); transmit(con[2]+0x30); transmit(con[0]+0x30); transmit( * ); transmit(0x1a); while(recieve()!= + ); } } if(data[0]== B ) { flag=1; lcd_goto(0xc0); delay(); lcd_puts(bill); delay(); i=0; j=2; do { i++; j++; eeprom_write1(j, data[i]); lcd_data(data[i]); delay(); } while(data[i]!= * ); } /////// save sender number }

///// if R

///// send command AT+CMGS= ///// send server number //// send enter key ///// send unit /// send ctrl z key

//////if

B display bill

///// leaving 27 bytes of data

////// save content of msg

//// if msg from server sent unit

for(i=0;i<8;i++) { transmit(del[i]); } transmit(MSG_LOC); transmit(0x0d); transmit(0x0a); delay(); delay(); delay(); } } void transmit(unsigned char data) { TXREG=data; while(!TXIF); } char recieve(void) { while(!RCIF); RCIF=0; if(OERR) { CREN=0; CREN=1; } return(RCREG); } void send_string(const char *str) { char ps; ps = *str; while(ps) { transmit(ps); str++; ps=*str ; } } void lcd_command1(unsigned char e) { PORTD=e; RC0=0; RC1=0; RC2=1; delay1(); RC2=0; } void lcd_data1(unsigned char c) { PORTD=c; RC0=1; RC1=0; RC2=1; delay1(); RC2=0; } void lcd_goto1(unsigned char s) { lcd_command1(s);

////msg delete ///// send AT+CMGD= //// send msg location /// send enter key

} void lcd_clear1(void) { lcd_command1(0x01); } void delay1(void) { int j; for(j=0;j<2000;j++); } void initial(void) { lcd_command(0X38); lcd_command(0X01); lcd_command(0X06); lcd_command(0X0E); lcd_command(0X80); } void lcd_command(unsigned char e) { PORTD=e; RC0=0; RC1=0; RC2=1; delay(); RC2=0; } void lcd_data(unsigned char c) { PORTD=c; RC0=1; RC1=0; RC2=1; delay(); RC2=0; } void interrupt ext(void) { GIE=0; if(INTF) { INTF=0; count++; eeprom_write(0x01,count); if(count==10) { unit++; eeprom_write(0x02,unit); count=0; } lcd_goto1(0x80); delay1(); dec_con1(unit); lcd_data1(con[3]+0x30); lcd_data1(con[2]+0x30); lcd_data1(con[0]+0x30); delay1(); lcd_data1( : ); delay1(); dec_con1(count);

////// interrupt service routine

////// write count to eeprom

////// write unit to eeprom

///// display unit

////display count

lcd_data1(con[2]+0x30); lcd_data1(con[0]+0x30); GIE=1; } } void dec_con(unsigned char count) { con[0]=count%10; con[1]=count/10; con[2]=con[1]%10; con[3]=con[1]/10; } void dec_con1(unsigned char count) { con[0]=count%10; con[1]=count/10; con[2]=con[1]%10; con[3]=con[1]/10; } void eeprom_write(unsigned char adrs,unsigned char data) { EEADR=adrs; EEDATA=data; EEPGD=0; WREN=1; EECON2=0X55; EECON2=0xAA; WR=1; WREN=0; While (WR); } void eeprom_write1(unsigned char adrs,unsigned char data) { EEADR=adrs; EEDATA=data; EEPGD=0; WREN=1; EECON2=0X55; EECON2=0xAA; WR=1; WREN=0; while(WR); } unsigned char eeprom_read(unsigned char adrs) { EEADR=adrs; EEPGD=0; RD=1; while(RD); return(EEDATA); } /////// interrupt closed

CHAPTER 5 CONCLUSION AND RECOMMENDATIONS 1OR2 PAGES Applications In homes Banks Lodges Flats Rental accommodation malls Market constraints Consumers may not see any reason to get another meter and they might thi nk buying another meter is of no help. Many systems have recently emerged Many improvements are still needed Ease of installation and use Reducing the cost of devices Presentation of data to users Key related challenges related to sensor use in energy monitoring Development of new sensors Integration of sensors in a more straightforward manner Preservation of sensor performance with little human involvement Market Study The need for competitive billing system, with metering systems such as the prepa id meter having impact in most parts of the world. About 50 countries have since adopted this metering systems, countries with a monopolistic electricity supply ing companies are taking this initiative as not profitable. Rapid technological changes happening in the metering market are expected to delay the decision to g o for prepaid meters. With most resident crying on the electricity prices local ly, residents are not seeing clarity on the metering. It is necessary to have a confirmation metering system to check whether the utility meter is providing cor rect measurements, this might see real time monitoring systems having a breakthr ough. The implementation of the real time monitoring system is not dependent on the utility companies and is dependent on the general public consumer. Rapid technology changes The rapid technology changes happening in the metering market are expected to de lay the decision to go for prepaid systems. Uncertainty over the success Prepaid systems have been proven to be a success in the markets such as South Af rica hence there is bound to be uncertainty over its success. The success of the system depends on the commitment by utilities and for this they need to get con vinced on the real benefits of the system.

References www.sames.co.zw, for energy i.c

18. REFERENCES

WEBSITES: www.microchip.com www.multitech.com www.beyondlogic.org www.chiptechnologies.com www.datasheetsarchive .com www.agilent.com/find/tmdir www.google/gsm www.visiontek.co.in TEXTS: GSM 02.02: Digital Cellular telecommunications system (Phase 2+); Bearer Services (BS) supported by a GSM Public Land Mobile Network (PLMN) version 7.0.2 Release 1998. GSM 04.11: Digital cellular telecommunication system (Phase 2+); Point-to -Point (PP) Short Message Service (SMS) support on mobile radio interface version 7.0.0 Release 1998 2.0 References www.ti.com www.LDCForFreescaleSemiconductor@hibbertgroup.com www.ti.com www.LDCForFreescaleSemiconductor@hibbertgroup.com www.home-energy-metering.com/power-meter www.energymonitor.com ENERGY METERING ICs chapter 2 , compare and check availability 71M6511energy IC from pdf AN4891

MICROCONTROLLER.

Das könnte Ihnen auch gefallen