You are on page 1of 56





ITS-1, IT PARK, EPIP, SITAPURA, JAIPUR-302022 (Approved by AICTE & Affiliated to the Rajasthan Technical University) Under the guidance of Vishal Rohila Project Coordinator R.N.Vishnoi BY Mohit Pandya Mayank Agrawal Mohit Mohan Saxena Himanshu Mathur

IV B.Tech. (VIII)SEMESTER, 2010 (Electrical Engineering) Submitted in partial fulfillment of degree of B.Tech in Electrical Engineering


Page | 1

In the present era of technical advancements, new technologies are getting introduced with each passing day. The field of electrical is expanding in such a way that there seems to be no technological divide among various fields. Earlier when we talked about the embedded devices, which could do anything on the instigation of a controller, it was like thinking and looking into future, but today it has become a reality. Automation is the control of any or all electrical devices either by programming control; or even by Supply command. An automated device can replace good amount of human working force, moreover humans are more prone to errors and in intensive conditions the probability of error increases. Whereas an automated device can work with diligence, versatility and with almost zero error. Our project entitled Load Sharing with Automatic Power Cut-off Looks Into Construction And Implementation of a System involving hardware to control power supply automatically. Load Sharing deals with the automatic control of power supply in various different interconnected zones i.e. the sharing of the load among the other zones in case load in one zone increases and automatic cut off of the power supply in case the total demanded load increases beyond the total installed capacity thus providing the under voltage protection. Protection against over current and overvoltage is provided. Protection against rise in temperature is also provided. Alarm determines the faulty conditions. The circuit thus enables us to utilize a electrical interconnected network which is more reliable and also helps in providing priority supply among the various zones.

Page | 2

Page No.

Abstract. 2 Certificate. Acknowledgement 1. Introduction

A. Purpose. B. Sources of project idea

4 5 6 7

C. Theoretical background. 8-9 2. Logical Block diagram 10 3. Circuit description... 11-12

4. Procedure
A. PCB Layout designing.


B. Fabrication of PCB. 14-21 C. Programme21-29 D. Assembly.. 30-31 E. Final Assembly. 31 F. Testing 32 5. Conclusion 33 6. Scope of utilization & further scope of utilization..34-35 7. Bibliography and references. 36

8. Annexure A. Work Distribution.37 B. Component list and price..38 C. Component Description..39-55 D. Coding.55-56

Global Institute of Technology

Page | 3

Session 2009-2010

This is to certify that Mohit Pandya, Mayank Agrawal, Mohit Mohan Saxena, Himanshu Mathur B.Tech. VIII Semester (Electrical Engineering ) have Design and developed a Major project on LOAD SHARING WITH AUTOMATIC POWER CUT OFF in the partial fulfillment of the award of Bachelor of Technology Degree by Rajasthan Technical University, Kota.


GUIDE Vishal Rohila

Place: G.I.T, Jaipur Date: 16/07/2010

Page | 4

First of all, we would like to give our sincere thanks to Mr. R.N.Vishnoi, Project In charge, for his valuable guidance and supervision. He was always ready to help and gave valuable suggestions regarding the project hardware. He also helped in the selection of this project. Also, We would like to thank Mr. Vishal Rohila, Project Lab Guide of the Electrical engineering, GIT for providing us an excellent opportunity to work in a team for the completion of the project. This short stint of working in teams will surely help us in the near future. Thanks are due to Mr. Vaibhav Kumar Mishra & Mr. Babulal (Project Lab Assistant) for their cooperation and guidance. He was always ready to help. Last but not the least; we would like to thank all the faculty members and colleagues.

Mohit Pandya Mayank Agrawal Mohit Mohan Saxena Himanshu Mathur

Department of Electrical Engineering Global Institute of technology Date: - 16/07/2010

Page | 5

Power travels from the power plant to house through an amazing system called the power distribution grid. For power to be useful in a home or business, it comes off the transmission grid and is stepped-down to the distribution grid. This may happen in several phases. The place where the conversion from "transmission" to "distribution" occurs is in a power substation. It has transformers that step transmission voltages (in the tens or hundreds of thousands of volts range) down to distribution voltages (typically less than 10,000 volts). It has a "bus" that can split the distribution power off in multiple directions. It often has circuit breakers and switches so that the substation can be disconnected from the transmission grid or separate distribution lines can be disconnected from the substation when necessary. In load sharing, the load of one transformer is shared by another transformer if required. A sensor circuit is designed to log the data from the one transformer and if it is found to be in over load condition, immediately another transformer will be connected in parallel to the first transformer and the load is shared. Even then if our requirement is not fulfilled then there is an automatic power cut off. In this, all the transformers are interconnected to each other and share the excessive load of each other. All the transformers are connected in parallel. Now if the total demand capacity of the whole system increases beyond the rated capacity then our system detects on which zone demand is higher and it trip that zone for some time and when the demand of that zone get into the limit of the rated capacity then the supply of that zone is again switched on. Time to time monitoring of the various parameters such as voltage, current is also done and priority supply among the zones. Alarm signal is provided with the help of a buzzer.


Page | 6

We all explored the internet for different types of project related to our concerned branch electrical engineering. As the complexity in the interconnected network has increased and also the regulation of supply is needed in addition to the protection of equipments. Therefore we decided to make a project which was based on hardware and software i.e. Load Sharing With Automatic Power Cutoff. So we discussed this project with our project guide and searched for the circuit diagram on the internet and we got the ideal circuit diagram for our project. This project was based on the power supply from the transformer and the distribution of rated capacity to various zones and tripping in case the load increases. The various messages are shown on the screen through VB coding. The detection of temperature, current and voltage is being achieved through sensors and time to time monitoring is done on the lcd screen. As VB programming is used therefore various controls and messages cab be achieved by little changes in the programming and this system can be implemented at the grid at major level. Therefore we decided to accomplish this project as major project.

Page | 7

Over the last decade-and-a-half, Electricity use has dramatically increased, placing an extraordinarily high level of demand on underlying hardware. In order to keep up with the increase in user requests and preclude saturation of hardware resources, the hardware itself has become much more powerful and capable. However, the key to successfully serving a customer base that continues to grow is recognition that the solution cannot be achieved merely by investing large sums of money in the latest and greatest hardware. Rather, the answer lies in an understanding of how the network can be used to your advantage and how you can distribute requests to many users within a cluster that can then process them in an expeditious manner. This concept, aptly called load balancing, is neither complex nor novel, and appropriately used, it can help ensure that no server becomes so overburdened with requests that it ends up failing to properly function. Load balancing has been around for years. Economical growth in India has led to a considerable growth in its power sector. Issues related to system expansion, restructured environment and changing regulatory framework demand changes in planning and opening strategies and in the design of system architecture for future needs. We explore the role of interoperability in the Indian power system context. Four levels of interoperability viz. organizational interoperability, application interoperability, information interoperability and technical interoperability are discussed with the help of typical scenarios. It is observed that interoperability among various systems of the power grid is crucial for achieving the benefits of open architecture based future control centers. In the theoretical background we also prefer power control which is being done here automatically. In the reference context we have seen such a controls viz. IEDs which are being used in the modern scenario. With growing number of installed IEDs on a plant power system, the user can realize the cost saving potential and operating advantages of power system control and automation. A recent cement mill power system installation can be used to demonstrate the value of power distribution system control and automation, as well as some unexpected benefits. The recent cement mill system has one service from tie from a power company. To support an expansion to increased production of cement ,a new power company service at 138 kV provided and two 60MVA power transformers were installed to step down to 35 kV outdoor substation switchgear Page | 8

