www.final-yearprojects.co.cc | www.troubleshoot4free.
Transformer Protection From Over Load And Monitoring of Load current in PC ABSTRACT
The aim of the project work is to protect the distribution transformer or any other power transformer, burning due to the overload. Normally most of the transformers are burning because of over load; hence by incorporating monitoring and control circuits, life of the transformer can be.
In this project we designed a system in such a way that it will monitor the load of the transformer continuously and that information is transferred to the control room. In the main station these parameters are displayed on the PC monitor. In the display unit we can view the continuous information of transformer i.e. due to what reason the transformer has been failed, when the power is resumed etc.,. With the help of this kind of system, the maintenance staff of the department can have a continuous vigilance over the transformer.
In this project work, for the demonstration purpose a small step-down transformer of 12V, 1 amps rating at secondary is considered and small bulbs are connected as a load. In this project we are using CT transformer for measuring load current. All these parameters are converted into digital value by using ADC. If the parameters of the transformer (Current) regain the limited range values then Transformer will automatically shutdown. Microcontroller near the transformer section will continuously transmit all the parameters of the transformer to PC of control room.
HARDWARE COMPONENTS: • • • Microcontroller Power supply Relay
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
• • • •
Loads ADC 0804 Current Transformer PC
SOFTWARE TOOLS: • • • Keil micro vision Embedded C Express PCB
Applications: • • This project is used for protecting Transformers in sub stations, generating stations etc. Used for Industrial protection
Power supply Transformer A D C
RELAY Microcontroller LOAD
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
CONTENTS Abbreviations 1. Figure Locations 2. Introduction to the project 3. Block Diagram 4. Block Diagram Description 5. Schematic 6. Schematic Description 7. Hardware Components • Micro controllers • ADC 0804 • Relay • Power Supply 8. Circuit Description 9. Software components a. About Keil b. Embedded ‘C’ 10. Conclusion (or) Synopsis 11. Future Aspects Bibliography
T/C 2 capture register high byte .cc | www.Port 0 .Stack Pointer .Interrupt Priority control .Accumulator .Timer/counter 0 low byte .Timer/counter 0high byte .Port 2 .Timer/counter 2 low byte .Low byte .troubleshoot4free.T/C 2 capture register low byte
ACC B PSW SP DPTR DPL DPH P0 P1 P2 P3 IE IP TMOD TCON T2CON T2MOD TH0 TL0 TH1 TL1 TH2 TL2 RCAP2H RCAP2L .Data pointer .Timer/counter 2 high byte .Port 1 .co.Interrupt Enable control .Timer/counter mode2 control .Timer/counter 2 control .Timer/counter 1 low byte .B Register .final-yearprojects.Timer/counter 1 high byte .Timer/Counter control .Program Status Word .Timer/Counter Mode control .Port 3 .www.High byte .
Holtek’s Company .Liquid Crystal Display .Power control .final-yearprojects.troubleshoot4free.com/fyp/
SCON SBUF PCON PCB AGC RF HT LCD IR
.Serial control .www.Automatic Gain Control .Serial data buffer .Radio Frequency .co.Printed circuit Board .Infrared Radio Frequency
.cc | www.
co.www.cc | www. to very complex with multiple units. embedded systems ranges from portable devices such as digital watches and MP3 players. benefiting from economies of scale. such as a personal computer. even though they are more expandable in software terms. peripherals and networks mounted inside a large chassis or enclosure.com/fyp/
An embedded system is a special-purpose system in which the computer is completely encapsulated by or dedicated to the device or system it controls. factory controllers. to large stationary installations like traffic lights. design engineers can optimize it. This line of definition continues to blur as devices expand.troubleshoot4free. Physically. In terms of complexity embedded systems can range from very simple with a single microcontroller chip.
. — the line of nomenclature blurs even more. usually with very specific requirements. or the systems controlling nuclear power plants. Unlike a general-purpose computer.final-yearprojects. With the introduction of the OQO Model 2 with the Windows XP operating system and ports such as a USB port — both features usually belong to "general purpose computers". an embedded system performs one or a few predefined tasks. reducing the size and cost of the product. Personal digital assistants (PDAs) or handheld computers are generally considered embedded devices because of the nature of their hardware design. Since the system is dedicated to specific tasks. Embedded systems are often massproduced.
washing machines. sprinklers.final-yearprojects.co. and security monitoring systems Handheld calculators Handheld computers Household appliances.cc | www. DVD players and recorders Medical equipment Personal digital assistant Videogame consoles Computer peripherals such as routers and printers. Industrial controllers for remote machine operation. flight control hardware/software and other integrated systems in aircraft and missiles Cellular telephones and telephone switches Engine controllers and antilock brake controllers for automobiles Home automation products. air conditioners. television sets. including microwave ovens. such as thermostats.troubleshoot4free.www. such as inertial guidance systems.com/fyp/
Examples of Embedded Systems: • • • • • • • • • • • • Avionics.
hardware components.C and a step down transformer to step down the voltage.troubleshoot4free. We use rectifiers for converting the A. into D.www.final-yearprojects. The full description of the Power supply section is given in this documentation in the following sections i. here micro controller scan the output of current transformer through adc and send respective signals to PC and PC displays the status of the transformer under test in monitor.com/fyp/
Power supply Transformer A D C
RELAY Microcontroller LOAD
In this system we are using 5V power supply for microcontroller of Transmitter section as well as receiver section.C.e.co..
In this project the microcontroller plays a major role.cc | www.
So.co. so the output will be in analog form but the microcontroller not understanding the analog values.com/fyp/
The output of the current transformer connected to adc0804.final-yearprojects. we need to convert the analog output into digital form.
It is used as electro mechanical switch. So. Because it is analog device and the output is in the form of analog variable.
. Actually current transformer is an analog devise.www.
It is used to measure the load on transformer. ADC0804 performs the conversion to digital from analog. ADC0804 is a 8 bit converter.troubleshoot4free. And the output of this transformer is connected to ADC.cc | www. we need to convert it to digital.
In this project PC acts as output.cc | www. We are connecting the output of current transformer to 6th pin of ADC0804. In this project we make use of PC. Micro controller.troubleshoot4free.co.com/fyp/
Aim of our project is continuously monitor of the transformer and if any load on that transformer increases we protect that transformer. 11th and 12th pins of MAX232 is connected to 10th and 11th pins of controller. And PC is connected to microcontroller through RS232. This entire section acts as output and
. In this project current transformer acts as input. The RX and TX pin means 2nd and 3rd pins of RS232 is connected to 14 and 13th pins of MAX232. 10th and 11th pins of controller are P3. Transformer under test and relay. We use MAX232 IC to interface RS232 to uc.final-yearprojects. The 6th pin of ADC0804 acts as analog input.0 and P3.www.1.
final-yearprojects.cc | www.troubleshoot4free. Power supply is connected to 40th pin of the uc. Resets switch is connected to 9th pin of uc.
• Compatible with MCS-51® Products • 4K Bytes of In-System Programmable (ISP) Flash Memory – Endurance: 1000 Write/Erase Cycles • 4.www. We are using serial communication.co.com/fyp/
controller sends the signal through RS232 to PC and it will displayed on PC. Crystal oscillator is connected to 18th and 19th pin of uc. Relay is a electro mechanical switch.5V Operating Range • Fully Static Operation: 0 Hz to 33 MHz
. 20th pin is grounded.0V to 5. We use one relay to provide 230 volts for load.
co. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip.troubleshoot4free. high-performance CMOS 8-bit microcontroller with 4K bytes of in-system programmable Flash memory. the Atmel AT89S51 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.com/fyp/
• Three-level Program Memory Lock • 128 x 8-bit Internal RAM • 32 Programmable I/O Lines • Two 16-bit Timer/Counters • Six Interrupt Sources • Full Duplex UART Serial Channel • Low-power Idle and Power-down Modes • Interrupt Recovery from Power-down Mode • Watchdog Timer • Dual Data Pointer • Power-off Flag • Fast Programming Time • Flexible ISP Programming (Byte and Page Mode)
The AT89S51 is a low-power.www.cc | www.standard 80C51 instruction set and pinout. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry.final-yearprojects. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.
disabling all other chip functions until the next external interrupt or hardware reset. The Power-down mode saves the RAM contents but freezes the oscillator.final-yearprojects. serial port. In addition. and clock circuitry. timer/counters. a five vector two-level interrupt architecture.com/fyp/
The AT89S51 provides the following standard features: 4K bytes of Flash.www. two data pointers.co. 128 bytes of RAM. Watchdog timer. 32 I/O lines. two 16-bit timer/counters.
. on-chip oscillator. The Idle Mode stops the CPU while allowing the RAM. a full duplex serial port.cc | www. and interrupt system to continue functioning. the AT89S51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes.troubleshoot4free.
Ground. When 1s are written to port 0 pins. P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification.Supply voltage. GND . the pins can be used as high-impedance inputs. In this mode. External pull-ups are required during program verification.co. each pin can sink eight TTL inputs.cc | www.
.troubleshoot4free. Port 0: Port 0 is an 8-bit open drain bidirectional I/O port. As an output port. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory.www.final-yearprojects.com/fyp/
Pin Description: VCC .
During accesses to external data memory that use 8-bit addresses (MOVX @ RI). In this application. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. they are pulled high by the internal pull-ups and can be used as inputs. As inputs. The Port 2 output buffers cansink/source four TTL inputs. The Port 1 output buffers can sink/source four TTL inputs.final-yearprojects. they are pulled high by the internal pull-ups and can be used as inputs. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins. When 1s are written to Port 2 pins. As inputs. As inputs.
Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. Port 2 emits the contents of the P2 Special Function Register.com/fyp/
Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups.troubleshoot4free. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX @ DPTR).
. Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. they are pulled high by the internal pull-ups and can be used as inputs. as shown in the following table.cc | www. Port 3 receives some control signals for Flash programming and verification. Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups.www. Port 1 also receives the low-order address bytes during Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S51. When 1s are written to Port 1 pins. Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 uses strong internal pull-ups when emitting 1s.co.
however. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature.www. PSEN Program Store Enable (PSEN) is the read strobe to external program memory.com/fyp/
RST Reset input. When the AT89S51 is executing code from external program memory. ALE is active only during a MOVX or MOVC instruction. Otherwise. ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. EA/VPP External Access Enable. Note. that if lock bit 1 is programmed. If desired. This pin is also the program pulse input (PROG) during Flash programming. except that two PSEN activations are skipped during each access to external data memory. 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. EA will be internally latched on reset. PSEN is activated twice each machine cycle. This pin drives High for 98 oscillator periods after the Watchdog times out.final-yearprojects. In the default state of bit DISRTO. With the bit set. the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.co. ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. the RESET HIGH out feature is enabled.
. however. A high on this pin for two machine cycles while the oscillator is running resets the device. that one ALE pulse is skipped during each access to external data memory. EA should be strapped to VCC for internal program executions. Note.cc | www.troubleshoot4free. ALE operation can be disabled by setting bit 0 of SFR location 8EH. In normal operation.
.cc | www.com/fyp/
This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming.troubleshoot4free. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. Note that not all of the addresses are occupied. and write accesses will have an indeterminate effect. Read accesses to these addresses will in general return random data. XTAL2 Output from the inverting oscillator amplifier
Special Function Registers A map of the on-chip memory area called the Special Function Register (SFR) space is shown in Table 1.co. and unoccupied addresses may not be implemented on the chip.
cc | www. In that case.com/fyp/
User software should not write 1s to these unlisted locations.
.troubleshoot4free.final-yearprojects. Interrupt Registers: The individual interrupt enable bits are in the IE register.www.co. the reset or inactive values of the new bits will always be 0. since they may be used in future products to invoke new features. Two priorities can be set for each of the five interrupt sources in the IP register.
4) in the PCON SFR. two banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address locations 82H.troubleshoot4free.www. POF is set to “1” during power up.83H and DP1 at 84H-85H.final-yearprojects.
Power Off Flag: The Power Off Flag (POF) is located at bit 4 (PCON. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. It can be set and rest under software control and is not affected by reset.cc | www.co.
. The user should always initialize the DPS bit to the appropriate value before accessing the respective Data Pointer Register.com/fyp/
Dual Data Pointer Registers: To facilitate accessing both internal and external data memory.
all program fetches are directed to external memory. On the AT89S51.final-yearprojects.troubleshoot4free.co. Data Memory the AT89S51 implements 128 bytes of on-chip RAM. Program Memory If the EA pin is connected to GND. program fetches to addresses 0000H through FFFH are directed to internal memory and fetches to addresses 1000H through FFFFH are directed to external memory. Stack operations are examples of indirect addressing. Up to 64K bytes each of external Program and Data Memory can be addressed. The WDT consists of a 14-bit counter and the Watchdog Timer Reset (WDTRST) SFR. The 128 bytes are accessible via direct and indirect addressing modes.www. Watchdog Timer (One-time Enabled with Reset-out) The WDT is intended as a recovery method in situations where the CPU may be subjected to software upsets.com/fyp/
Memory Organization MCS-51 devices have a separate address space for Program and Data Memory. it will increment
. if EA is connected to VCC. To enable the WDT. When the WDT is enabled. The WDT is defaulted to disable from exiting reset.cc | www. so the 128 bytes of data RAM are available as stack space. a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H).
servicing the WDT should occur as it normally does whenever the AT89S51 is reset.cc | www. which is enabled prior to entering Power-down mode. When the interrupt is brought high. The WDT timeout period is dependent on the external clock frequency. it should be serviced in those sections of code that will periodically be executed prevent a WDT reset. it will drive an output RESET HIGH pulse at the RST pin. the user needs to service it by writing 01EH and 0E1H to WDTRST to avoid a WDT overflow. While in Powerdown mode. where TOSC=1/FOSC.troubleshoot4free. the interrupt is serviced. To reset the WDT the user must write 01EH and 0E1H to WDTRST. it will increment every machine cycle while the oscillator is running.www. The WDT counter cannot be read or written. Using the WDT To enable the WDT. and this will reset the device.co. There are two methods of exiting Power-down mode: by a hardware reset or via a level-activated external interrupt. a user must write 01EH and 0E1H in sequence to the DTRST register (SFR location 0A6H). WDT During Power-down and Idle In Power-down mode the oscillator stops. The RESET pulse duration is 98xTOSC. WDTRST is a write-only register. When WDT overflows. When WDT overflows.final-yearprojects. The interrupt is held low long enough for the oscillator to stabilize.com/fyp/
every machine cycle while the oscillator is running. the WDT is not started until the interrupt is pulled high. When the WDT is enabled. To make the best use of the WDT. which means the WDT also stops. There is no way to disable the WDT except through reset (either hardware reset or WDT overflow reset). To ensure that the WDT does not overflow within a few states of exiting Power-down. When Power-down is exited with hardware reset. it will generate an output RESET pulse at the RST pin. It is suggested that the WDT be reset during the interrupt service for the interrupt used to exit Power-down mode. This means the user must reset the WDT at least every 16383 machine cycles. the user does not need to service the WDT. When the WDT is enabled. To prevent the WDT from resetting the device while the interrupt pin is held low. The 14-bit counter overflows when it reaches 16383 (3FFFH). Exiting Power-down with an interrupt is significantly different. it is best to reset within the time required to
final-yearprojects. since they may be used in future AT89 products. the WDT will stop to count in IDLE mode and resumes the count upon exit from IDLE. which disables all interrupts at once. With WDIDLE bit enabled. IE also contains a global disable bit. The Timer 0 and Timer 1 flags. two timer interrupts (Timers 0 and 1). Interrupts The AT89S51 has a total of five interrupt vectors: two external interrupts (INT0 and INT1).5 is also unimplemented. Note that Table 4 shows that bit position IE. In the AT89S51. TF0 and TF1. Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. UART The UART in the AT89S51 operates the same way as the UART in the AT89C51. EA. The WDT keeps counting during IDLE (WDIDLE bit = 0) as the default state. the user should always set up a timer that will periodically exit IDLE. These interrupts are all shown in Figure 1. The values are then polled by the circuitry in the next cycle.www. User software should not write 1s to these bit positions. Before going into the IDLE mode. and the serial port interrupt. To prevent the WDT from resetting the AT89S51 while in IDLE mode. service the WDT. the WDIDLE bit in SFR AUXR is used to determine whether the WDT continues to count if enabled. Timer 0 and 1 Timer 0 and Timer 1 in the AT89S51 operate the same way as Timer 0 and Timer 1 in the AT89C51.6 is unimplemented.cc | www. are set at S5P2 of the cycle in which the timers overflow.co.com/fyp/
the WDT just before entering Power-down mode. and reenter IDLE mode. bit position IE.
troubleshoot4free. respectively. Either a quartz crystal or ceramic resonator may be used.cc | www.co. XTAL2 should be left unconnected while XTAL1 is driven. There are no requirements on the duty cycle of the external
. as shown in Figure 2. as shown in Figure 3.www. of an inverting amplifier that can be configured for use as an on-chip oscillator.com/fyp/
Oscillator Characteristics XTAL1 and XTAL2 are the input and output.final-yearprojects. To drive the device from an external clock source.
but access to the port pins is not inhibited. Power-down Mode
.final-yearprojects. The content of the on-chip RAM and all the special function registers remain unchanged during this mode.troubleshoot4free. but minimum and maximum voltage high and low time specifications must be observed. up to two machine cycles before the internal reset algorithm takes control.com/fyp/
clock signal. the instruction following the one that invokes idle mode should not write to a port pin or to external memory.cc | www. The idle mode can be terminated by any enabled interrupt or by a hardware reset.
Idle Mode In idle mode. The mode is invoked by software.co.www. Note that when idle mode is terminated by a hardware reset. the device normally resumes program execution from where it left off. since the input to the internal clocking circuitry is through a divide-bytwo flip-flop. On-chip hardware inhibits access to internal RAM in this event. the CPU puts itself to sleep while all the on-chip peripherals remain active. To eliminate the possibility of an unexpected write to a port pin when idle mode is terminated by a reset.
In the Power-down mode. The on-chip RAM and Special Function Registers retain their values until the Power-down mode is terminated. The latched value of EA must agree with the current logic level at that pin in order for the device to function properly. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. If the device is powered up without a reset.final-yearprojects. the logic level at the EA pin is sampled and latched during reset. Exit from Power-down mode can be initiated either by a hardware reset or by activation of an enabled external interrupt into INT0 or INT1.
Program Memory Lock Bits The AT89S51 has three lock bits that can be left unprogrammed (U) or can be programmed (P) to obtain the additional features listed in the following table. the latch initializes to a random value and holds that value until reset is activated.
When lock bit 1 is programmed. the oscillator is stopped. and the instruction that invokes Powerdown is the last instruction executed.www.cc | www.co.troubleshoot4free. Programming the Flash – Parallel Mode
. Reset redefines the SFRs but does not change the on-chip RAM.
5.7. an attempted read of the last byte written will result in the complement of the written data on P0. The programming interface needs a high-voltage (12-volt) program enable signal and is compatible with conventional third-party Flash or EPROM programmers.www. 3. P3. Activate the correct combination of control signals.final-yearprojects. data. 4.0 is pulled high again when programming is done to indicate READY.troubleshoot4free. and control signals should be set up according to the Flash programming mode table and Figures 13 and 14. The status of the individual lock bits can be verified directly by reading them back.com/fyp/
The AT89S51 is shipped with the on-chip Flash memory array ready to be programmed. and the next cycle may begin. Data Polling: The AT89S51 features Data Polling to indicate the end of a byte write cycle. Input the appropriate data byte on the data lines.cc | www. Data Polling may begin any time after a write cycle has been initiated. Ready/Busy: The progress of byte programming can also be monitored by the RDY/BSY output signal. take the following steps: 1. The bytewrite cycle is self-timed and typically takes no more than 50 μs. Input the desired memory location on the address lines. During a write cycle. changing the address and data for the entire array or until the end of the object file is reached. the address. Raise EA/VPP to 12V.
. the programmed code data can be read back via the address and data lines for verification. true data is valid on all outputs. 2. Once the write cycle has been completed. Program Verify: If lock bits LB1 and LB2 have not been programmed. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The AT89S51 code memory array is programmed byte-by-byte. P3.co. Repeat steps 1 through 5. To program the AT89S51. Programming Algorithm: Before programming the AT89S51.0 is pulled low after ALE goes high during programming to indicate BUSY.
500 ns. During chip erase. 100H. Power-up sequence: Apply power between VCC and GND pins.6 and P3. a Chip Erase operation is required.www. Programming the Flash – Serial Mode The Code memory array can be programmed using the serial ISP interface while RST is pulled to VCC.co. (000H) = 1EH indicates manufactured by Atmel (100H) = 51H indicates 89S51 (200H) = 06H Chip Erase: In the parallel programming mode.7 must be pulled to a logic low. the Programming Enable instruction needs to be executed first before other operations can be executed. Either an external system clock can be supplied at pin XTAL1 or a crystal needs to be connected across pins XTAL1 and XTAL2. With a 33 MHz oscillator clock.cc | www. a chip erase operation is initiated by issuing the Chip Erase instruction.
Reading the Signature Bytes: The signature bytes are read by the same procedure as a normal verification of locations 000H. the maximum SCK frequency is 2 MHz. chip erase is selftimed and takes about 500 ms. and 200H. Before a reprogramming sequence can occur. the following sequence is recommended: 1.final-yearprojects.troubleshoot4free. After RST is set high. a chip erase operation is initiated by using the proper combination of control signals and by pulsing ALE/PROG low for a duration of 200 ns . The serial interface consists of pins SCK. except that P3. In the serial programming mode. The maximum serial clock (SCK) frequency should be less than 1/16 of the crystal frequency. MOSI (input) and MISO (output). The Chip Erase operation turns the content of every memory location in the Code array into FFH. The values returned are as follows. In this mode. a serial read from any address location will return 00H at the data output. Serial Programming Algorithm To program and verify the AT89S51 in the serial programming mode.
Power-off sequence (if needed): Set XTAL1 to “L” (if a crystal is not used). Data Polling: The Data Polling feature is also available in the serial mode. Serial Programming Instruction Set The Instruction Set for Serial Programming follows a 4-byte protocol and is shown in Table 8 on page 18. If a crystal is not connected across pins XTAL1 and XTAL2. RST can be set low to commence normal device operation.co. Enable serial programming by sending the Programming Enable serial instruction to pin MOSI/P1. during a write cycle an attempted read of the last byte written will result in the complement of the MSB of the serial output byte on MISO. In this mode. 2. The write cycle is self-timed and typically takes less than 0.5.www. The frequency of the shift clock supplied at pin SCK/P1. The Code array is programmed one byte at a time in either the Byte or Page mode. 4. 5.6.com/fyp/
Set RST pin to “H”.troubleshoot4free. apply a 3 MHz to 33 MHz clock to XTAL1 pin and wait for at least 10 milliseconds.cc | www.5 ms at 5V. Programming Interface – Parallel Mode
. Set RST to “L”. At the end of a programming session.final-yearprojects. Turn VCC power off. Any memory location can be verified by using the Read instruction that returns the content at the selected address at serial output MISO/P1. 3.7 needs to be less than the CPU clock at XTAL1 Divided by 16.
troubleshoot4free. All major programming vendors offer worldwide support for the Atmel
microcontroller series. Please contact your local programming vendor for the appropriate software revision.com/fyp/
Every code byte in the Flash array can be programmed by using the appropriate combination of control signals.final-yearprojects.
.cc | www.co. The write operation cycle is self-timed and once initiated.www. will automatically time itself to Completion.
troubleshoot4free.co.www.final-yearprojects.cc | www.com/fyp/
troubleshoot4free.cc | www.www.co.com/fyp/
For Page Read/Write.final-yearprojects.
. After the command byte and upper address byte are latched.cc | www. SCK should be no faster than 1/16 of the system clock at XTAL1.troubleshoot4free. Then the next instruction will be ready to be decoded.com/fyp/
After Reset signal is high.co. each byte thereafter is treated as data until all 256 bytes are shifted in/out.www. the data always starts from byte 0 to 255. SCK should be low for at least 64 system clocks before it goes high to clock in the enable data bytes. No pulsing of Reset signal is necessary.
*NOTICE: Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. each uses cables with many wire strips.cc | www.troubleshoot4free.final-yearprojects.co. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
Computers can transfer data in two ways: parallel and serial. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this specification is not implied. In parallel data transfers. often 8 or more lines (wire conductors) are used to transfer data to a device that is only a few feet away. Examples of parallel data transfer are printers and hard disks. Although in such cases a lot of data can be transferred in a short amount of time by using many wires in
it is full duplex. and when the data begins and ends. If data is to be transferred on the telephone line. which stands for “modulator/demodulator”. the serial method is used.www. the distance cannot be great. performs this conversion. Of course. in order to transfer and receive data simultaneously. asynchronous and
synchronous. Duplex transmissions can be half or full duplex. If data is transmitted one way at a time. on how the data is packed.troubleshoot4free. while block-oriented data transfers use the synchronous method. in contrast to parallel communication. the data is sent one bit at a time. it is a duplex transmission. in which the data is sent a byte or more at a time. In serial communication. Asynchronous serial communication and data framing The data coming in at the receiving end of the data line in a serial data transfer is all 0s and 1s.cc | www.com/fyp/
parallel. each character is placed between start and
. This is in contrast to simplex transmissions such as with printers. it is referred to as half duplex. how many bits constitute a character. in which the computer only sends data. Start and stop bits Asynchronous serial data communication is widely used for characteroriented transmissions. there by making possible fast data transfer using only a few wires. Serial data communication uses two methods. while the asynchronous method transfers a single byte at a time. A peripheral device called a modem.final-yearprojects.co. In the asynchronous method. The 8051 has serial communication capability built into it. Serial communication of the 8051 is the topic of this chapter. depending on whether or not the data transfer can be simultaneous. it must be converted from 0s and 1s to audio tones. If the data can go both ways at the same time. a protocol. full duplex requires two wire conductors for the data lines. it is difficult to make sense of the data unless the sender and receiver agree on a set of rules. which are sinusoidal-shaped signals. The synchronous method transfers a block of data at a time. In data transmission if the data can be transmitted and received. To transfer to a device located many meters away. one for transmission and one for reception.
the data is sent one bit at a time. such as ASCII characters.final-yearprojects. Data transfer rate The rate of data transfer in serial data communication is stated in bps (bits per second). but the stop bit can be one or two bits.
In the data framing for asynchronous
communications. the serial method is used.
Computers can transfer data in two ways: parallel and serial. sometimes transfers several bits of data. Examples of parallel transfers are printers and hard disks. there by making possible fast data transfer using only a few wires. As far as the conductor wire is concerned.co. Another widely used terminology for bps is baud rate. are packed between a start bit and a stop bit. the baud rate is generally limited to 100. and for this reason we use the bps and baud interchangeably.
IBMPC/XT could transfer data at the rate of 100 to 9600 bps.000bps. This is due to the fact that baud rate is the modem terminology and is defined as the number of signal changes per second.www. each uses cables with many wire strips.
however. Although in such cases a lot of data can be transferred in a short amount of time by using many wires in parallel. In parallel data transfers.cc | www.
For example. To transfer to a device located many meters away. The start bit is always a 0 (low) and the stop bit (s) is 1 (high). The data transfer rate of given computer system depends on
communication ports incorporated into that system. However. the early In recent years. the baud and bps rates are not necessarily equal. In modems a single change of signal. It must be noted that in asynchronous serial data communication. in contrast to parallel communication. Pentium based PCS transfer data at rates as high as 56K bps. the distance cannot be great. This is called framing. the baud rate and bps are the same. The 8051 has serial communication capability built into it. the data.troubleshoot4free. The start bit is always one bit.com/fyp/
stop bits. often 8 or more lines (wire conductors) are used to transfer data to a device that is only a few feet away. In serial communication. The PC uses RS 232 as a Serial Communication Standard.
. in which the data is sent a byte or more at a time.
cc | www. and vice versa.troubleshoot4free. an interfacing standard called RS232 was set by the Electronics Industries Association (EIA) in 1960. making -3 to +3 undefined. DB-9 pin connector 12345 6789
(Out of computer and exposed end of cable)
RS232 Standards To allow compatibility among data communication equipment made by various manufacturers. a 1 is represented by -3 to -25V. which uses 9 pins only. its input and output voltage levels are not TTL compatible. DB25P refers to the plug connector (male) and DB-25S is for the socket connector (female). as shown in table.www. However. MAX232 IC chips are commonly referred to as line drivers. RS232 is the most widely used serial I/O interfacing standard. In labeling. to connect any RS232 to a microcontroller system we must use voltage converters such as MAX232 to convert the TTL logic levels to the RS232 voltage levels. For this reason. Today. In 1963 it was modified and called RS232A. RS232 pins
RS232 cable connector commonly referred to as the DB-25 connector. respectively. since the standard was set long before the advert of the TTL logic family.co.final-yearprojects. Since not all the pins are used in PC cables. IBM introduced the DB-9 Version of the serial I/O standard. RS232B AND RS232C were issued in 1965 and 1969. while a 0 bit is +3 to +25V. In RS232. This standard is used in PCs and numerous types of equipment.
co. RTS and CTS are active low pins. DSR. TXD: carries data from DTE to the DCE. Rx.cc | www.www.com/fyp/
1 Data carrier detect (DCD) 2 Received data (RXD) 3 Transmitted data (TXD) 4 Data terminal ready(DTR) 5 Signal ground (GND) 6 Data set ready (DSR) 7 Request to send (RTS) 8 Clear to send (CTS) 9 Ring indicator (RI) Note: DCD. The method used by RS-232 for communication allows for a simple connection of three lines namely Tx.troubleshoot4free. and Ground. RXD: carries data from DCE to the DTE SG: signal ground
8051 connection to RS232
In the other words. and vice versa. while the line drivers for RXD are designated as R1 and R2. therefore. These two pins are TXD and RXD and are a part of the port 3 (P3. with no need for the power supplies. In many applications only one of each is used. One such line driver is the MAX232 chip.final-yearprojects.www. therefore.1).0 and P3.co. is the same as the source voltage for the 8051.
The 8051 has two pins that are used specifically for transferring and receiving data serially. they require a line driver to make them RS232 compatible. The MAX232 has two sets of line drivers for transferring and receiving data. with a single +5V power supply we can power both the 8051 and MAX232.
MAX 232 Serial Line Drivers: The pin-out diagram of MAX 232 is shown below.
MAX232 converts from RS232 voltage levels to TTL voltage levels.
The RS232 standard is not TTL compatible. it requires a Line Driver such as the MAX232 chip to convert RS232 voltage levels to TTL levels. Pin 11 of the 8051 is designated as TXD and pin 10 as RXD. These pins are TTL compatible. One advantage of the MAX232 chip is that it uses a +5V power source which.troubleshoot4free. and vice versa.cc | www. The line drivers used for TXD are called T1 and T2.
www.co.cc | www.troubleshoot4free.com/fyp/
MAX 232E Dual Driver/Receiver
MAX 232 Operating Circuit:
And the 12. 8 form the vice versa inputs and outputs as shown in fig.co. 13. 7 form the outputs for RS 232 logic. 11 form the dual inputs with TTL logic whereas 14.com/fyp/
Pin 10.troubleshoot4free.www. The inputs and outputs of the drivers and receivers are shown in fig above.
. 9.final-yearprojects.cc | www.
.final-yearprojects. A d.C Power Supply”
For example a 5V regulated power supply system as shown below:
A transformer is an electrical device which is used to convert electrical power from one
Electrical circuit to another without change in frequency.co. each of which performs a particular function.cc | www.c power supply which maintains the output voltage constant irrespective of a.troubleshoot4free.www. A power supply can by broken down into a series of blocks.com/fyp/
The power supplies are designed to convert high voltage AC mains electricity to a suitable low voltage supply for electronics circuits and other devices.c mains fluctuations or load variations is known as “Regulated D.
The two lines in the middle of the circuit symbol represent the core. instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer.troubleshoot4free. determines the ratio of the voltages.co. There is no electrical connection between the two coils. Transformers waste very little power so the power out is (almost) equal to the power in. A step-down transformer has a large number of turns on its primary (input) coil which is connected to the high voltage mains supply.
An Electrical Transformer
Turns ratio = Vp/ VS = Np/NS Power Out= Power In VS X IS=VP X IP Vp = primary (input) voltage Np = number of turns on primary coil Ip = primary (input) current
Transformers convert AC electricity from one voltage to another with little loss of power. called the turn’s ratio.cc | www.www.final-yearprojects. Note that as voltage is stepped down current is stepped up. The input coil is called the primary and the output coil is called the secondary. and a small number of turns on its secondary (output) coil to give a low output voltage. Transformers work only with AC and this is one of the reasons why mains electricity is AC. The ratio of the number of turns on each coil. Step-up transformers increase in output voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains voltage to a safer low voltage. step-down transformers decrease in output voltage.
cc | www.c to d.
Comparison of rectifier circuits:
Type of Rectifier Parameter Number of diodes 1 PIV of diodes Vm 2Vm Vm 2 4 Half wave Bridge Full wave
A circuit which is used to convert a.final-yearprojects. Bridge type full bridge rectifier. The process of conversion a.c to dc is known as RECTIFIER. Centre tap full wave rectifier.troubleshoot4free.www.c is called “rectification”
TYPES OF RECTIFIERS:
Half wave Rectifier Full wave rectifier 1.C output voltage
A bridge rectifier makes use of four diodes in a bridge arrangement as shown in fig(a) to achieve full-wave rectification.troubleshoot4free. in our project we are using full wave bridge rectifier circuit. This is a widely used configuration.636Vm
0. This is a widely used configuration.final-yearprojects.
Ripple factor Ripple frequency Rectification efficiency Transformer Utilization Factor(TUF) RMS voltage Vrms
1. both with individual diodes wired as shown and with single component bridges where the diode bridge is wired internally.812
0. both with individual diodes wired as shown and with single component bridges where the diode bridge is wired internally.812
From the above comparison we came to know that full wave bridge rectifier as more advantages than the other two rectifiers.
Bridge Rectifier: A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave rectification.812
0.cc | www.co.21
cc | www. The current flow direction is shown in the fig (b) with dotted arrows.com/fyp/
During positive half cycle of secondary.co.
During negative half cycle of secondary voltage. The current flow direction is shown in the fig (c) with dotted arrows.www.final-yearprojects. the diodes D2 and D3 are in forward biased while D1 and D4 are in reverse biased as shown in the fig(b).troubleshoot4free.
. the diodes D1 and D4 are in forward biased while D2 and D3 are in reverse biased as shown in the fig(c).
(a) A capacitor. prevents the passage of the ripple current (due to high impedance at ripple frequency) while allowing the d.co.to appears the load.
(b) An inductor. Ripples can be removed by one of the following methods of filtering. At ripple frequency and leave the d. provides an easier by –pass for the ripples voltage though it due to low impedance.final-yearprojects.www.c component to reach the load
We have seen that the ripple content in the rectified output of half wave rectifier is 121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of ripples is not acceptable for most of the applications. in parallel to the load.c.troubleshoot4free.c component of rectifier output but allows the d.cc | www. in series with the load.com/fyp/
A Filter is a device which removes the a.c)
.c (due to low resistance to d.
and then discharges as it supplies current to the output.
Filtering is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir. mainly for use in dual supplies. supplying current to the output when the varying DC voltage from the rectifier is falling. Two cases of capacitor filter. Hence large value of capacitor is placed to reduce ripples and to improve the DC component. C = ¼*√3*f*r*Rl Where. Rl = load resistance Note: In our circuit we are using 1000µF.com/fyp/
(c) Various combinations of capacitor and inductor.troubleshoot4free.
Voltage regulator ICs is available with fixed (typically 5.co. To calculate the value of capacitor(C).www. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection'). one applied on half wave rectifier and another with full wave rectifier.cc | www. The LM7805 is simple to use. The maximum current they can pass also rates them. multiple section filter etc. Negative voltage regulators are available. Many of the fixed voltage regulator ICs have 3 leads and look like power transistors. such as L-section filter section filter. which make use of both the properties mentioned in (a) and (b) above. You simply connect the positive lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin.
.4 × RMS value). such as the 7805 +5V 1A regulator shown on the right. r = ripple factor. Filtering significantly increases the average DC voltage to almost the peak value (1. 12 and 15V) or variable output voltages. The capacitor charges quickly near the peak of the varying DC. f = supply frequency.final-yearprojects.
the LM78XX usually results in an effective output impedance improvement of two orders of magnitude. 10V.
Fig 6. you get a 5 volt supply from the output pin.com/fyp/
connect the negative lead to the Common pin and then when you turn on the power. The LM78XX is available in the TO-252. 24V
.0V.12V.www. 8V.5A • Output Voltage Tolerance of 5% • Internal thermal overload protection • Internal Short-Circuit Limited • No External Component • Output Voltage 5.co.
• Output Current of 1. When used as a zener diode/resistor combination replacement.troubleshoot4free.final-yearprojects. lower quiescent current. 15V. 6V. TO-220 & TO-263packages. 18V. 9V.cc | www. The LM78XX offer several fixed output voltages making them useful in wide range of applications.6 A Three Terminal Voltage Regulator 78XX:
The Bay Linear LM78XX is integrated linear positive regulator with three terminals.1.
<100us • Easy Interface to Most Microprocessors • Will Operate in a “Stand Alone” Mode • Differential Analog Voltage Inputs • Works with Band gap Voltage References • TTL Compatible Inputs and Outputs • On-Chip Clock Generator
. In addition.No Interfacing Logic Required • Conversion Time .com/fyp/
• Offer in plastic TO-252. . . . . A/D Converters
The ADC080X family is CMOS 8-Bit. . .cc | www. . . . . . . Microprocessor-Compatible. . These converters appear to the processor as memory locations or I/O ports.www. . TO-220 & TO-263
• Direct Replacement for LM78XX
ANALOG TO DIGITAL CONVERTER
8-Bit. . .troubleshoot4free. the voltage reference input can be adjusted to allow encoding any smaller analog voltage span to the full 8 bits of resolution. . . The differential analog voltage input has good common mode-rejection and permits offsetting the analog zero-input voltage value. . .final-yearprojects. . successive approximation A/D converters which use a modified potentiometer ladder and are designed to operate with the 8080A control bus via three-state outputs. . . and hence no interfacing logic is required. .
• 80C48 and 80C80/85 Bus Compatible .co. .
. . . .www. 0V to 5V • No Zero-Adjust Required • 80C48 and 80C80/85 Bus Compatible . .com/fyp/
• Analog Voltage Input Range (Single + 5V Supply) .troubleshoot4free. . . . .co. . . . .final-yearprojects. . . . . .cc | www. .No Interfacing Logic Required
. . .
troubleshoot4free.cc | www.com/fyp/
cc | www.final-yearprojects.troubleshoot4free.com/fyp/
An actual converter has integral linearity and differential linearity errors.cc | www.final-yearprojects.com/fyp/
As the peripheral signals usually are substantially different from the ones that microcontroller can understand (zero and one). the input voltage can be any where within a one LSB quantization interval.1 This analog to digital converter (ADC) converts a continuous analog input signal. which is easily acceptable to a computer.4. Integral linearity error is a measure of the deviation of the code transition points from the fitted line. the output code is constant. For a given output code.www.
. This task is performed by a block for analog to digital conversion or by an ADC.
As the input increases from zero to full scale. they have to be converted into a pattern which can be comprehended by a micro-controller. The width of an ideal step represents the size of the least significant Bit (LSB) of the converter and corresponds to an input voltage of VES/2n for an n-bit converter. Obviously for an input voltage range of one LSB.co.
fig.troubleshoot4free. Differential linearity error is the difference between the actual code-step width and one LSB. into an n-bit binary number. the output code stair steps. This block is responsible for converting an information about some analog value to a binary number and for follow it through to a CPU block so that CPU block can further process it.
or the zero base technique to provide the reference line. the successive approximation A/D converter. These two sub circuits are an analog
multiplexer and an A/D Converter.co.final-yearprojects. This IC is having built in multi-plexer so that channel selection can be done automatically.
The ADC 0804 shown in figure can be functionally divided into 2 basic sub circuits. and a time dependant reference voltage VR is connected to the other input of the comparator.troubleshoot4free.
In this project work ADC 080X (8 Bit A/D converter) is used to convert analog voltage variations (according to the condition of the parameters) into digital pulses. the un-known input voltage VX is connected to one input of an analog signal comparator. transforms the analog output of the multiplexer to an 8-bit digital word. depending on the data latched in to 3-bit multiplexer address register.www. using least square fit.com/fyp/
The errors of the converter are determined by the fitting of a line through the code transition points. The output of the multiplexer goes to
The second functional block. The multiplexer uses 8 standard CMOS analog switches to provide to up to 4 analog inputs. the terminal point method. In the basic conversion scheme of ADC.
A good converter will have less than 0. The
switches are selectively turned on.cc | www.5 LSB linearity error and no missing codes over its full temperature range.
Even though there is no conversion in progress the ADC0804 is still internally cycling through these 8 clock periods. As long as the start pin is held high no conversion begins. so it will go low within 8 clock periods of the rising edge of the start pulse.troubleshoot4free. but this is not important. is what the control logic is looking for. which is tapped by a MOSFET transistor switch tree. It. To do this. The converter control logic controls the switch tree. yielding a total conversion time of clock periods. there are 8 clock periods per approximation. B. The TRI-STATE capability of the latch allows easy interfaces to bus oriented systems. is controlled by the 8 clock period cycle. since the positive transition of EOC. A start pulse can occur any time during this cycle but the conversion will not actually begin until the converter internally cycles to the beginning of the next 8 clock period sequence. On the rising edge of this pulse the internal registers are cleared and on the falling edge the start conversion is initiated.
As mentioned earlier. once every 8-clock period.com/fyp/
one of two comparator inputs. To begin the conversion.www.
The operation on these converters by a microprocessor or some control logic is very simple. the START pin is pulsed. the control logic and the successive approximation register (SAR) will decide whether the next tap to be selected should be higher or lower than the present tap on the resistor ladder. which occurs at the end of a conversion. The EOC output is triggered on the rising edge of the start pulse. The controlling device first selects the desired input channel.
. a 3-bit channel address is placed on the A.final-yearprojects.
When the conversion cycle is complete the resulting data is loaded into the TRI-STATE output latch. One can see that it is entirely possible for EOC to go low before the conversion starts internally.cc | www. The data in the output latch can be then be read by the host system any time before the end of the next conversion. funneling a particular tap voltage to comparator. but when the start pin is taken low the conversion will start within 8 clock periods. The other input is derived from a 256R resistor ladder. C in and out pins. Based on the result of this comparison.co. too. This algorithm is executed 8 times per conversion. and the ALE input is pulsed positively. clocking the address into the multiplexer address register.
Once EOC does go high this signals the interface logic that the data resulting from the conversion is ready to be read.
MUX Addres s
SAR 4x1 Analog MUX TRISTATE Output
.cc | www. This enables the TRISTATE outputs.www.final-yearprojects.co. allowing the data to be read. Figure shows the timing diagram. The output enable(OE) is then raised high.troubleshoot4free.
There is no electrical connection inside the relay between the two circuits. the link is magnetic and mechanical. The coil current can be on or off so relays have two switch positions and they are double throw (changeover) switches.cc | www.
The coil of a relay passes a relatively large current.co.com/fyp/
Relay is an electrically operated switch. typically 30mA for a 12V relay.final-yearprojects.
Relays allow one circuit to switch a second circuit which can be completely separate from the first. Current flowing through the coil of the relay creates a magnetic field which attracts a lever and changes the switch contacts. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit.www. but it can be as much as 100mA for relays designed to operate from lower
voltages. for example relays with 4 sets of changeover contacts are readily available. To prevent damage you must connect a protection diode across the relay coil.final-yearprojects. You can see a lever on the left being attracted by magnetism when the coil is switched on. The animated picture shows a working relay with its coil and switch contacts.www. The supplier's catalogue should show you the relay's connections. For further information about switch contacts and the terms used to describe them please see the page on switches.
The relay's switch connections are usually labeled as COM. This lever moves the switch contacts. There is one set of contacts (SPDT) in the foreground and another behind them. The coil will be obvious and it may be connected either way round.cc | www. Relays are usually SPDT or DPDT but they can have many more sets of switch contacts. NC and NO:
. Most relays are designed for PCB mounting but you can solder wires directly to the pins providing you take care to avoid melting the plastic case of the relay. making the relay DPDT. Most ICs (chips) cannot provide this current and a transistor is usually used to amplify the small IC current to the larger value required for the relay coil.troubleshoot4free. The maximum output current for the popular 555 timer IC is 200mA so these devices can supply relay coils directly without amplification.co. Relay coils produce brief high voltage 'spikes' when they are switched off and this can destroy transistors and ICs in the circuit.
Physical size and pin arrangement If you are choosing a relay for an existing PCB you will need to ensure that its dimensions and pin arrangement are suitable. For example: A 12V supply relay with a coil resistance of 400 passes a coil voltage coil
current of 30mA. Switch ratings (voltage and current) the relay's switch contacts must be suitable for the circuit they are to control. COM is connected to this when the relay coil is off. Some relays operate perfectly well with a supply voltage which is a little lower than their rated value.troubleshoot4free. You can use Ohm's law to calculate the current: supply Relay current = resistance 4. 3.cc | www. 5. COM is connected to this when the relay coil is on. Many relays have a coil rated for a 12V supply but 5V and 24V relays are also readily available.final-yearprojects. 2.
Choosing a relay
You need to consider several features when choosing a relay: 1. This is OK for a 555 timer IC (maximum output current 200mA). Connect to COM and NO if you want the switched circuit to be on when the relay coil is on. NC = Normally Closed.com/fyp/
• • • •
COM = Common.co. it is the moving part of the switch.www. Coil voltage the relay's coil voltage rating and resistance must suit the circuit powering the relay coil. but it is too much for most ICs and they will require a transistor to amplify the current. You should find this information in the supplier's catalogue. always connect to this. Coil resistance the circuit must be able to supply the current required by the relay coil. NO = Normally Open. Connect to COM and NC if you want the switched circuit to be on when the relay coil is off. You will need to check the voltage
but note that a low power transistor may still be needed to switch the current for the relay's coil! The main advantages and disadvantages of relays are listed below: Advantages of relays:
Relays can switch AC and DC. Note that the voltage rating is usually higher for AC.
Relays and transistors compared
Like relays. The diagram shows how a signal diode (eg 1N4148) is connected across the relay coil to provide this protection. Conduction only occurs when the relay coil is switched off.
. Relays can switch high voltages. transistors can only switch DC. DPDT etc). at this moment current tries to continue flowing through the coil and it is harmlessly diverted through the diode.final-yearprojects.cc | www. In these cases a relay will be needed. However transistors cannot switch AC or high voltages (such as mains electricity) and they are not usually a good choice for switching large currents (> 5A). transistors cannot. for example: "5A at 24V DC or 125V AC". Switch contact arrangement (SPDT. Without the diode no current could flow and the coil would produce a damaging high voltage 'spike' in its attempt to keep the current flowing.com/fyp/
and current ratings. Most relays are SPDT or DPDT which are often described as "single pole changeover" (SPCO) or "double pole changeover" (DPCO). 6. transistors can be used as an electrically operated switch.troubleshoot4free. For switching small DC currents (< 1A) at low voltage they are usually a better choice than a relay. Note that the diode is connected 'backwards' so that it will normally not conduct.www. For further information please see the page on switches
Protection diodes for relays
Transistors and ICs (chips) must be protected from the brief high voltage 'spike' produced when the relay coil is switched off.co.
000 operations at no load Electrical 100. Relays require more current than many chips can provide.troubleshoot4free.co. so a low power transistor may be needed to switch the current for the relay's coil. Relays cannot switch rapidly (except reed relays).
These SPDT relays covers switching capacity of 10A in spite of miniature size for PCB Mount.000 at rated resistive load Applications: • • • • Domestic Appliances Office Machines Audio Equipment Coffee-Pots
.cc | www.final-yearprojects. transistors can switch many times per second.www. Relays can switch many contacts at once.com/fyp/
Relays are a better choice for switching large currents (> 5A). Contact Rating 12A at 120VAC
10A at 120VAC 10A at 24VDC
Mechanical 10. Relays use more power due to the current flowing through their coil.000.
Disadvantages of relays:
Relays are bulkier than transistors for switching small currents.
.co.final-yearprojects. With the help of this kind of system. If the parameters of the transformer (Current) regain the limited range values
. the maintenance staff of the department can have a continuous vigilance over the transformer..e. In the display unit we can view the continuous information of transformer i. In the main station these parameters are displayed on the PC monitor. In this project we are using CT transformer for measuring load current.cc | www.troubleshoot4free. when the power is resumed etc. due to what reason the transformer has been failed.com/fyp/
In this project we designed a system in such a way that it will monitor the load of the transformer continuously and that information is transferred to the control room.www.
In this project work. 1 amps rating at secondary is considered and small bulbs are connected as a load. for the demonstration purpose a small step-down transformer of 12V. All these parameters are converted into digital value by using ADC.
A make facility.
ABOUT SOFTWARE Software’s used are:
*Keil software for c programming *Express PCB for lay out design *Express SCH for schematic design
What's New in µVision3?
µVision3 adds many new features to the Editor like Text Templates.troubleshoot4free. Editor.co.com/fyp/
then Transformer will automatically shutdown. Quick Function Navigation.cc | www.
What is µVision3?
µVision3 is an IDE (Integrated Development Environment) that helps you write. Tool configuration.www.
. Microcontroller near the transformer section will continuously transmit all the parameters of the transformer to PC of control room. A powerful debugger. and Syntax Coloring with brace high lighting Configuration Wizard for dialog based startup and debugger setup. It encapsulates the following components: • • • • • A project manager. compile. µVision3 is fully compatible to µVision2 and can be used in parallel with µVision2. and debug embedded programs.final-yearprojects.
3. you must: 1. Select Project . assemble. Files. Add/Files. 6. 5. and \ARM\. MEASURE is a data acquisition system for analog and digital systems.www.final-yearprojects. several example programs (located in the \C51\Examples.166\EXAMPLES\HELLO\HELLO.\Examples) are provided. and links the files in your project. µVision2 compiles. Select Project . Select a directory and enter the name of the project file. \C166\Examples.Options and set the tool options. Note when you select the target device from the Device Database™ all special options are set automatically. Groups.
Creating Your Own Application in µVision2
To create a new project in µVision2. Select Project . TRAFFIC is a traffic light controller with the RTX Tiny operating system.Targets. You typically only need to configure the memory map of your
..UV2). \C251\Examples.co. and add the source files to the project. or C16x/ST10 device from the Device Database™. • • • • • • HELLO is a simple program that prints the string "Hello World" using the Serial Interface. Select Project .troubleshoot4free. Create source files to add to the project. 251.com/fyp/
To help you get started. Select Project . 2. select Source Group1. assembles. DHRY is the Dhrystone Benchmark. SIEVE is the SIEVE Benchmark. and link) an application in µVision2.Rebuild all target files or Build target. Select Project -(forexample. WHETS is the Single-Precision Whetstone Benchmark.
Additional example programs not listed here are provided for each device architecture.cc | www. 2.Select Device and select an 8051.
Building an Application in µVision2
To build (compile. you must: 1. 4..New Project.
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
target hardware. Default memory model settings are optimal for most applications. 7. Select Project - Rebuild all target files or Build target.
Debugging an Application in µVision2
To debug an application created using µVision2, you must: 1. Select Debug - Start/Stop Debug Session. 2. Use the Step toolbar buttons to single-step through your program. You may enter G, main in the Output Window to execute to the main C function. 3. Open the Serial Window using the Serial #1 button on the toolbar. Debug your program using standard options like Step, Go, Break, and so on. Starting µVision2 and Creating a Project µVision2 is a standard Windows application and started by clicking on the program icon. To create a new project file select from the µVision2 menu. Project – New Project…. This opens a standard Windows dialog that asks you for the new project file name. We suggest that you use a separate folder for each project. You can simply use the icon Create New Folder in this dialog to get a new empty folder. Then select this folder and enter the file name for the new project, i.e. Project1. µVision2 creates a new project file with the name PROJECT1.UV2 which contains a default target and file group name. You can see these names in the Project. Window – Files. Now use from the menu Project – Select Device for Target and select a CPU for your project. The Select Device dialog box shows the µVision2 device database. Just select the micro controller you use. We are using for our examples the Philips 80C51RD+ CPU. This selection sets necessary tool options for the 80C51RD+ device and simplifies in this way the tool Configuration. Building Projects and Creating a HEX Files
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
Typical, the tool settings under Options – Target are all you need to start a new application. You may translate all source files and line the application with a click on the Build Target toolbar icon. When you build an application with syntax errors, µVision2 will display errors and warning messages in the Output Window – Build page. A double click on a message line opens the source file on the correct location in a µVision2 editor window. Once you have successfully generated your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to download the software into an EPROM programmer or simulator. µVision2 creates HEX files with each build process when Create HEX files under Options for Target – Output is enabled. You may start your PROM programming utility after the make process when you specify the program under the option Run User Program #1. CPU Simulation µVision2 simulates up to 16 Mbytes of memory from which areas can be mapped for read, write, or code execution access. The µVision2 simulator traps and reports illegal memory accesses. In addition to memory mapping, the simulator also provides support for the integrated peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU you have selected are configured from the Device.
Database selection you have made when you create your project target. Refer to page 58 for more Information about selecting a device. You may select and display the on-chip peripheral components using the Debug menu. You can also change the aspects of each peripheral using the controls in the dialog boxes. Start Debugging
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
You start the debug mode of µVision2 with the Debug – Start/Stop Debug Session command. Depending on the Options for Target – Debug Configuration, µVision2 will load the application program and run the startup code µVision2 saves the editor screen layout and restores the screen layout of the last debug session. If the program execution stops, µVision2 opens an editor window with the source text or shows CPU instructions in the disassembly window. The next executable statement is marked with a yellow arrow. During debugging, most editor features are still available.
For example, you can use the find command or correct program errors. Program source text of your application is shown in the same windows. The µVision2 debug mode differs from the edit mode in the following aspects: _ The “Debug Menu and Debug Commands” described on page 28 are Available. The additional debug windows are discussed in the following. _ The project structure or tool parameters cannot be modified. All build Commands are disabled. Disassembly Window The Disassembly window shows your target program as mixed source and assembly program or just assembly code. A trace history of previously executed instructions may be displayed with Debug – View Trace Records. To enable the trace history, set Debug – Enable/Disable Trace Recording. If you select the Disassembly Window as the active window all program step commands work on CPU instruction level rather than program source lines. You can select a text line and set or modify code breakpoints using toolbar buttons or the context menu commands. You may use the dialog Debug – Inline Assembly… to modify the CPU instructions. That allows you to correct mistakes or to make temporary changes to the target program you are debugging.
Click on the Keil uVision Icon on Desktop The following fig will appear
Click on the Project menu from the title bar Then Click on New Project
Steps for executing the Keil programs:
1.cc | www.co.
Then Click on Save button above.troubleshoot4free.
Save the Project by typing suitable project name with no extension in u r own folder sited in either C:\ or D:\
.cc | www.www.co.final-yearprojects.
Select the component for u r project.
Select AT89C51 as shown below
.troubleshoot4free. i.www.cc | www. 8. Atmel…… Click on the + Symbol beside of Atmel
Then Click on “OK” The Following fig will appear
12.troubleshoot4free.cc | www. you would get another option “Source group 1” as shown in next page.co. 14.
Then Click either YES or NO………mostly “NO” Now your project is ready to USE Now double click on the Target1. 13. 11.com/fyp/
Click on the file option from menu bar and select “new”
15.cc | www.final-yearprojects.
. and just maximize it by double clicking on its blue boarder. then save it with extension “.
The next screen will be as shown in next page.
17. asm” and for “C” based program save it with extension “ . 18.
Now start writing program in either in “C” or “ASM” For a program written in Assembly.cc | www.troubleshoot4free.www.com/fyp/
on which by default “C” files will appear.com/fyp/
Now you will get another window.final-yearprojects.
Now right click on Source group 1 and click on “Add files to Group Source”
20.www.cc | www.co.
Any error will appear if so happen.co. 23. then press Control+F5 simultaneously. The new window is as follows
.www.cc | www.
Now select as per your file extension given while saving the file Click only one time on option “ADD” Now Press function key F7 to compile. 25.
If the file contains no error.
troubleshoot4free. 27.cc | www.
Now keep Pressing function key “F11” slowly and observe.final-yearprojects.
Then Click “OK” Now Click on the Peripherals from menu bar. and check your required port as shown in fig below
28.www. 30. You are running your program successfully
Drag the port a side and click in the program file.com/fyp/
using highly advanced IC’s and with the help of growing technology the project has been successfully implemented.co. Integrating features of all the hardware components used have developed it.www.com/fyp/
The project “PC BASED TRANSFORMER MONITOR AND PROTECTION” has been successfully designed and tested. Secondly.cc | www. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit.troubleshoot4free.
cc | www.final-yearprojects.troubleshoot4free. Whereas in the place of RF module if we use the latest technology called “Zig-bee” that covers the maximum range than RF. If there is any extension of the bus station the Zig-bee will able to transmit the address to the receiver station.
. The RF module covers the minimum range. we can use the RF technology for transmitting the signals from transformer to the PC at the substation.com/fyp/
In this project.co.www.
Ramesh S. Programming & Applications .co.com
. Ayala Fundamentals Of Micro processors and Micro computers -B.com www.com www. Prasad
References on the Web:
www.troubleshoot4free.geocities.cc | www.atmel. Ram Micro processor Architecture. Gaonkar Electronic Components -D.V.com/fyp/
BIBLIOGRAPHY The 8051 Micro controller and Embedded Systems -Muhammad Ali Mazidi Janice Gillispie Mazidi The 8051 Micro controller Architecture.com www.final-yearprojects.microsoftsearch. Programming & Applications -Kenneth J.www.national.