A project report on
R.F.I.D. BASED PREPAID ENERGY METER
Submitted for partial fulfillment for f or award of
Bachelor of Technology Degree in Electrical and Electronics
By
Gaurav Vinayak (Roll no-287061) Shubham Aggarwal (Roll no-287072)
Faculty of Engineering and Technology (Formerly Career Institute of Technology and Management) Faridabad,(Haryana) May 2012
1
CERTIFICATE Certificate that Gaurav Vinayak , Shubham Aggarwal has carried out the project work presented in this report titled RFID based Prepaid Energy Meter for the award of Bachelor of Engineering in Electrical and Electronics from Faculty of Engineering and Technology( Formerly Career Institute of Technology and Management),Faridabad under my supervision. The report embodies result result of original work and studies studies carried out by students themselves themselves and the content of report does form the basis for the award of any other degree to the candidate or to anybody else.
Ms Rajni Shrma (Assistant Professor)
Dr. Leena G Head of Department Electrical and Electronics Engineering
2
TABLE OF CONTENTS
TOPIC
PAGE NO
List of Figures
4
Acknowledgement
5
Abstract
6
Chapter 1 Introduction
7
a) Purpose
10
b) History
11
c) Objective
13
d) Overview
14
Chapter 2 Material and Methodology
a)
15
Block Diagram
15
b) Circuit Diagram
16
c)
18
Flow chart working
d) Material used
19
e)
42
Photo of the experimental setup
Chapter 3 Result and Discussion
43
a) Snap shots of result
44
Chapter 4 Future Scope and Applications
46
Refrences
47
3
LIST OF FIGURES
Figures
Page no
Figure 1.1 RFID tag used for vehicle identification
11
Figure 2.1 Block diagram of prepaid energy meter
15
Figure 2.2 Circuit diagram of project
16
Figure 2.3 Flow chart working
18
Figure 2.4 Analog energy meter
22
Figure 2.5 Electronic energy meter
24
Figure 2.6 Pin diagram of 8051
26
Figure 2.7 Architecture of 8051
28
Figure 2.8 Pin diagram of LCD
30
Figure 2.9 16*2 LCD
31
Figure 2.10 Logic diagram of ULN 2003
34
Figure 2.11 Test circuit of ULN 2003
35
Figure 2.12 Electromagnetic Relay
37
Figure 2.13 Contact type Relay
38
4
ABSTRACT
Radio-frequency identification (RFID) is an automatic identification method, relying on storing and remotely retrieving data using devices called RFID tags or transponders. The technology requires some extent of cooperation of an RFID reader and an RFID tag. An RFID tag is an object that can be applied to or incorporated into a product, animal, or person for the purpose of identification and tracking t racking using radio waves. Some tags can be read from several meters away and beyond the line of sight of the reader. An RFID tag is an object that can be applied to or incorporated into a product, animal, or person for the purpose of identification and tracking t racking using radio waves. Some tags can be read from several meters away and beyond the line of sight of the reader.
5
ACKNOWLEDGEMENT With profound respect and gratitude, We take the opportunity to convey our thanks to complete the project. We do extend my heartfelt thanks t hanks to Ms. Rajni Sharma for her guidance .We are extremely grateful to all the Electrical and Electronics staff of FET,MRIU for their co-operation and guidance that helped us a lot. We have learnt a lot working under them and we will always be indebted of them for this value addition in us which have been significant factor in the accomplishment of our project.
6
Chapter 1 INTRODUCTION It will be of social interest of the society and will also reduced the billing burden of the respective state electricity board one has to educate the society of its importance. There will be awareness of the energy conservation. and the best of all it will avoid the illegal practice that quite often happen in our society. It will create smart society that it need for the Nation. Smarftech.Inc is pioneer in producing RFID and smart card technology in India. Electronic
energy
meter
has
got
numerous
advantages
over
the
conventional
electromechanical meter and due to this; many countries of the world have switched to electronic metering system. But unfortunately Pakistan is still deprived of such meters. The paper is based on the final year project of the design & implementation of prepaid electronic energy meter which we are designing in order to eliminate the problems being faced by the Pakistani people. By the introduction of prepaid system in Pakistan the problem of overcharging and over billing and the trouble being faced by th e customers in paying the bills will be removed all together. Since our meter is electronic in nature, it has got no moving parts and hence the problem of stability & accuracy due to temperature changes are solved. Our meter is also tamper resistant which eradicates the chances of the theft of electricity[1]
This paper presents the design and development of a reliable PLC/RF ENergy Information System (ENIS) for promoting voluntary energy conservation benefits. With the help of monitoring and browsing energy information immediately, the price signal an d visible energy saving profile can provide incentives for customers to migrate peak demand elastically and economically. Two real-world applications of the ENIS are then reported. First, shedding peak load and diminishing energy consumption at NCTU University are explored by managing air conditioners through debit cards and energy meters (EMs). Second, in an aggregate community, the real-time pricing signals can motivate end users to shift peak demand by means of manual or automatic load controls. These examples illustrate that EMs and energy information displays with enhanced reliability are highly applicable for voluntary energy conservation in densely populated areas.[2]
Energy meter reading is a tedious and an expensive affair. The meter reader has to go and take the reading manually to issue the bill, which will later be entered in the software to 7
automate the billing and payment system. It would have reduced the laborious task and financial wastage if can automate the manual meter reading process and bill data entry process. This paper proposes a new network communication system for energy meter reading by integrating communication technology and software system along with the existing meters. A wireless or wired communication system will be integrated with electronic energy meter to have remote access over the usage of electricity. Even though they are two different modules, energy meter deliver the reading details as on when it demands by the communication system. The communication system is further connected with electricity regional/sub-regional office, which will rather act as a base station. Instead of creating a separate communication system and backbone, any of the secure existing communication service infrastructures may also be utilized to avoid any initial investments. The communication channel is identified by the consumer's number and it is secured by any cryptographic standards. Base office can verify the energy meters performance by checking the day to day consumption of energy. This will also help to avoid any tampering or break down of energy meter.[3]
Pre-paid metering and billing for gas and electricity is common in developing nations. South Africa boasts that it is the pre-paid capital of the world. But in developed nations, pre-paid billing for gas and electricity is an anathema. It may be time to change. Individuals from utility employees at Cinergy and Nevada Power that expressed a high level of interest in prepaid metering at the Spintelligent Metering, Billing, CRM/CIS Americas conference held in Chicago, IL during May 2003 and sponsored by Elester, Excelergy, Itron, Kema, and Olameter.The interest from the utilities in prepaid billing is related to the problem utilities face from bad customers and its effectiveness observed in two US test markets[4]
Prepaid electricity customers would fill up their accounts by making a payment at a payday lender or money transfer office. The retailers equate the process to filling up the gas tank on your car. You can put a little in or fill up the tank for a full month. So far, none of the state‘s registered retail electric providers offer a prepaid program that takes advantage of smart meters‘ ability abili ty to constantly monitor power usage and consumption. ―They‘re changing the game,‖ Thompson said. ‗Self -disconnection plan‘
8
Prepaid cellular phone service is a more apt comparison, Thompson says. Those services, such as the ones offered by Richardson-based MetroPCS, now make up 20% of the cell phone service market. ―The market for prepaid (electricity) is huge,‖ Thompson said. In Texas, that‘s especially true. The state is home to more than 1 million completely unbanked households — 11.7% of the state, according to a December 2009 study by the Federal Deposit Insurance Corp. An additional 2.1 million — or 24.1% of the state‘s households — households — are are categorized as underbanked. (Underbanked refers to households that have a checking or savings account but also often rely on payday loans or other such services.)[5]
9
1 a)Purpose Our main purpose of this project is to introduce the prepaid concept in electricity distribution system in India. This aims to reduce the burden of electricity department to collect bills and also to reduce the theft of electricity which is very common in countries like India. Worldwide approximately 10 million energy consumers receive prepaid electric service in nearly 40 countries. countries. Countries with high levels of prepaid prepaid electric service include include South Africa, New Zealand, and the United Kingdom . Early prepayment systems assumed that all months had 30 days, making it impossible to reconcile the records for prepaid electric service customers with those of of credit customers. Among the many problems problems this created, it made it difficult to transfer financial credits to prepaid service customers from support agencies that operated on a conventional business calendar.
10
1 b)History
Figure1.1 A RFID tag used used for vehicle vehicle identification
In 1945 Léon Theremin invented an espionage tool for the Soviet Union which retransmitted incident radio waves with audio information. Sound waves vibrated a diaphragm which slightly altered the shape of the resonator, which modulated the reflected radio frequency. Even though this device was a covert listening device, not an identification tag, it is considered to be a predecessor of RFID technology, because because it was likewise passive, being energized and activated by waves from an outside source.
Similar technology, such as the IFF transponder developed in the United Kingdom, was routinely used by the allies in World War II to identify aircraft as friend or foe. Transponders Transponders are still used by most powered aircraft to this day.
Another early work exploring RFID is the landmark 1948 paper by Harry Stockman, titled "Communication by Means of Reflected Power" (Proceedings of the IRE, pp 1196 – 1204, 1204, October 1948).
11
Mario Cardullo's device in 1973 was the first true ancestor of modern RFID, as it was a passive radio transponder with memory. The initial device was passive, powered by the interrogating signal, and was demonstrated in 1971 to the New York Port Authority and other potential users and consisted of a t ransponder with 16 bit memory for use as a toll device.
The first patent to be associated with the abbreviation RFID was granted to Charles Walton in 1983.
The largest deployment of active RFID is the US Department of Defense use of Savi active tags on every one of its more than a million shipping containers that travel outside of the continental United States.
12
1 c ) Objective A scheme of Electricity billing system called "PREPAID ENERGY METER WITH TARIFF INDICATOR" can facilitate in improved cash flow management in energy utilities and can reduces problem associated with billing consumer living in isolated area and reduces deployment of manpower for taking meter readings. Every consumer can recharge RFID tag assigned and recharge its meter at various ranges (i.e. Rs 50, Rs 100, Rs 200 etc).In our project we have given the name for RFID tag card smart card. Consumer can check its balance in LCD attached with the module and be prepare for the next recharge in advance. . There are many different types of RFID systems out in the market. They are categorized according to their frequency ranges. These frequency ranges mostly tell the RF ranges of the tags from low frequency tag ranging from 3m to 5m, mid-frequency ranging from 5m to 17m and high frequency ranging from 5ft to 90ft.
13
1 d)Overview A radio-frequency identification system uses tags, or labels attached to the objects to be identified. Two-way radio transmitter-receivers called interrogators or readers send a signal to the tag and read its response. The readers generally transmit their observations to a computer system running RFID software or RFID R FID middleware. The tag's information is stored electronically in a non-volatile memory. The RFID tag includes a small RF transmitter and receiver. An RFID reader transmits an encoded radio signal to interrogate the tag. The tag receives the message and responds with its identification information. This may be only a unique tag serial number, or may be product-related information such as a stock number, lot or batch number, production date, or other specific information. RFID tags contain at least two parts: an integrated circuit for storing and processing information, modulating and demodulating a radio-frequency (RF) signal, collecting DC power from the incident reader signal, and other specialized functions; and an antenna for receiving and transmitting the signal.
14
Chapter 2 MATERIAL AND METHOLOGY
2 a)Block Diagram
Figure 2.1 Block Diagram of prepaid prepaid energy meter When the consumer insert a smart card into the card reader which is connected in prepaid energy meter with tariff indicator LCD.Then the card reader will read the stored information using the MC program. That smart card cannot be reused by others. Suppose if a consumer buy a card for Rs.50/- he / she can insert this amount through the card reader so that prepaid energy meter with tariff indicator kit will be activated. According to the power consumption the amount will be reduced. When the amount is over, the relay will automatically shutdown the whole system. In our project we also have a provision to display remaining amount so that he can done his recharges on time.
15
2 b)Circuit Diagram
Figure 2.2 2.2 Circuit Diagram of project project
16
Above figure is the basic circuit diagram of RFID based prepaid energy meter. It consists of six main components like a microcontroller, digital energy meter, connector IC, LCD etc. Microcontroller is the brain and most important part of our circuit. Each and every part is either directly or indirectly connected to the microcontroller. Energy meter and reset switch are connected to the port 1 of controller. LCD is connected at port 2 and relay is also connected to port 2 via connector IC( ULN 2003). Energy meter is connected to power supply as well as load. When tag is swiped over card reader, the value stored in that card get stored in microcontroller. When reach unit is consumed, a signal is produced by the energy meter and a decrement is done from stored value. When this value becomes zero, a signal is given to relay which disconnects supply from load. A LCD is provided to display the remaining value of units.
17
2 c) Flow Chart Working
Figure 2.3 Flow Chart First of all the energy meter will get the power supply and connected connected to load. When RFID tag is swiped over the card reader, an initial value is set in microcontroller, which is taken as our recharge or we can say available units. With each unit consumption of power the energy meter will provide signal to the microcontroller and the stored value is decremented by one each time. When the stored value become zero a signal is given to relay through ULN2003 which in turn disconnects power supply from load. When card is again swiped , recharge is done and supply again get connected to load.
18
2 d) Material used 1.RFID module
A basic RFID system consists of three components: •
An antenna or coil
•
A transceiver (with decoder)
•
A transponder (RF tag) electronically programmed with unique information
These are described below: 1.
ANTENNA
The antenna emits radio signals to activate the tag and read and write data to it. Antennas are the conduits between the tag and the transceiver, which controls the system's data acquisition and communication. Antennas Antennas are available in a variety of shapes and sizes; they can be built into a door frame to receive tag data from persons or things passing through the door, or mounted on an interstate tollbooth to monitor traffic passing by on a freeway. The electromagnetic field produced by an antenna can be constantly present when multiple tags are expected continually. If constant interrogation is not required, a sensor device can activate the field. 1.
TRANSRECEIVER
Often the antenna is packaged with the transceiver and decoder to become a reader (a.k.a. interrogator), which can be configured either as a handheld or a fixed-mount device. The reader emits radio waves in ranges of anywhere from one inch to 100 feet or more, depending upon its power output and the radio frequency used. When an RFID tag passes through the electromagnetic zone, it detects the reader's activation signal. The reader decodes the data encoded in the tag's integrated circuit (silicon chip) and the data is passed to the host computer for processing. 2.
TAGS (Transponders)
An RFID tag is comprised of a microchip containing identifying information and an antenna that transmits this data wirelessly to a reader. At its most basic, the chip will contain a serialized identifier, or license plate number, that uniquely identifies that item, similar to the way many bar codes are used today. A key difference, however is that RFID tags have a higher data capacity than their bar code counterparts
19
Radio-frequency identification (RFID) is the use of a wireless non-contact system that uses radio-frequency electromagnetic fields to transfer data from a tag attached to an object, for the purposes of automatic identification and tracking. Some tags require no battery and are powered by the electromagnetic fields used to read them. Others use a local power source and emit radio waves (electromagnetic radiation at radio frequencies). The tag contains electronically stored information which can be read from up to several metres (yards) away. Unlike a bar code, the tag does not need to be within line of sight of the reader and may be embedded in the tracked object. RFID tags are used in many industries. An RFID tag attached to an automobile during production can be used to track its progress through the assembly line. Pharmaceuticals can be tracked through warehouses. Livestock and pets may have tags injected, allowing positive identification of the animal. RFID identity cards can give employees access to locked areas of a building, and RF transponders mounted in automobiles can be used to bill motorists for access to toll roads or parking. Since RFID tags can be attached to clothing, possessions, or even implanted within people, the possibility of reading personally-linked information without consent has raised privacy concerns. RFID can be used in a variety of applications such as:
Access management
Tracking of goods
Tracking of persons and animals
Toll collection and contactless payment
Machine readable travel documents
Smartdust (for massively distributed sensor networks)
Tracking sports memorabilia to verify authenticity
Airport baggage tracking logistics
A radio-frequency identification system uses tags, or labels attached to the objects to be identified. Two-way radio transmitter-receivers called interrogators or readers send a signal to the tag and read its response. r esponse. The readers generally generally transmit their observations to a computer system running RFID software or RFID middleware. 20
The tag's information is stored electronically in a non-volatile memory. The RFID tag includes a small RF transmitter and receiver. An RFID reader transmits an encoded radio signal to interrogate the tag. The tag receives the message and responds with its identification information. This may be only a unique tag serial number, or may be product-related information such as a stock number, lot or batch number, production date, or other specific information. RFIDs are easy to conceal or incorporate in other items. For example, in 2009 researchers at Bristol University successfully glued RFID micro-transponders to live ants in order to study their behavior. This trend towards increasingly miniaturized RFIDs is likely to continue as technology advances. Hitachi holds the record for the smallest RFID chip, at 0.05mm × 0.05mm. This is 1/64th the [17]
size of the previous record holder, the mu-chip. mu-chip .
Manufacture is enabled by using the
silicon-on-insulator (SOI) process. These dust-sized chips can store 38-digit numbers using 128-bit Read Only Memory (ROM). (ROM).
[18]
A major challenge is the attachment of the antennas,
thus limiting read range to only millimeters. In 2010 three key factors drove a significant increase in RFID usage: decreased cost of equipment and tags, increased performance performance to a reliability r eliability of 99.9% and a stable international standard around UHF passive RFID. The adoption of these standards were driven by EPCglobal, a joint venture between GS1 and GS1 US, which were responsible for driving global adoption of the barcode in the 1970s and 1980s. The EPCglobal Network was developed by the Auto-ID Center, an academic research project headquartered at the Massachusetts Institute of Technology (MIT) with labs at five leading research universities around the globe: Cambridge, Adelaide, Keio, Shanghai, Fudan, St. Gallen .
[19]
At RFID
Journal Live 2010 in Orlando, Airbus detailed 16 active projects, IBM and — most most recently added to the team — CSC. CSC. The two other areas of significant use are financial services for IT asset tracking and healthcare. RFID is becoming increasingly prevalent as the price of the technology decreases 2.Energy meter
An electricity meter or energy meter is a device that measures the amount of electric of electric energy consumed by a residence, business, or an electrically powered device. 21
Electricity meters are typically calibrated in billing units, the most common one being the kilowatt hour [kWh]. Periodic readings of electric meters establishes billing cycles and energy used during a cycle. In settings when energy savings during certain periods are desired, meters may measure demand, the maximum use of power in some interval. in terval. "Time of day" metering allows electric rates to be changed during a day, to record usage during peak high-cost periods and off-peak, lower-cost, periods. Also, in some areas meters have relays for demand response shedding of loads during peak load periods The most common unit of measurement on the electricity meter is the kilowatt hour [kWh], which is equal to the amount of energy used by a load of on ekilowatt over a period of one hour, or 3,600,000 joules. Some electricity companies use the SI megajoule instead. Demand is normally measured in watts, but averaged over a period, most often a quarter or half hour. Reactive power is measured in "thousands of volt-ampere of volt-ampere reactive-hours", reactive-hours", (kvarh). By convention, a "lagging" or inductive load, such as a motor, will have positive reactive power. A "leading", or capacitive load, will have negative reactive power. Volt-amperes measures all power passed through a distribution network, including reactive and actual. This is equal to t o the product of root-mean-square volts and amperes. Distortion of the electric current by loads is measured in several ways. Power factor is the ratio of resistive (or real power) to volt-amperes. A capacitive load has a leading power factor, and an inductive load has a lagging power factor. A purely resistive load (such as a filament lamp, heater or kettle) exhibits a power factor of 1. Current harmonics are a measure of distortion of the wave form. For example, electronic loads such as computer power supplies draw their current at the voltage peak to fill their internal storage elements. This can lead to a significant voltage drop near the supply voltage peak which shows as a flattening of the voltage waveform. This flattening causes odd harmonics which are not permissible if they exceed specific limits, as they are not only wasteful, but may interfere with the operation of other equipment. Harmonic emissions are mandated by law in EU and other countries to fall within specified limits.
22
Figure 2.4 Analog Energy Meter In addition to metering based on the amount of energy used, other types of metering are available.Meters which measured the amount of charge (coulombs) used, known as amperehour meters, were used in the early days of electrification. These were dependent upon the supply voltage remaining constant for accurate measurement of energy usage, which was not a likely circumstance with most supplies. Some meters measured only the length of time for which charge flowed, with no measurement of the magnitude of voltage or current being made. These were only suited for constant-load applications.Neither applications.Neither type is likely to be used today. Electricity meters operate by continuously measuring the instantaneous voltage (volts) and current (amperes) and finding the product of these to give instantaneous electrical power (watts) which is then integrated against time to give energy used (joules, kilowatthours etc.). Meters for smaller services (such as small residential customers) can be 23
connected directly in-line between source and customer. For larger loads, more than about 200 ampere of load,current load,current transformers are used, so that the meter can be located other than in line with the service conductors. The meters fall into two basic categories, electromechanical electromechanical and electronic. Electronic meters display the energy used on an LCD or LED display, and can also transmit readings to remote places. In addition to measuring energy used, electronic meters can also record other parameters of the load and supply such as maximum demand, power factor and reactive power used etc. They can also support time-of-day billing, for example, recording the amount of energy used during on-peak and off-peak hours.
Figure 2.5 2.5 Electronic Energy Energy Meter
24
3.Microcontroller
The Intel 8051 microcontroller is one of the most popular general purpose microcontrollers in use today. The success of the Intel 8051 spawned a number of clones which are collectively referred to as the MCS-51 family of microcontrollers, which includes chips from vendors such as Atmel, Philips, Infineon, and Texas Instruments. The Intel 8051 is an 8-bit microcontroller which means that most available operations are limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The Short and Standard chips are often available in DIP (dual in-line package) form, but the Extended 8051 models often have a different form factor, and are not "drop-in compatible". All these things are called 8051 because they can all be programmed using 8051 assembly language, and they all share certain features (although the different models all have their own special features). Some of the features that have made the 8051 popular are:
4 KB on chip program memory.
128 bytes on chip data memory(RAM).
4 reg banks.
128 user defined software flags.
8-bit data bus
16-bit address bus
32 general purpose registers each of 8 bits
16 bit timers (usually 2, but may have more, or less).
3 internal and 2 external interrupts.
Bit as well as byte addressable RAM area of 16 bytes.
Four 8-bit ports, (short models have two 8-bit ports).
16-bit program counter and data pointer.
1 Microsecond instruction cycle with 12 MHz Crystal.
8051 models may also have a number of special, model-specific features, such as UARTs, ADC, OpAmps, etc... Typical applications 8051 chips are used in a wide variety of control systems, telecom applications, robotics as well as in the automotive industry.
25
Figure 2.6 2.6 Pin diagram of the 8051 8051
26
PIN 9: PIN 9 is the reset r eset pin which is used to reset the microcontroller‘s internal registers and ports upon starting up. (Pin should be held high for 2 machine cycles.) PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only connect a crystal at these pins to provide clock pulses to the circuit. PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs +5V 500mA to function properly, although there are lower powered versions like the Atmel 2051 which is a scaled down version of the 8051 which runs on +3V. PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in flash memory. In order to program this we need to supply a voltage of +12V at pin 31. If external memory is connected then PIN 31, also called EA/VPP, should be connected to ground to indicate the presence of external memory. PIN 30 is called ALE (address latch enable), which is used when multiple memory chips are connected to the controller and only one of them needs to be selected.We will deal with this in depth in the later chapters. PIN 29 is called PSEN. This is "program store enable". In order to use the t he external memory it is required to provide the low voltage (0) on both PSEN and EA pins. Ports There are 4 8-bit ports: P0, P1, P2 and P3. PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be used for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or additional functions associated with them based upon the context of their usage.The port 1 output buffers can sink/source four TTL inputs. When 1s are written to portn1 pins are pulled high by the internal pull-ups and can be used as inputs. PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external counter inputs, read and write pins for memory access.PORT P2 (pins 21 to 28): PORT P2 can also be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P2 will act as an address bus in conjunction with PORT P0 to access external memory. memory. PORT P2 acts as A8-A15PORT P0 (pins 32 to 39) PORT P0 can be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P0 acts as a multiplexed address and data bus that can be used to access 27
external memory in conjunction with PORT P2. P0 acts as AD0-AD7, PORT P10: asynchronous asynchronous communication input or Serial synchrono s ynchronous us communication output. Oscillator circuit The 8051 requires an external oscillator circuit. The oscillator circuit usually runs around 12MHz, although the 8051 (depending on which specific model) is capable of running at a maximum of 40MHz. Each machine cycle in the 8051 is 12 clock cycles, giving an effective cycle rate at 1MHz (for a 12MHz clock) to 3.33MHz (for the maximum 40MHz clock). The oscillator circuit generates the clock pulses so that all internal operations are synchronized BasicArchitecture
Figure2.7 Architecture of 8051 28
The 8051 Microcontroller can be programmed in PL/M, 8051 Assembly, C and a number of other high-level languages. Many compilers even have support for compiling C++ for an 8051.Program memory in the 8051 is read-only, while the data memory is considered to be read/write accessible. When stored on EEPROM or Flash, the program memory can be rewritten when the microcontroller is in the special programmer circuit
.
The 8051 starts executing program instructions from address 0000 in the program memory. The A register is located l ocated in the SFR memory location 0xE0. The A register works in a similar fashion to the AX register of x86 processors. The A register is called the accumulator, and by default it receives the result of all arithmetic operations. The Special Function Register (SFR) is the upper area of addressable memory, from address 0x80 to 0xFF. A, B, PSW, DPTR are called SFR.This area of memory cannot be used for data or program storage, but is instead a series of memory-mapped ports and registers. All port input and output can therefore be performed by memory mov operations on specified addresses in the SFR. Also, different status registers are mapped into the SFR, for use in checking the status of the 8051, and changing some operational parameters of the 8051. The 8051 has 4 selectable banks of 8 addressable 8-bit registers, R0 to R7. This means that there are essentially 32 available general purpose registers, although only 8 (one bank) can be directly accessed at a time. To access the other banks, we need to change the current bank number in the flag status register. The A register is located l ocated in the SFR memory location 0xE0. The A register works in a similar fashion to the AX register of x86 processors. The A register is called the accumulator, and by default it receives the result of all arithmetic operations. The B register is used in a similar manner, except that it can receive the extended answers from the multiply and divide operations. When not being used for multiplication and Division, the B r egister is available as an extra general-purpose register. 4.LCD
A liquid crystal display (LCD) is a flat panel display, electronic visual display, or video display that uses the light modulating properties of liquid crystals (LCs). LCs do not emit light directly.LCDs are used in a wide range of applications, including computer monitors, television, instrument panels, aircraft cockpit displays, signage, etc. They are common in consumer devices such as video players, gaming devices, clocks, watches, calculators, and telephones. LCDs have replaced cathode ray tube (CRT) displays in most applications. They are available in a wider range of screen sizes than CRT and plasma displays, and since they do not use phosphors, they cannot suffer image burn-in. LCDs are, however, susceptible to 29
image persistence. The LCD is more energy efficient and offers safer disposal than a CRT. Its low electrical power consumption enables it to be used in battery-powered battery-powered electronic equipment. It is an electronically modulated optical device made up of any number of segments filled with liquid crystals and arrayed in front of a light source (backlight) or reflector to produce images in color or monochrome. The most flexible ones use an array of small pixels. The earliest discovery leading to the development of LCD technology, the discovery of liquid crystals, dates from 1888. By 2008, worldwide sales of televisions with LCD screens had surpassed the sale of CRT units
. Figure 2.8 Pin Diagram of LCD LCD
30
Figure 2.9 16*2 LCD
Monochrome passive-matrix LCDs were standard in most early laptops (although a few used plasma displays) and the original Nintendo Game Boy until the mid-1990s, when color active-matrix became standard on all laptops. The commercially unsuccessful Macintosh Portable (released in 1989) was one of the first to use an active-matrix display (though still monochrome). Passive-matrix LCDs are still used today for applications less demanding than laptops and TVs. In particular, these are used on portable devices where less information content needs to be displayed, lowest power consumption (no backlight) and low cost are desired, and/or readability in direct sunlight is needed. Displays having a passive-matrix structure are employing super-twisted nematic STN or double-layer STN (DSTN) technology (the latter of which addresses a color-shifting problem with the former), and color-STN (CSTN) in which color is added by using an internal filter. STN LCDs have been optimized for passive-matrix addressing. They exhibit a sharper threshold of the contrast-vs-voltage characteristic than the original TN LCDs. This is important, because pixels are subjected to partial voltages even while not selected. Crosstalk 31
between activated and non-activated pixels has to be handled properly by keeping the RMS voltage of non-activated pixels below the threshold voltage while activated pixels are subjected to voltages above threshold STN LCDs have to be continuously refreshed by alternating pulsed voltages of one polarity during one frame and pulses of opposite polarity during the next frame. Individual pixels are addressed by the corresponding row and column circuits. This type of display is called passive-matrix addressed, addressed, because the pixel must retain its state between refreshes without the benefit of a steady st eady electrical charge Advantages
Very compact and light.
Low power consumption.
No geometric distortion.
Little or no flicker depending on backlight technology.
Not affected by screen burn-in.
Can be made in almost any size or shape.
No theoretical resolution limit.
Disadvantages
Limited viewing angle, causing color, saturation, contrast and brightness to vary, even within the intended viewing angle, by variations in posture.
Bleeding and uneven backlighting in some monitors, causing brightness distortion, especially toward the edges.
Smearing and ghosting artifacts caused by slow response times (>8 ms) and ―sample and hold‖ hold‖ operation.
Only one native resolution. Displaying resolutions either requires a video scaler, lowering perceptual quality, or display at 1:1 pixel mapping, in which images will be physically too large or won‘ won ‘t fill the whole screen.
Fixed bit depth, many cheaper LCDs are only able to display 262,000 colors. 8-bit SIPS panels can display 16 million colors and have significantly better black level, but are expensive and have slower response time.
Low bit depth results iin n images with unnatural or excessive contrast. contrast.
Input lag
Dead or stuck pixels may occur during manufacturing or through use. 32
In a constant-on situation, thermalization may occur, which is when only part of the screen has overheated and looks discolored compared to the rest of the screen.
Not all LCDs are designed to allow easy replacement of the backlight.
Cannot be used with light guns/pens. guns/pens.
Loss of contrast in high temperature environments.
5.ULN 2003
The ULN2003 is a monolithic high voltage and high current Darlington transistor arrays. It consists of seven NPN darlington pairs that features high-voltage outputs with commoncathode clamp diode for switching inductive loads. The collector-current rating of a single darlington pair is 500mA. The darlington pairs may be paralleled for higher current capability. Applications include relay drivers, hammer drivers, lamp drivers, display drivers(LED gas discharge),line drivers, and logic buffers. base resistor for each darlington pair for operation directly with TTL or 5V CMOS devices. FEATURES * 500mA rated collector current(Single output) * High-voltage outputs: 50V * Inputs compatibale with various types t ypes of logic. * Relay driver application
33
Figure 2.10 Logic Diagram of ULN2003
34
Test circuits
Figure 2.11 2.11 Test Circuits of ULN2003 ULN2003
35
6.Relay
A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations. A type of relay that can handle the high power required to directly control an electric motor or other loads is called a contactor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protective relays". relays". A simple electromagnetic relay consists of a coil of wire wrapped around a soft iron core, an iron yoke which provides a low reluctance path for magnetic flux, a movable iron armature, and one or more sets of contacts (there are two in the relay pictured). The armature is hinged to the yoke and mechanically linked to one or more sets of moving contacts. It is held in place by a spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this condition, one of the two sets of contacts in the relay pictured is closed, and the other set is open. Other relays may have more or fewer sets of contacts depending on their function. The relay in the picture also has a wire connecting the armature to the yoke. This ensures continuity of the circuit between the moving contacts on the armature, and the circuit track on the printed circuit board (PCB) via the yoke, which is soldered to the PCB. When an electric current is passed through the coil it generates a magnetic field that activates the armature, and the consequent movement of the movable contact(s) either makes or breaks (depending upon construction) a connection with a fixed contact. If the set of contacts was closed when the relay was de-energized, then the movement opens the contacts and breaks the connection, and vice versa if the contacts were open. When the current to the coil is switched off, the armature is returned by a force, approximately half as strong as the magnetic force, to its relaxed position. Usually this force is provided by a spring, but gravity is also used commonly in industrial motor starters. Most relays are manufactured to operate
36
quickly. In a low-voltage application this reduces noise; in a high voltage or current application it reduces arcing. When the coil is energized with direct current, a diode is often placed across the coil to dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise generate a voltage spike dangerous to semiconductor circuit components. Some automotive relays include a diode inside the relay case. Alternatively, a contact protection network consisting of a capacitor and resistor in series (snubber circuit) may absorb the surge. If the coil is designed to be energized with alternating current (AC), a small copper "shading ring" can be crimped to the end of the solenoid, creating a small out-of-phase current which increases the minimum pull on the armature during the AC cycle. cycle .
[1]
A solid-state relay uses a thyristor or other solid-state switching device, activated by the control signal, to switch the controlled load, instead of a solenoid. An optocoupler (a lightemitting diode (LED) coupled with a photo transistor) can be used to isolate control and controlled circuits.
Figure2.12 Electromagnetic Relay Relays are used to and for:
Amplify a digital signal, switching a large amount of power with a small operating power. Some special cases are:
A telegraph relay, repeating a weak signal received at the end of a long wire
Controlling a high-voltage circuit with a low-voltage signal, as in some types of modems of modems or audio amplifiers,
Controlling
a
high-current high-current circuit
with
a
low-current
signal,
as
in
the starter solenoid of an automobile,
Detect and isolate faults on transmission and distribution lines by opening and closing circuit breakers (protection relays), 37
Figure2.13 Contact type relay
Isolate the controlling circuit from the controlled circuit when the two are at different potentials, for example when controlling a mains-powered device from a low-voltage switch. The latter is often applied to control office lighting as the low voltage wires are easily installed in partitions, which may be often moved as needs change. They may also be controlled by room occupancy detectors to conserve energy,
Logic functions. For example, the boolean AND function is realised by connecting normally open relay contacts in series, the OR function by connecting normally open contacts in parallel. The change-over or Form C contacts perform the XOR (exclusive or) function. Similar functions for NAND and NOR are accomplished using normally closed contacts.
The Ladder programming language is
often
used
for
designing relay
logic networks.
The application of Boolean of Boolean Algebra to relay circuit design was formalized by Claude Shannon in A Symbolic Analysis of Relay and Switching S witching Circuits
Early computing. Before vacuum tubes and transistors, relays were used as logical elements in digital computers. See electro-mechanical computers such asARRA asARRA (computer), Harvard Mark II, Zuse Z2, and Zuse Z3.
38
Safety-critical logic. Because relays are much more resistant than semiconductors to nuclear radiation, they are widely used in safety-critical logic, such as the control panels of radioactive waste-handling machinery.
Time delay functions. Relays can be modified to delay opening or delay closing a set of contacts. A very short (a fraction of a second) delay would use a copper disk between the armature and moving blade assembly. Current flowing in the disk maintains magnetic field for a short time, lengthening release time. For a slightly longer (up to a minute) delay, a dashpot is used. A dashpot is a piston filled with fluid that is allowed to escape slowly. The time period can be varied by increasing or decreasing the flow rate. For longer time periods, a mechanical clockwork timer is installed.
Vehicle battery isolation. A 12v relay is often used to isolate any second battery in cars, 4WDs, RVs and boats.
Switching to a standby power supply.
Selection of an appropriate relay for a particular application requires evaluation of many different factors:
Number and type of contacts – contacts – normally normally open, normally closed, (double-throw)
– "Make before Break" or "Break before Make". For example, the old Contact sequence – "Make style telephone exchanges required Make-before-break so that the connection didn't get dropped while dialing the number.
– small relays switch a few amperes, large contactors are rated for up Rating of contacts – small to 3000 amperes, alternating or direct current
Voltage rating of contacts – typical control relays rated 300 VAC or 600 VAC, automotive types to 50 VDC, special high-voltage relays to about 15 000 V
Operating lifetime, useful life - the number of times the relay can be expected to operate reliably. There is both a mechanical life and a contact life; the contact life is naturally affected by the kind of load being switched.
Coil voltage – machine-tool relays usually 24 VAC, 120 or 250 VAC, relays for switchgear may have 125 V or 250 VDC coils, "sensitive" relays operate on a few milliamperes
Coil current - including minimum current required to operate reliably and minimum current to hold. Also effects of power dissipation on coil temperature at various duty cycles. 39
Package/enclosure – open,
touch-safe,
double-voltage
for
isolation
between
circuits, explosion proof, outdoor, oil and splash resistant, washable for printed circuit board assembly
Operating environment - minimum and maximum operating temperatures and other environmental considerations considerations such as effects of humidity and salt
Assembly – Assembly – Some relays feature a sticker that keeps the enclosure sealed to allow PCB post soldering cleaning, which is removed once assembly is complete.
Mounting – sockets, plug board, rail mount, panel mount, through-panel mount, enclosure for mounting on walls or equipment
Switching time – time – where where high speed is required
"Dry" contacts – contacts – when when switching very low level signals, special contact materials may be needed such as gold-plated contacts
Contact protection – protection – suppress suppress arcing in very inductive circuits
Coil protection – protection – suppress suppress the surge voltage produced when switching the coil current
Isolation between coil contacts
Aerospace or radiation-resistant testing, special quality qualit y assurance
Expected
mechanical
loads
to acceleration – acceleration –
due
some
relays
used
in aerospace applications are designed to function in shock loads shock loads of 50 g or more
Accessories such as timers, auxiliary contacts, pilot lamps, test buttons
Regulatory approvals
Stray magnetic linkage between coils of adjacent relays on a printed circuit board.
There are many considerations involved in the correct selection of a control relay for a particular application. These considerations include factors such as speed of operation, sensitivity, and hysteresis. Although typical control relays operate in the 5 ms to 20 ms range, relays with switching speeds as fast as 100 us are available. Reed relays which are actuated by low currents and switch fast are suitable for controlling small currents. As for any switch, the current through the relay contacts (unrelated to the current through the coil) must not exceed a certain value to avoid damage. In the particular case of highinductance circuits such as motors other issues must be addressed. When a power source is connected to an inductance, an input surge current which may be several times larger than the steady current exists. When the circuit is broken, the current cannot change instantaneously, which creates a potentially damaging spark across the separating contacts.
40
Consequently for relays which may be used to control inductive loads we must specify the maximum current that may flow through the relay contacts when it actuates, the make rating; the continuous rating; and the break rating. The make rating may be several times larger than the continuous rating, which is itself larger than the break rating.
41
2 e) Photo of experimental setup
42
Chapter 3 RESULTS AND DISCUSSIONS
First of all the energy meter will get the power supply and connected connected to load. When RFID tag is swiped over the card reader, an initial value is set in microcontroller, which is taken as our recharge or we can say available units. With each unit consumption of power the energy meter will provide signal to the microcontroller and the stored value is decremented by one each time. When the stored value become zero a signal is given to relay through ULN2003 which in turn disconnects power supply from load. When card is again swiped , recharge is done and supply again get connected to load.
43
3 a) Snap shots of result 1.Normal operation of setup
Normal operation of the setup. Just after swiping of tag, recharge of 5 units has been done and supply is ininterupted. LCD is showing no of units available .
2.Setup when units are finished and power supply is cut off.
44
After the units available finished, the power supply is cutoff by the relay n a yellow LED us glowing to show that the balance has been finished.LCD is showing zero units , ie no unit is available.
45
Chapter 4 FUTURE SCOPE AND APPLICATIONS
Electricity is the major demanded energy resource today. On one side the demand for it is increasing & on the other various natural resources is reducing. In such a situation, in addition to producing electricity on the large scale, "we must concentrate on the proper utilization & distribution of electricity". "RFID based energy meter is really the good electronics application", which can improve the transparency in distribution of electricity & collection of electric bills. It will also reduce the theft of electricity which is also the major cause of increasing the cost per unit for the regular customer. All the state government have to think very seriously about these factors. This type of technology will also reduce the workload & unwanted documentation. "Smart Tech Inc.", situated at Nasik Maharashtra India is well known RFID technology holders in the field of producing RFID based cards & Smart labels. "If it is possible to spread the mobile network over the whole country including each & every small village, why not the prepaid Energy meter?
46
REFERENCES 1. Ali Zaidi, S.K.; Masroor, H.; Ashraf, S.R.; Hassan, A.;(Dept. of Electron. Eng., NED Univ. of Eng. & Technol., Karachi ), Design and implementation of low cost electronic prepaid energy meter, Multitopic Conference, 2008. INMIC 2008. IEEE
International, Issue Date: 23-24 Dec. 2008 ,On page(s): 548 - 552 2.
Yute Chen Jeng Kuang Hwang(Dept. Hwang(Dept. of Electr. Eng., Eng., Yuan-Ze Univ., Taoyuan, Taoyuan, Taiwan), A reliable energy information system for promoting voluntary energy conservation benefits ,Issue Date: Jan. 2006 ,Volume: 21 Issue: 1 ,On page(s): 102 -
107 3. Das, V.V. (ACEEE, Trivandrum, India), Wireless Communication System for Energy Meter Reading, Advances in Recent Technologies in Communication and Computing, 2009. ARTCom '09. International Conference, Issue Date: 27-28 Oct.
2009 ,On page(s): 896 - 898 4. Tim Smith, PhD,(Chief Editor), Is It Time for Prepaid Gas and Electricity in the States?,May2003,
Available:
http://www.wiglafjournal.com/industry/energy-
utilities/2003/05/is-it-time-for-prepaid-gas-and-electricity-in-the-states/ lau nch prepaid 5. Chad Eric Watt , Staff writer, Ambit Energy , First Choice Power to launch electric
programs, Friday, April 9, 2010,Available:
www.bizjournals.com/
dallas/stories/2010/04/12/story2.html?page.. 6. Prepaid
Energy
Meter-
8051Micrcontroller,
Available:indianengineer.wordpress.com 7.
RFID Based Systems ,Available:www.hbeonlabs.com
8.
Muhammad Ali Mazidi,Janice G Mazidi,Rolin D Mckinlay , The nd
Microcontroller and Embedded Embed ded Systems ,2
8051
edition 2009 ,Pearson prentice hall
Microcontrollers [theory and applications], applications] , thirteenth reprint 9. Ajay V Deshmukh, Microcontrollers[theory
2009,Tata McGra-Hill education pvt. ltd.
47