that includes two transformer secondary circuit breaker and a normally closed bus tie circuit breaker. One of the buses also have a main circuit breaker for the existing power company 35kV service. Each switchgear bus has two outgoing feeders to transformers supplying the old 4.16 kV system and one feeder to new 35 kV distribution switchgear.


How does a transformer work? A transformer is an electrical device used to convert AC power at a certain voltage level to AC power at a different voltage, but at the same frequency. The construction of a transformer includes ferromagnetic core around which multiple coils, or windings, of wire are wrapped. The input line connects to the 'primary' coil, while the output lines connect to 'secondary' coils. The alternating current in the primary coil induces an alternating magnetic flux that 'flows' around the ferromagnetic core, changing direction during each electrical cycle. The alternating flux in the core in turn induces an alternating current in each of the secondary coils. The voltage at each of the secondary coils is directly related to the primary voltage by the turns ratio, or the number of turns in the primary coil divided by the number turns in the secondary coil. For instance, if the primary coil consists of 100 turns and carries 480 volts and a secondary coil consists of 25 turns, the secondary voltage is then.


Page | 9


Page | 10

In this project, we are representing the load sharing between the zones of a particular sub-station and automatic power cut-off. In this project we have three zones from which one of them is priority zone and other two is at high voltage zone and low voltage zone respectively. Priority zone means that this zone is very important. We cant cut the electricity of that area so for managing the increment of load on the sub-station; we have to cut the electricity of other zone for some time. When the temperature of the transformers increases as the load increases then in that case also we have to shut down zone accordingly for the proper functioning of the sub-station. When the load increases beyond the limit, then transformers share the load but still load increases then we to cut the supply of one zone and transfer that load to other zone. We also interface it with computer using DB9 using a program of visual basic (VB). Its utility is that the superior members of the sub-station also get information about the sub-station. In the circuit, firstly we convert 220V AC to 12V DC then we convert it into 5V DC through voltage regulator IC i.e. LM7805. After that we send this 5V to microcontroller which is controlling our whole circuit. We are using AT89C51 microcontroller having 40 pins. In this we place the basic circuit at the pin no. 18,19,9 which is having the two capacitors of 33pf, crystal oscillator of 12MHz and a resistance of 1K. In the circuit, we are using LM324 IC on which our sensors are placed and data is send to the microcontroller for controlling. We are also using ULN2003. It is a driver IC for the relays. It drives the relay in our circuit. We are also using MAX232 for giving instructions to the DB line for sending instructions to the computer. In this we are using 3 relays. One is for temperature, second one is for priority zone and the last one is for overload condition. Page | 11

We are also showing the display on 4 bit LCD. When the relays are tripped there is a sound from the buzzer indicating that relay is tripped due to some fault and that fault is shown on the LCD to the workers and on the computer to the superior members of the sub-station and that fault is cleared automatically.

Page | 12


These are two main methods to make PCB's. That is to produce the artwork for the PCB layout using a PC software application, and then to transfer the track pattern to the copper board using a technique similar to developing and printing a photograph. Both methods are quite straight forward, but the latter method, which is more expensive but quicker, produces better results and allows more dense population of the PCB. B) FABRICATION OF PCB Page | 13

There are six main steps to making a PCB, which are shown in the graphic below. Clicking on each of the steps will provide more information. At the foot of this page is a downloadable version of these pages. Prepare Art work Develop PCB Etching PCB Cleaning PCB Drilling Mounting Finishing


There are a large number of suppliers of PCB layout applications, which run on a PC, who regularly advertise each month in magazines such as Elector. These range in price considerably depending on the functions and complexity (i.e.: number of layers, pads and size of library) available. I used Diptrace from Novarm. The method is usually to open the layout application and using the library of packages provided, select all the component packages to be used in the layout. These packages are then placed in their rough positions on the board area and their pins connected together as required by clicking and dragging using the mouse. The screen shot on the right shows the areas Layout Software Tool in use. This can be time consuming, and you have to be very careful to connect the pins together correctly as there is no checking mechanism. Alternatively, the circuit can be entered in an accompanying schematic capture application and the PCB layout can be laid out automatically using the supplied auto-router. I have never been able to justify the expense of this luxury and have always used the manual method.

Page | 14

When the art work is finished, the layers are printed onto either acetate film of good quality tracing paper available from art shops. Better not to reverse (mirror) the image for the bottom layer as I will explain under 'Developing'. When using tracing paper, I leave the ink to dry for an hour or so, then sandwich between several sheets of A4 paper with some heavy books (such as electronic component catalogues) on top, to flatten the artwork, over night

. The general method is to create the layout on a piece of paper then to trace the holes and tracks onto tracing paper for each layer. After taping the artwork to the thoroughly cleaned copper board a centre punch is used to mark the position of the holes. If there are both top and bottom layers, four of the marked holes can be drilled through (one near each corner) at this stage, to line up the layers correctly. Page | 15

With a lot of patience, it should now be possible to 'join the dots' with the each resist transfers, until the artwork is completed. Great care should be taken to keep finger marks off of the copper surface and to complete this process as soon as possible, before the copper oxidizes.

Pre-Sensitized boards: - These are relatively expensive, but you get what you pay for and results can be excellent and quick. The boards are supplied with black plastic covering the surfaces to protect the Ultra-violet (UV) sensitive surfaces and this covering is removed immediately prior to using. If the bottom foil was NOT reversed when printing the printed side of the artwork will now be as close as possible to the copper surface. This will result in sharper and better resolution for thin tracks, because the UV light has less opportunity to 'spread' within the thickness of the plastic film or tracing paper used for the foil. The foils are affixed to the board with small pieces of adhesive tape. At this stage the artwork and PCB should be cut larger than the finished board by (say) 5mm all round. The board is then placed in the UV exposure box for an appropriate amount of time to allow the PCB pattern to be transferred to the board. Each side of the board is usually exposed separately when using non - professional equipment. The photo' shows my light box with the Parallel Port Development Board Foil ready to be used. After exposure, the foils are carefully removed and the board placed in a solution of developer for a couple of minutes and the tracks and pads will magically appear, similar to developing a photograph. Caustic Soda can be used with the pre-sensitised boards and this is available from most hardware stores for cleaning drains etc As soon as the developing is complete, the board must be washed under cold running water but with care taken to avoid damaging the etch resist on the board surfaces, which will be very soft at this stage. Etching should now be undertaken as soon as possible, but keeping the developer solution to one side for use again shortly.

Page | 16

Coated Boards: - A cheaper method is to use plain copper board and to apply a UV sensitive coating to it (after cleaning). Electro tubes sell such a coating which is applied from an aerosol spray under low light conditions. I have found this to be a very hit and miss process, where good results are hard to obtain. If this method is used, it is important for the same manufacturers developer to be used if the process is to work successfully.

Great care should be taken with the Ferric Chloride while preparing, using and disposing of it. This chemical (and to a lesser extent) the caustic soda developer solution, should be used in a well ventilated area. Before etching begins, the artwork on the PCB should be inspected for damaged tracks and hairline cracks, which should be corrected using a 'Dalo' etch resist pen or similar. If this is necessary, the board should first be dried off, as soon as possible after developing, with a hair dryer, for example.

Page | 17

I have found etching is best completed with the chemical heated to a little above room temperature, using a hot water- bath. Etching should then take little more than 15 to 20 minutes with constant agitation of the board. Leaving the etching bath floating in the hot water-bath makes agitation easy, but be careful not to splash the chemical about. When the PCB looks ready, it should be carefully removed from the chemical, using plastic gloves and thoroughly rinsed in a cold water bath. After inspection, if it is finished then it should be returned to the caustic soda solution, to soften the resist, which can then be removed with a soft abrasive However, I prefer to remove the resist at the end, after all other stages have been completed.

The photo on the left shows some of the materials required for making your own PCB's. Caustic Soda for developing the artwork, FCC - Ferrous Oxide (etchant) and a tin of drills.

Cleaning the PCB, is perhaps easiest to do at this stage, as the etch resist is soft, but I prefer to complete the drilling and cutting of the board to size, first. Otherwise, a further, final session of cleaning will be needed later. Transfers and etch resist is fairly easily removed with a medium density, waterproof, abrasive paper, that can be used under running water. Only light pressure is needed, to avoid damaging the thinner copper tracks. This can be followed by use of a very fine paper to give a better finish. Page | 18

If an etch resist pen (such as a 'Dalo' marker pen) has been used, this is easily removed by using a solvent, such as nail polish remover! However, this can stain the PCB, if you are not careful to clean up the residue quickly. The picture, right, shows from top clockwise, the original art work, (printed on good quality tracing paper). Then the exposed design before etching and finally, the etched layout ready for drilling and finishing.

Most PCBs these days contain a few IC's as a minimum, and this can quickly multiply the number of holes that need to be drilled. It is important, especially with dual sided boards, that the holes are drilled with the drill 'upright' so that the holes are lined up in the middle of the pads on both sides. This is easy if you have a small bench drill which will fit into a pillar stand, but if you don't, what can you do? I use a 12 volt modelers drill, which I hold in two hands above the board, and rest both wrists on the table surface. I can then use the weight of both hands to hold the copper board down tight at the same time. In this way I manage to hold everything rigid and am able to use light pressure to ease the drill through the board.

A soft material should be placed under the board for the drill to pass into, such as a spare piece of cork or an old 'jiffy' bag! Whatever method is used, it is important NOT to allow any sideways movement of the PCB (or the drill) if breakage of the drill bit is to be avoided. The drills used, should be the Page | 19

Tungsten Carbide type (which usually have a larger shank) as these will not blunt as quickly as the ordinary metal HSS drills. These are about three times as expensive, but if breakages are avoided, will work out at better value in the long run. I have found that it is best to use a range of drill sizes - 0.8mm for IC pads and most other components, 1.0mm for thicker component leads (diodes and regulators) and 1.2mm for some larger components. The normal practice of drilling a pilot hole and then the final size later should not be tried, as this will result in the snapping of the brittle PCB drills, which tend to 'snatch' as they enter a pilot hole. Therefore, drill each hole only once, with the correct sized drill.

When the drilling of PCB is completed, then we start to mount the components on it one by one through soldering.

Page | 20

At last, the etching has been done, the holes have been drilled and the last task before soldering the components is to finish the PCB so that it looks as professional as possible. First, the oversize board can be cut to size, using a hacksaw or similar. Make the saw cut just outside the copper board edge, to allow for filing/smoothing of the rough cut PCB edge. Take care not to rub fingers and hands against the rough PCB edges, as the glass fibers are so fine, they can enter the body! Similarly, do not breathe in dust generated when drilling, cutting or filing the board. The board should now be cleaned as described in the earlier page, but if this has already been completed, then a light rub over with a fine, waterproof, abrasive paper should be carried out. The board, with shiny copper tracks, is now ready for assembly and soldering. After this has been completed, and basic functional testing carried out (to spot the stupid mistakes), the bottom surface should be coated with a protective lacquer, to prevent oxidization of the tracks, over time. This should be done as soon as possible after component assembly. A better approach (is to 'tin' the copper tracks before component assembly. This takes some practice, if a messy result is to be avoided, but the key to success is heat and flux! Smear a THIN layer of plumbers flux across the surface to be tinned, then using the soldering iron and the minimum possible solder, work the solder across the pads and along tracks as quickly as possible. Avoid using too much heat on thinner tracks to avoid damaging them. Finally, inspect the board for solder bridges between tracks and pads - a small magnifier may be useful for this task.


Visual Basic (VB) is an event driven programming language and associated development environment from Microsoft for its COM programming model Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using DAO, RDO, or ADO, and creation of ActiveX controls and objects. Scripting languages such as VBA and VBScript are syntactically similar to Visual Basic, but perform differently.

Page | 21

A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations.

Visual Basic was designed to be easy to learn and use. The language not only allows programmers to easily create simple GUI applications, but also has the flexibility to develop fairly complex applications as well. Programming in VB is a combination of visually arranging components or controls on a form, specifying attributes and actions of those components, and writing additional lines of code for more functionality. Since default attributes and actions are defined for the components, a simple program can be created without the programmer having to write many lines of code. Performance problems were experienced by earlier versions, but with faster computers and native code compilation this has become less of an issue. Although programs can be compiled into native code executables from version 5 onwards, they still require the presence of runtime libraries of approximately 2 MB in size. This runtime is included by default in Windows 2000 and later, but for earlier versions of Windows it must be distributed together with the executable. Forms are created using drag and drop techniques. A tool is used to place controls (e.g., text boxes, buttons, etc.) on the form (window). Controls have attributes and event handlers associated with them. Default values are provided when the control is created, but may be changed by the programmer. Many attribute values can be modified during run time based on user actions or changes in the environment, providing a dynamic application. For example, code can be inserted into the form resize event handler to reposition a control so that it remains centered on the form, expands to fill up the form, etc. By inserting code into the event handler for a keypress in a text box, the program can automatically translate the case of the text being entered, or even prevent certain characters from being inserted. Visual Basic can create executables (EXE files), ActiveX controls, DLL files, but is primarily used to develop Windows applications and to interface web database systems. Dialog boxes with less functionality (e.g., no maximize/minimize control) can be used to provide pop-up capabilities. Page | 22

Controls provide the basic functionality of the application, while programmers can insert additional logic within the appropriate event handlers. For example, a drop-down combination box will automatically display its list and allow the user to select any element. An event handler is called when an item is selected, which can then execute additional code created by the programmer to perform some action based on which element was selected, such as populating a related list.

This chapter discusses how Visual Basic can be used to access serial communication functions. Windows hides much of the complexity of serial communications and automatically puts any received characters in a receive buffer and characters sent into a transmission buffer. The receive buffer can be read by the program whenever it has time and the transmit buffer is emptied when it is free to send characters.

Visual Basic allows many additional components to be added to the toolbox. The Microsoft Comm. component is used to add a serial communication facility. In order to use the Comm. component the files MSCOMM16.OCX (for a 16-bit module) or MSCOMM32.OCX (for a 32-bit module) must be present in the \WINDOWS\SYSTEM directory. The class name is MS comm. The communications control provides the following two ways for handling communications. Event-driven: - Event-driven communications is the best method of handling serial communication as it frees the computer to do other things. The event can be defined as the reception of a character, a change in CD (carrier detect) or a change in RTS (request to send). The On Comm. event can be used to capture these events. and also to detect communications errors. Comm. Event properties can be tested to determine if an event or an error has occurred. For example, the program can loop waiting for a character to be received. Once it is the character is read from the receive buffer. This method is normally used when the program has time to poll the communications receiver or that a known response is imminent. Visual Basic uses the standard Windows drivers for the serial communication ports (such as serialui.dll and serial.vxd). The communication control is added to the application for each port. The parameters (such as the bit rate, parity, and so on) can be changed by selecting Control Panel System, Page | 23

Device Manager, Ports (COM and LPT), and Port Settings. The settings of the communications port (the IRQ and the port address) can be changed by selecting Control Panel System, Device Manager, Ports (COM and LPT), and Resources for IRQ and Addresses.


The Comm. component is added to a form whenever serial communications are required. By default, the first created object is named MSComm1 (the second is named MSComm2, and so on). It can be seen that the main properties of the object are: Comm. Port, DTR Enable, EOF Enable, Handshaking, InBufferSize, Index, Input Len, Input Mode, Left, Name, Null Discard, OutBufferSize, Parity Replace, RThreshold, RTSEnable, Settings, SThreshold, Tag and Top.

The Settings property sets and returns the RS-232 parameters, such as baud rate, parity, the number of data bit, and the number of stop bits. Its syntax is: [form]MSComm.Settings = setStr[$] Where the strStr is a string which contains the RS-232 settings. This string takes the form: "BBBB,P,D,S" where BBBBdefines the baud rate, P the parity, D the number of data bits, and S the number of stop bits. The following lists the valid baud rates (default is 9600Baud): 110, 300, 600, 1200, 2400, 9600, 14400, 19200, 38400, 56000, 128000, 256000. The valid parity values are (default is N): E (Even), M (Mark), N (None), O (Odd), S (Space). The valid data bit values are (default is 8): 4, 5, 6, 7 or 8. The valid stop bit values are (default is 1). 1, 1.5 or 2. An example of setting a control port to 4800Baud, even parity, 7 data bits and 1 stop bit is: Com1.Settings = "4800,E,7,1"

Page | 24

COMM. PORT The Comm. Port property sets and returns the communication port number. Its syntax is: [form.]MSComm.CommPort = portNumber Which defines the portNumber from a value between 1 and 99. A value of 68 is returnedif the port does not exist. PORTOPEN The Port Open property sets and returns the state of the communications port. Its syntax is: [form.]MSComm.PortOpen = [{True | False}] A True setting opens the port, while a False closes the port and clears the receive and transmit buffers (this automatically happens when an application is closed). The following example opens communications port number 1 (COM1:) at 4800 Baud with even parity, 7 data bits and 1 stop bit: INPUTTING DATA The three main properties used to read data from the receive buffer are Input, InBuffer Count and InBufferSize. INPUT The Input property returns and removes a string of characters from the receive buffer. Its syntax is: [form.]MSComm Input To determine the number of characters in the buffer the InBufferCount property is tested (to be covered in the next section). Setting InputLen to 0 causes the Input property to read the entire contents of the receive buffer. INBUFFER SIZE The InBufferSize property sets and returns the maximum number of characters that can be received in the receive buffer (by default it is 1024 bytes). Its syntax is: Page | 25

[form.]MSCommInBufferSize = [numBytes] The size of the buffer should be set so that it can store the maximum number of characters that will be received before the application program can read them from the buffer. The InBufferCount property returns the number of characters in the receive buffer. It can also be used to clear the buffer by setting the number of characters to 0. Its syntax is: [form.]MSCommInBufferCount= [count] OUTPUTTING DATA The three main properties used to write data to the transmit buffer are Output, OutBufferCount and OutBufferSize. The Output property writes a string of characters to the transmit buffer. Its syntax is: [form.]MSComm. output= [outString]

OUTBUFFERSIZE The OutBufferSize property sets and returns the number of characters in the transmit buffer (default size is 512 characters). Its syntax is: [form.]MSCommOutBuffer size = [NumBytes] OUTBUFFERCOUNT The OutBufferCount property returns the number of characters in the transmit buffer. The transmit buffer can also be cleared by setting it to 0. Its syntax is: [form.]MSCommOutBufferCount. = [0]

Page | 26


8051 provides a transmit channel and a receive channel of serial communication. The transmit data pin (TXD) is specified at P3.1, and the receive data pin (RXD) is at P3.0. The serial signals provided on these pins are TTL signal levels and must be boosted and inverted through a suitable converter (MAX232) to comply with RS232 standard. All modes are controlled through SCON, the Serial Control register. The SCON bits are defined as SM0, SM1, SM2, REN, TB8, RB8, TI, RI from MSB to LSB. The timers are controlled using TMOD, the Timer Mode register, and TCON, the Timer Control register.


In this article we are going to learn how to receive data from a microcontroller and make the PC respond. For simplicity we are going to get the Port 0 and send to the PC for us to receive using VB. Visual Basic at PC side To get started open Visual Basic. Start a new Standard EXE. Next go to the Project | Components... menu Check the Microsoft Comm control 6.0. Click OK. Next double-click on the yellow phone in the toolbar to add the MSComm control to your form. Finally add a label to your form

Page | 27

Now that the form is set up and ready, we need to get a quick understanding of how the MSComm control can receive data from the serial port. There are basically two methods, polling the port and responding to communications events. Polling the port is done by setting up a timer to check the buffer for data, and if data is there, process it. Polling is better when you have variable length data that starts and ends with header and footer bytes respectively. The event driven method is designed more for receiving fixed length data. It is also better because you don't waist time polling the buffer for data if none is there. Instead the MSComm control will tell you when data is there by firing the On Comm. event. This event fires just like a Click() event would fire if you clicked on a Command Button, only it is not the users action that fires this event, something must happen at the serial port. When the On Comm() event is fired you must check the value of the Comm. Event property to see what exactly happened. The Comm. Event property will contain a different value for each different kind of communication event that occurs. In this project we are only concerned with the comm. EV Receive constant which has the value of 2 and is fired when data is available in the buffer. Now that we have a feel for how the MS Comm control will assist us in receiving data, lets first set up the MS Comm control. Copy this commented code to your project. You may notice that there are two new properties in the above code that have yet to be explained in these articles. The first is RThreshold. In this example, setting the R Threshold property equal to 1 tells the MSComm control to fire the comEvReceive event when there are at least bytes available in the buffer. The second property, Input Len, tells the MSComm control to only give us the first byte when we request data from the buffer. With that out of the way, lets take a look at the code that is executed when the OnComm() event is fired. The comments should help you along.

Page | 28

BASCOM is an Integrated Development Environment (IDE) that sup ports the 8051 family of microcontrollers and some derivatives as well as Atmel's AVR microcontrollers. Two products are available for the various microcontrollers - BASC OM-8051 and BASCOM-AVR. In a microcontroller project one needs to know the hardware base, i.e. the microcontroller with internal and connected peripherals, and the software used, i.e. IDE handling, programming and debugging. Screenshot of BASCOM

In this, Initially we created a new file named load sharing. Then we wrote the programmein it according to our requirements.After writing the program , the program is compiled and is converted into hex file. Now this hex file is burned on the microcontroller.


Page | 29


First we have test all the component with the help of different measuring instrument such as multimeter when the entire component will be check we have use the next step. In the component testing first we check that the ICs pin will be right then we check the capacitors value resister value and value of oscillator in the other function circuit we have check that the circuit will be right or any fault will be create in the system .if any fault will be generated then we have check than any two wires will be interconnected in the system .by using the multimeter beep signal we have check whole the single in the circuit. And any fault will show then we repair it. In the other testing work we have check the regulate supply circuit in that case we have check that they will come clearly. Second we check that any component will not heat up highly in this case any component will highly heat up please check the circuit quickly .in the main this problem will easily generated so we have check the circuit. In the relay circuit we have check that the terminal of the output terminals or 12 volt terminals which we have reach the relay panel are check rightly in the open terminal are connected to the supply and the short terminal will be not connected. that is the whole description of checking the components and the circuit.


This is the main step of manufacturing the PCB in this step we have mounted all the component into the PCB and soldering it easily and clearly then we have connected connection cable to join the other terminals of the PCB. In the PCB shouldering we have mainly check than the base will be clearly because two pin will connected together then the circuit will do not work and interfacing will not complete. in the mounting of LED we have see that this is not connected in parallel .and in the connection of the supply we have take the connection of the load or transformer supply will be one.

Page | 30

When the soldering work will be complete we have done the finishing work of PCB at that they medium we have cut the unnecessary wire by pliers and check all the PCB for good connection. And in the ending of the system we have check that any two wire will not in the short circuit in that which we have safely all the component in the other protection system finishing we have check that any wire will be open in this system .because when the wire will open the signal receiving and sending system will be fail. So that is the whole process to assembly the project in this section we have easily said that where the condition will be generated in the system and which method that this will be removed.


Page | 31


After completing the power distribution in grid station using SCADA. We tested the project. First we provide the 12V or 5V dc supply to the circuit which produce by the rectifier circuit. In this rectifier circuit this supply will come to the three pin ICs at that before the supply will come these are rectified to the bridge circuit. At this system they are go to the chargeable capacitor where this will charge the capacitors and then we go the resister where the LED will connected in series there are the two led will be connected in series that when the supply will be on that this circuit work clearly and this will supply correctly.


In the testing of the main microcontroller PCB circuit. Firstly, we check the tracks on the PCB board by setting the multimeter on the voice. Then place one leg on one terminal and other to the second terminal, if volume rises from microcontroller then the track is correct and if not then the track is not completely joined between the two terminals. After checking the whole PCB we connect it to the supply for checking the voltage on the microcontroller. In that case, we give supply to the PCB and set the multimeter range at 20V and place the black cord at the ground and place the red cord at pin number 31, if the multimeter shows the rating of 5V then the PCB connection is correct.


By testing of these two we have check the relay circuit which we have accept the supply by the output and the 12 volt supply and that movement the connection of the relay on one side is load and the second side where the pin is open at that this will be connected the supply in this movement when the supply will on the relay will trip and load will off. In the programming we have set the grid minimum value is 10 and when we have vary the potentiometer at the under10 limit the bulb is off and then the value of vary will increase the 10 then we result the bulb will on or load will on .By this condition we have easily said that circuit will correctly work. By using these three testing we have know that circuit will be good working.

Page | 32

The project entitled as Load Sharing with automatic power cutoff is a complete microcontroller hardware circuit which can control the load distribution on the transformers with the help of the relays. Here we have demonstrated the application by connecting leds as loads. The project can also be modified to include more zones and also load shedding can also be done. The working of the circuit does require programming. With the help of visual basic programming the output can also be displayed on the monitor. This project helps us to provide the automatic shifting of the load to high transmission line and priority zone is always remains on. In the main conclusion we can say that there is a system which provides the protection against the overloading of the transformers and hence safety and total blackout of the whole system. If we have to give a regular supply to a particular zone this can be done through priority relays. That is the whole process of the system we have take a good implementation and application.

Page | 33


Use in new technology in power distribution system. Using in power management system. Using in sub grid station for control of voltage. Using at indication signal in the electrical equipment. Using as a protective device in electrical power distribution system. Using in new technology as control by computer application.


Maintain ability should be specified, and the design of the software should provide for the highest level of flexibility and ease of maintenance. These attributes should be major design goals, because 1) The maintenance of a software product is a costly enterprise. 2) A software product or parts of it may spend 65% of its operational life cycle in the maintenance phase. 3) The benefits of designing for ease of maintenance far outweigh the cost of including maintainability as a software design requirement.


A cost-benefit analysis can be viewed as another form of trade-off, in which financial considerations are balanced against potential benefits for available alternatives. Cost-benefit results can also one of many decision criteria within a larger trade-off context. So, results of a cost benefit analysis along with other criteria form a decision criterion. A cost-benefit analysis evaluates the financial merit of making a capital investment in a system or software product.

Page | 34

The cost-benefit analysis attempts to quantify the cost of acquiring or upgrading an information system and maintaining it in operational condition for its estimated lifetime. These costs are then compared with the quantified benefits derived operating the new system. There are also instances where acquisition of software development facilities may be considered as capital investments and the software engineer may find him or she directly involved in a cost-benefit analysis. One additional factor to be considered with a detailed discussion of the cost-benefit analysis process is cost of money or net present value. Then at last we can say that this system is more reliable, reduced manpower, time efficient, and easy to maintain but this system is more costly.

Page | 35

Bibliography and References

Here are the names of the websites/ papers/ books that helped in the preparation of the project. (1) Final Report on the August 14, 2003 Blackout in the United States and Canada: Causes and Recommendations, U.S.-Canada Power System Outage Task Force, Washington, DC, April 2004. (2) Common Vulnerabilities in Critical Infrastructure Control Systems, Jason Stamp, John Dillinger, William Young, and Jennifer DePoy, Sandia National Laboratories report SAND2003-1772C, Albuquerque, New Mexico (2003). (3) Sustainable Security for Infrastructure SCADA, Jason Stamp, Phil Campbell, Jennifer DePoy, John Dillinger, and William Young, Sandia National Laboratories report SAND2003-4670C, Albuquerque, New Mexico (2003). (4) Object-Role Modeling (ORM/NIAM), Terry Halpin, Microsoft Corporation, USA,

(5) A Comparison of UML and ORM for Data Modeling, Terry Halpin, Anthony Bloesch, Viso Corporation (1998), (6) (7)

Page | 36

In this project the total work was divided into four people that are Himanshu Mathur, Mayank Agrawal, Mohit Pandya, Mohit Saxena. The total work is described as under: Selecting Project Planning PCB Making Purchasing of Components Mounting of components Soldering Testing of Project Final Fabrication of Project Report

Selecting project is a typical task to perform because it requires us to choose such a project which can be made by us with economical consideration and we have to make sure that all the components are available in our vicinity. Himanshu Mathur and Mayank Agrawal did all the work related to designing of PCB and drilling. In the other work he will check the entire path to verify the short circuit system and they doing checking the working capacities of ICs. Then after all components were purchased and mounted by the Mohit Pandya. And in the other work we have help to make the report in that detail in subject. Testing of project and final fabrication was done by Mohit Saxena at that they movement it will check all the record which we have generated in the system .He will check all the component in the running condition of the project.

Page | 37

Programming in visual basic will be completed by the Mayank Agrawal and its implementation on the project and also prepared the project Report on the basis of project working application. At last we help each other to make a successful running project.


1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) 22) 23) 24) 25)

Name of the component

LM7805 LM324 MAX232 ULN2003 Capacitors of 33pf Capacitors of 10f Capacitors of 1000 f Resistors of 1k, 10k, 100 Microcontroller of AT89C51 Transformer of 250mA Transformer of 500mA Transformer of 750mA Diodes Thermistor LED Variable resistor of 20k 8 pin connector Crystal Base of 16 pin Base of 14 pin Base of 40 pin Wooden board Power cable Nut bolt LCD

1 1 1 1 2 7 3 6 1 1 1 1 6 1 3 3 2 1 2 1 1 1 1 1


Total - 582/Annexure 3 COMPONENT DESCRIPTION (A) IC-AT89C51

Page | 38

The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4Kbytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. Pin Configurations:-

Page | 39

Pin Description:VCC - Supply voltage. GND -Ground. Port 0 Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal Pull ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull ups are required during program verification. Page | 40

Port 1 Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 1 also receives the low-order address bytes during Flash programming and verification. Port 2 Port 2 is an 8-bit bi-directional I/O port with internal pull ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. It also receives the high-order address bits and some control signals during Flash programming and verification. Port 3 Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull ups. Port 3 also serves the functions of various special features. RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. ALE/PROG Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal Page | 41

operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable is the read strobe to external program memory. When the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier.

(B) IC-MAX-232
General Description The MAX220MAX249 family of line drivers/receivers is intended for all EIA/TIA-232E and V.28/V.24 communications interfaces, particularly applications where 12V is not available. These parts are especially useful in battery-powered systems, since their low-power shutdown mode reduces power dissipation to less than 5W. The MAX225, MAX233, MAX235, and

Page | 42

MAX245/MAX246/MAX247 use no external components and are recommended for applications where printed circuit board space is critical Detailed Description The MAX220MAX249 contain four sections: dual charge-pump DC-DC voltage converters, RS-232 drivers, RS-232 receivers, and receiver and transmitter enable control inputs. Dual Charge-Pump Voltage Converter The MAX220MAX249 has two internal charge-pumps that convert +5V to 10V (unloaded) for RS232 driver operation. The first converter uses capacitor C1 to double the +5V input to +10V on C3 at the V+ output. The second converter uses capacitor C2 to invert +10V to -10V on C4 at the V- output. A small amount of power may be drawn from the +10V (V+) and -10V (V-) outputs to power external circuitry (See the Typical Operating Characteristics section), except on the MAX225 and MAX245 MAX247, where these pins are not available. V+ and V- are not regulated, so the output voltage drops with increasing load current. Do not load V+ and V- to a point that violates the minimum 5V EIA/TIA-232E driver output voltage when sourcing current from V+ and V- to external circuitry. When using the shutdown feature in the MAX222, MAX225, MAX230, MAX235, MAX236, MAX240, MAX241, and MAX245MAX249, avoid using V+ and V- to power external circuitry. When these parts are shut down, V- falls to 0V, and V+ falls to +5V. For applications where a +10V external supply is applied to the V+ pin (instead of using the internal charge pump to generate +10V), the C1 capacitor must not be installed and the SHDN pin must be tied to VCC. This is because V+ is internally connected to VCC in shutdown mode. RS-232 Drivers The typical driver output voltage swing is 8V when loaded with a nominal 5k S- 232 receiver and R VCC = +5V. Output swing is guaranteed to meet the EIA/TIA-232E and V.28 specification, which calls for 5V minimum driver output levels under worst-case conditions. These include a minimum 3k load, VCC = +4.5V, and maximum operating temperature. Unloaded driver output voltage ranges from (V+ -1.3V) to (V- +0.5V). Input thresholds are both TTL and CMOS compatible. The inputs of unused drivers can be left unconnected since 400k input pull-up resistors to VCC are built in (except for the MAX220). The pull-up resistors force the outputs of unused drivers low because all drivers

Page | 43

invert. The internal input pull-up resistors typically source 12A, except in shutdown mode where the pull-ups are disabled. Driver outputs turn off and enter a high-impedance statewhere leakage current is typically microamperes (maximum 25A)when in shutdown mode, in three-state mode, or when device power is removed. Outputs can be driven to 15V. The power supply current typically drops to 8A in shutdown mode. The MAX220 does not have pull-up resistors to force the outputs of the unused drivers low. Connect unused inputs to GND or VCC. The MAX239 has a receiver three-state control line, and the MAX223, MAX225, MAX235, MAX236, MAX240, and MAX241 have both a receiver three-state control line and a low-power shutdown control The receiver TTL/CMOS outputs are in a high-impedance, three-state mode whenever the three-state enable line is high (for the MAX225/MAX235/MAX236/MAX239 MAX241), and are also high-impedance whenever the shutdown control line is high. When in low-power shutdown mode, the driver outputs are turned off and their leakage current is less than 1A with the driver output pulled to ground. The driver output leakage remains less than 1A, even if the transmitter output is back driven between 0V and (VCC + 6V). Below -0.5V, the transmitter is diode clamped to ground with 1k ohm series impedance. The transmitter is also zener clamped to approximately VCC + 6V, with a series impedance of 1k. The driver output slew rate is limited to less than 30V/s as required by the EIA/TIA-232E and V.28 specifications. Typical slew rates are 24V/s unloaded and 10V/s loaded with 30 and 2500pF. RS-232 Receivers EIA/TIA-232E and V.28 specifications define a voltage level greater than 3V as a logic 0, so all receivers invert. Input thresholds are set at 0.8V and 2.4V, so receivers respond to TTL level inputs as well as EIA/TIA-232E and V.28 levels. The receiver inputs withstand an input overvoltage nominal 5k values. The receivers implement Type 1 interpretation of the fault conditions of V.28 and EIA/TIA232E. The receiver input hysteresis is typically 0.5V with a guaranteed minimum of 0.2V. This produces clear output transitions with slow-moving input signals, even with moderate amounts of noise and ringing. The receiver propagation delay is typically 600ns. Low-Power Receive Mode The low-power receive-mode feature of the MAX223, MAX242, and MAX245MAX249 puts the IC into shutdown mode but still allows it to receive information. This is important for applications where Page | 44

systems are periodically awakened to look for activity. Using low-power receive mode, the system can still receive a signal that will activate it on command and prepare it for communication at faster data rates. This operation conserves system power ShutdownMAX222MAX242 On the MAX222 MAX235 MAX236 MAX240 and MAX241 all receivers are disabled during shutdown. On the MAX223 and MAX242 two receivers continue to Operate in a reduced power mode when the chip is in shutdown. Under these conditions the propagation delay increases to about 2.5s for a high-to-low input Transition. When in shutdown, the receiver acts as a CMOS inverter with no hysteresis. The MAX223 and MAX242 also have a receiver output enable input (EN for the MAX242 and EN for the MAX223) that allows receiver output control independent of SHDN (SHDN for MAX241). With all other devices SHDN (SHDN for MAX241) also disables the receiver outputs. The MAX225 provides five transmitters and five receivers while the MAX245 provides ten receivers and eight transmitters. Both devices have separate receiver and transmitter-enable controls. The charge pumps turn off and the devices shut down when a logic high is applied to the ENT input. In this state, the supply current drops to less than 25A and the receivers continue to operate in a low-power receive mode. Driver outputs enter a high impedance state (three-state mode). On the MAX225 all five receivers are controlled by the ENR input. On the MAX245 eight of the receiver outputs are controlled by the ENR input while the remaining two receivers (RA5 and RB5) are always active. RA1RA4 and RB1RB4 are put in a three-state mode when ENR is a logic high . Receiver and Transmitter Enable Control Inputs The MAX225 and MAX245MAX249 feature transmitter and receiver enable controls. The receivers have three modes of operation: full-speed receive (normal active) three-state (disabled) and low power receive (enabled receivers continue to function at lower data rates). The receiver enable inputs control the full-speed receive and three-state modes. The transmitters have two modes of operation: full-speed transmit (normal active) and three-state (disabled). The transmitter enable inputs also control the shutdown mode. The device enters shutdown mode when all transmitters are disabled. Enabled receivers function in the low-power receive mode when in shutdown.

Page | 45

(C) LM 324
These devices consist of four independent high-gain frequency-compensated operational amplifiers that are designed specifically to operate from a single supply over a wide range of voltages. Operation from split supplies also is possible if the difference between the two supplies is 3 V to 32 V (3 V to 26 V for the LM2902), and VCC is at least 1.5 V more positive than the input common-mode voltage. The low supply-current drain is independent of the magnitude of the supply voltage. Applications include transducer amplifiers, dc amplification blocks, and all the conventional operational-amplifier circuits that now can be more easily implemented in single-supply-voltage systems. For example, the LM124 can be operated directly from the standard 5-V supply that is used in digital systems and easily provides the required interface electronics without requiring additional 15V supplies.

Page | 46

(D) LM 7805
The MC78XX/LM78XX/MC78XXA series of three terminal positive regulators are available in the TO-220/D-PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.

Page | 47

Page | 48

(E) Variable Resistors

Variable resistors are also common components. They have a dial or a knob that allows you to change the resistance. This is very useful for many situations. Volume controls are variable resistors. When you change the volume you are changing the resistance which changes the current. Making the resistance higher will let less current flow so the volume goes down. Making the resistance lower will let more current flow so the volume goes up. The value of a variable resistor is given as its highest resistance value. For example, a 500 ohm variable resistor can have a resistance of anywhere between 0 ohms and 500 ohms. A variable resistor may also be called a potentiometer (pot for short).

Page | 49

(F) Diodes

Diodes are components that allow current to flow in only one direction. They have a positive side (leg) and a negative side. When the voltage on the positive leg is higher than on the negative leg then current flows through the diode (the resistance is very low). When the voltage is lower on the positive leg than on the negative leg then the current does not flow (the resistance is very high). The negative leg of a diode is the one with the line closest to it. It is called the cathode. The positive end is called the anode. Usually when current is flowing through a diode, the voltage on the positive leg is 0.65 volts higher than on the negative leg.

(G) Crystal

A miniature 4 MHz quartz crystal enclosed in an hermetically sealed HC-49/US package.

Inside construction of a modern high performance HC-49 package quartz crystal A crystal is a solid in which the constituent atoms, molecules, or ions are packed in a regularly ordered, repeating pattern extending in all three spatial dimensions.

Page | 50

Almost any object made of an elastic material could be used like a crystal, with appropriate transducers, since all objects have natural resonant frequencies of vibration. For example, steel is very elastic and has a high speed of sound. It was often used in mechanical filters before quartz. The resonant frequency depends on size, shape, elasticity and the speed of sound in the material. Highfrequency crystals are typically cut in the shape of a simple, rectangular plate. Low-frequency crystals, such as those used in digital watches, are typically cut in the shape of a tuning fork. For applications not needing very precise timing, a low-cost ceramic resonator is often used in place of a quartz crystal. When a crystal of quartz is properly cut and mounted, it can be made to bend in an electric field, by applying a voltage to an electrode near or on the crystal. This property is known as piezoelectricity. When the field is removed, the quartz will generate an electric field as it returns to its previous shape, and this can generate a voltage. The result is that a quartz crystal behaves like a circuit composed of an inductor, capacitor and resistor, with a precise resonant frequency. Quartz has the further advantage that its size changes very little with temperature. Therefore, the resonant frequency of the plate, which depends on its size, will not change much, either. This means that a quartz clock, filter or oscillator will remain accurate. For critical applications the quartz oscillator is mounted in a temperature-controlled container, called a crystal oven, and can also be mounted on shock absorbers to prevent perturbation by external mechanical vibrations. Quartz timing crystals are manufactured for frequencies from a few tens of kilohertz to tens of megahertz. More than two billion (2109) crystals are manufactured annually. Most are small devices for wristwatches, clocks, and electronic circuits. However, quartz crystals are also found inside test and measurement equipment, such as counters, signal generators, and oscilloscopes. Crystal Modeling A quartz crystal can be modeled as an electrical network with a low impedance (series) and a high impedance (parallel) resonance point spaced closely together. Mathematically the impedance of this network this can be written as:

Page | 51

where s is the complex frequency (s = j), s is the series resonant frequency in radians and p is the parallel resonant frequency in radians. Adding additional capacitance across a crystal will cause the parallel resonance to shift downward. This can be used to adjust the frequency that a crystal oscillator oscillates at. Crystal manufacturers normally cut and trim their crystals to have a specified resonant frequency with a known 'load' capacitance added to the crystal. For example, a 6pF 32kHz crystal has a parallel resonance frequency of 32,768 Hz when a 6.0pF capacitor is placed across the crystal. Without this capacitance, the resonance frequency is higher than 32,768. Temperature Effects A crystal's frequency characteristic depends on the shape or 'cut' of the crystal. A tuning fork crystal is usually cut such that its frequency over temperature is a parabolic curve centered around 25 degC. This means that a tuning fork crystal oscillator will resonate close to its target frequency at room temperature, but will slow down when the temperature either increases or decreases from room temperature. A common parabolic coefficient for a 32kHz tuning fork crystal is -0.04ppm/degC. f = f0[1 0.04ppm(T T0)2]In a real application, this means that a clock built using a regular 32kHz tuning fork crystal will keep good time at room temperature, lose 2 minutes per year at 10 degrees above (or below) room temperature and lose 8 minutes per year at 20 degrees above (or below) room temperature. Crystals and frequency

Schematic symbol and equivalent circuit for a quartz crystal in an oscillator

Page | 52

The crystal oscillator circuit sustains oscillation by taking a voltage signal from the quartz resonator, amplifying it, and feeding it back to the resonator. The rate of expansion and contraction of the quartz is the resonant frequency, and is determined by the cut and size of the crystal. A regular timing crystal contains two electrically conductive plates, with a slice or tuning fork of quartz crystal sandwiched between them. During startup, the circuit around the crystal applies a random noise AC signal to it, and purely by chance, a tiny fraction of the noise will be at the resonant frequency of the crystal. The crystal will therefore start oscillating in synchrony with that signal. As the oscillator amplifies the signals coming out of the crystal, the crystal's frequency will become stronger, eventually dominating the output of the oscillator. Natural resistance in the circuit and in the quartz crystal filter out all the unwanted frequencies. One of the most important traits of quartz crystal oscillators is that they can exhibit very low phase noise. In other words, the signal they produce is a pure tone. This makes them particularly useful in telecommunications where stable signals are needed, and in scientific equipment where very precise time references are needed. The output frequency of a quartz oscillator is either the fundamental resonance or a multiple of the resonance, called an overtone frequency. A typical Q for a quartz oscillator ranges from 104 to 106. The maximum Q for a high stability quartz oscillator can be estimated as Q = 1.6 107/f, where f is the resonance frequency in MHz. Environmental changes of temperature, humidity, pressure, and vibration can change the resonant frequency of a quartz crystal, but there are several designs that reduce these environmental effects. These include the TCXO, MCXO, and OCXO (defined below). These designs (particularly the OCXO) often produce devices with excellent short-term stability. The limitations in short-term stability are due mainly to noise from electronic components in the oscillator circuits. Long term stability is limited by aging of the crystal. Due to aging and environmental factors such as temperature and vibration, it is hard to keep even the best quartz oscillators within one part in 1010 of their nominal frequency without constant adjustment. For this reason, atomic oscillators are used for applications that require better long-term stability and accuracy. Page | 53

Although crystals can be fabricated for any desired resonant frequency, within technological limits, in actual practice today engineers design crystal oscillator circuits around relatively few standard frequencies, such as 10 MHz, 20 MHz and 40 MHz. Using frequency dividers, frequency multipliers and phase locked loop circuits, it is possible to synthesize any desired frequency from the reference frequency. Care must be taken to use only one crystal oscillator source when designing circuits to avoid subtle failure modes of meta stability in electronics. If this is not possible, the number of distinct crystal oscillators, PLLs, and their associated clock domains should be rigorously minimized, through techniques such as using a subdivision of an existing clock instead of a new crystal source. Each new distinct crystal source needs to be rigorously justified, since each one introduces new, difficult to debug probabilistic failure modes, due to multiple crystal interactions, into equipment.

Page | 54


Private Sub Form_Load() MSComm1.PortOpen = True End Sub Private Sub Form_Unload(Cancel As Integer) MSComm1.PortOpen = False End Sub Private Sub Timer1_Timer() Text1.Text = MSComm1.Input End Sub


The microcontroller coding is done in a software named Bascom. The following coding is done: $crystal = 11059200 $baud = 9600 P0.0 = 0 P0.1 = 0 P0.2 = 0 Dim W As Word Dim Flag As Bit Dim Vlt As Byte Main: Do If P3.3 = 1 Then Cls Lcd "TEMP RISE" P0.0 = 1 P2.0 = 0 Print "TEMP RISE" Page | 55 'forever 'get RC value 'allocate space for variable

Wait 2 P2.0 = 1 End If If P3.3 = 0 Then P0.0 = 0 If P3.4 = 0 Then P0.2 = 0 If P3.4 = 1 Then Cls Lcd "SHIFT... TO PR." Print "SHIFT... TO PR." P0.2 = 1 P2.0 = 0 Wait 2 P2.0 = 1 End If If P3.2 = 1 Then Cls Lcd "O.L. SHIFT... 22KV" Print "O.L. SHIFT... 22KV" P0.1 = 1 P2.0 = 0 Wait 2 P2.0 = 1 End If If P3.2 = 1 Then Lowerline P0.1 = 0 Lcd "TRANS.=11Kv" End If Cls Lcd "LOAD SHARING" Waitms 200 Loop Page | 56 'wait a moment 'get RC value