Professional Documents
Culture Documents
Page no.
LIST OF FIGURES:.........................................................................................................ii
LIST OF TABLES:..........................................................................................................iii
CHAPTER 1.......................................................................................................................1
INTRODUCTION.............................................................................................................1
1.1 INTRODUCTION.......................................................................................1
1.8. CONCLUSION..........................................................................................5
INDUCTION MOTOR.....................................................................................................5
2.1. INTRODUCTION......................................................................................5
2.5. APPLICATIONS......................................................................................10
2.6. CONCLUSION........................................................................................10
MICRO CONTROLLER................................................................................................10
3.1. INTRODUCTION....................................................................................10
3.13. CONCLUSION......................................................................................22
4.1 INTRODUCTION.....................................................................................23
4.2 REGULATOR..........................................................................................23
4.3.1 FEATURES.........................................................................................24
4.9. PROGRAM............................................................................................35
5.2 CONCLUSION.........................................................................................62
5.3 APPLICATION.........................................................................................63
The circuit was fully controlled by the microcontroller and the microcontrollers
will continuously monitors the voltages of the three phases and if the voltage goes
abnormal then it will switch off the motor until they are normal. All the conditions are
displayed by it over the LCD display. In our project we are using the popular 8 bit
microcontroller AT89C52. It is a 40 pin microcontroller.
i
LIST OF FIGURES:
ii
LIST OF TABLES:
iii
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
The manner in which the use of microcontrollers is shaping our lives in breath
taking. Today this versatile device can be found in a variety of control applications. TVs,
VCRs, CD players, microwave ovens, automotive engines are some of these.
In our project the microcontroller is used to control the three phase induction
motor.
The motor protection is required as day to day life induction motor usage
increases a lot as it has some specific merits. The circuit was fully controlled by the
microcontroller and the micro controllers will continuously monitors the voltages of the
three phase and if the voltages goes abnormal then it will switch off the motor until they
are normal.
Its not only protect motor from transient voltages, it also switch on the motor
automatically when power comes without manual requirement and off the motor after
predetermined time. This motor is manually monitoring is difficult so automatic
protection of induction motor has such an importance.
1.2. AIM
This Project aims protection of three phase Induction motors and to start and stop
the motor automatically. The circuit will take full control of the motor and it will protect
the motor from several faults such as over voltage and under voltage and the circuit will
switch on the motor under safety conditions. This also protects Induction motor from
single phasing which is also a major fault.
1
1.3. METHODOLOGY
In this project we are using dual comparator to compare over/under voltages with
the present voltage and send signal to microcontroller if the voltage goes beyond the
range. Here we are using LM393 dual comparator.
Addition to this we are using two switches one for auto on and another one for
auto off. Here the motor will run automatically when auto on is set and it will start the
motor automatically after a particular time if off is set.
According to the program written into the microcontroller the circuit will
automatically on/off the motor. The prime use of the microcontroller is to protect the
motor from over and under voltage and to start/stop the motor automatically.
Microcontroller send signal to the relay which is connected to starter of motor. According
to the signal from the controller the relay will start/stop the motor.
The circuit was fully controlled by the microcontroller and the microcontrollers
will continuously monitors the voltages of the three phase and if the voltage goes
abnormal then it will switch off the motor until they are normal. All the conditions are
displayed it over the LCD display.
3
Auto ON and Auto OFF switches are push to on switches, which will be ON only
until they are held at pressed state once they are released the switch gets opened. The
function of auto switch is that when it is pressed and released the motor is turned off after
providing a delay which is dictated by the positioning of the rotary switch. The physical
functioning of the auto on switch is that once the auto on switch is set and if the supply is
provided and also voltages are in normal condition then the motor start automatically.
(Reference 2: www.google.com)
(Reference 3: www.alldatasheets.com)
Chapter -3 Deals with micro controller which includes the pin description and instruction
set to develop the program for automatic voltages control of induction motor. Here We
are using the microcontroller AT89S52 for automatic voltages control of Induction
motor.
(Reference 1: www.electronicsforyou.com )
(Reference 2: www.google.com)
(Reference 3: www.alldatasheets.com)
(Reference 4: www.atmel.com )
(Reference 5: www.8052.com )
Chapter- 4 Deals with dual comparator, Regulator and LCD includes the circuit operation
of automatic voltages control of Induction motor using Microcontroller.
(Reference 1: www.microcontroller.net )
(Reference 2: www.google.com)
4
(Reference 3: www.electronicsforyou.com)
(Reference 4: www.alldatasheets.com)
(Reference 5: www.philipssemiconductors.com)
1.8. CONCLUSION
This project can be used with the three phase Induction motor. The circuit will
take full control of the motor and it will protect the motor from several faults such as over
voltage and under voltages and the circuit will switch on the motor under safety
conditions.
CHAPTER 2
INDUCTION MOTOR
2.1. INTRODUCTION
Induction Motor is one kind of AC motor where power is supplied to the rotating
device by induction. An electric motor converts electrical power to mechanical power in
its rotor (rotating part). There are several ways to supply power to the rotating part of the
motor. In a DC motor this power is supplied to the armature directly from a DC source.
But in an A.C. Motor this power is induced in the rotating device. An induction motor
can be called a rotating transformer because the stationary (stationary part) is essentially
the primary side of the transformer and the rotor (rotating part) is the secondary side.
Induction motors are widely used, especially polyphase induction motors, which are
frequently used in industrial drives.
5
Induction motors are now the preferred choice for industrial motors due to their
rugged construction, lack of brushes like in DC motors and they have ability to control
the speed due to rapid developments in power electronics.
Of the two the squirrel cage induction motor is most widely used because of its
simple construction, high reliability and low maintenance cost. The rotor bars in squirrel
cage induction motors are not straight but have some skew to reduce noise and harmonics
Due to the flexibility in the slip ring induction motor to vary the rotor resistance it is used
in the applications involving high starting torque and speed control .But it has high initial
cost, high maintenance cost.
By way of contrast, the induction motor does not have any direct supply onto the
rotor; instead, a secondary current is induced in the rotor. To achieve this, stator windings
are arranged around the rotor so that when energized with a polyphase supply they create
a rotating magnetic field pattern which sweeps past the rotor. This changing magnetic
field pattern induces current in the rotor conductors. This current interacts with the
6
rotating magnetic field created by the stator and in effect causes a rotational motion on
the rotor.
However, for these currents to be induced, the speed of the physical rotor must be
less than the speed of the rotating magnetic field in the stator, or else the magnetic field
will not be moving relative to the rotor conductors and no currents will be induced. If by
some chance this happens, the rotor typically slows slightly until a current is re-induced
and then the rotor continues as before. This difference between the speed of the rotor and
speed of the rotating magnetic field in the stator is called slip. It is unit less and is the
ratio between the relative speed of the magnetic field as seen by the rotor (the slip speed)
to the speed of the rotating stator field. Due to this an induction motor is sometimes
referred to as an asynchronous machine.
In a three phase induction motor, the induced emf in rotor circuit depends on the
slip of the induction motor and the magnitude of the rotor current depends upon this
induced emf. When the motor is started, the slip is equal to 1 as the rotor speed is zero, so
the induced emf in rotor is large. As a result, a very high current flows through the rotor.
This is similar to a transformer with the secondary coil short circuited, which causes the
primary coil to draw a high current is drawn by the stator, on the order of 5 to 9 times the
full load current. This high current can damage the motor windings and because it causes
heavy line voltage drop, other appliances connected to the same line may be affected by
the voltage fluctuation. To avoid such effects, the starting current should be limited. A
starter is a device which limits the starting current by providing reduced voltage to the
motor. Once the rotor speed increases, the full rated voltage is given to it.
Autotransformer starter
7
Stator Resistance starter
1. Voltage imbalances.
2. Single phasing.
Example: With voltages of 220, 215, and 210, the average is 215, the maximum deviation
from the average is and the percent unbalance is 5 x 100, or 2.3 per cent 215. A relatively
small unbalance in voltage will cause considerable increase in temperature rise in the
phase with the highest current; the percentage increase in temperature rise will be
approximately two times the square of the percentage voltage unbalance. The increase
losses and, consequently, the increase in average heating of the whole winding will be
slightly lower than the winding with the highest current. To illustrate the severity of this
condition, an approximate 3.5 percent voltage unbalance will cause an approximate 25
per cent increase in temperature rise. The locked rotor current will be unbalanced to the
same degree that the voltages are unbalanced but the locked rotor KVA will increase only
slightly. "The currents at normal operating speed with the unbalanced voltages will be
greatly unbalanced in the order of approximately 6 to 10 times the voltage unbalance.
This introduces a complex problem in selecting the proper overload protective devices,
particularly since devices selected for one set of unbalanced conditions may be
8
inadequate for a different set of unbalanced voltages, increasing the size of the overload
device is not the solution in as much as protection against heating from overload and
single phase operation is lost.”
If it is determined that the problem is one of voltage unbalance, the next step is to find
out what caused unbalanced condition. These are some of the causes:
Capacitor banks with fuse blown or with unequal capacity per phase;
In fact, the large-scale negative sequence currents in induction motor result from
slight unbalanced voltage, causing overheating, shaft vibration, noise, derating and
additional losses, and hence reduce its lifetime and performance.
9
It is well known that a three-phase induction motor will continue to operate when
a disturbance of some sort causes the voltages supplied to the motor to become single-
phase. The single-phasing can occur as a result of a fuse blowing or protective device
opening on one phase of the motor. Other possibilities include feeder or step-down
transformer fuses blowing. Even though the motor will continue to operate in this
condition, the motor will heat up very quickly and it is essential that the motor be
removed from service by the opening of a motor circuit breaker or some other type of
protective device. This paper will describe three different ways in which an induction
motor will operate in a single-phase condition. For purposes of this paper "single-phase"
will include any condition in which the three line-to-line voltage phasors appear on the
same line.
2.5. APPLICATIONS
The induction motor has wide applicability as a motor in industry and its single
phase form in several domestic applications. A wide range of speed control is possible
only by circuitry using silicon controlled rectifiers.
2.6. CONCLUSION
The induction motor is an important class of electrical machine. Day to day it has
more than 85% of industrial usage because of its simple construction and reliable. By
having these advantages in agricultural and industrial fields we are protecting Induction
Motor from over/under voltages and single phasing.
CHAPTER 3
MICRO CONTROLLER
3.1. INTRODUCTION
The AT89S52 is a low-power, high-performance CMOS 8-bit microcomputer
with 8 Kbytes of Flash Programmable and Read Only Memory (PEROM). The device is
manufactured using Atmel’s high-density nonvolatile memory technology and is
compatible with the industry standard 80C51 instruction set and pinout. The on-chip
10
Flash allows the program memory to be reprogrammed in-system or by a conventional
nonvolatile memory programmer.
By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel
AT89S52 is a powerful microcontroller which provides a highly-flexible and cost
effective solution to many embedded control applications.
The AT89S52 provides the following standard features: 8K bytes of Flash, 256
bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit
timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-
chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic
for operation down to zero frequency and supports two software selectable power saving
modes.
The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial
port, and interrupt system to continue functioning. The Power-down mode saves the
RAM con-tents but freezes the oscillator, disabling all other chip functions until the next
interrupt or hardware reset.
11
Interrupt Recovery from Power-down Mode
The ALU (Acc) performs arithmetic and logic functions on 8 bit input variables.
Arithmetic operations include basic addition, subtraction, multiplication and division.
Logical operations are AND, OR, Exclusive OR as well as rotate, clear, complement and
etc. Apart from all the above, LAU is responsible in conditional branching decisions, and
provides a temporary place in data transfer operations within the device.
Program status word keeps the current status of the ALU in different bits.
These timers can be used to measure time intervals, determine pulse widths or
initiate events with one microsecond resolution up to a maximum of 65 millisecond
12
(corresponding to 65, 536 counts). Use software to get longer delays. Working counter,
they can accumulate occurrences of external events (from DC to 500 KHz) with 16 bit
precision.
On chip data memory is smaller and therefore quicker than Program Memory and
it goes into a random state when power is removed. On chip RAM is used for variables
which are calculated when the program is executed.
In contrast to the Program Memory, On chip Data Memory accesses need a single
8 bit value (may be a constant or another variable) to specify a unique location. Since 8
13
bits are more than sufficient to address 128 RAM locations, the On chip RAM address
generating register is single byte wide.
The Data Memory address space consists if an internal and an external memory
space. External Data Memory is accessed when a MOVX instruction is executed.
Apart from On-chip Data Memory of size 128/256 bytes, total size of Data
Memory can be expanded up to 64K using external RAM devices.
Even through the upper RAM area and SFR area share address locations, they are
accessed through different addressing modes. Direct addresses higher than 7FH access
SFR memory space and indirect addressing above 7FH access higher 128 bytes (in
8032/8052).
3.6. INTERRUPTS
14
The 8052 has five interrupt sources: one from the serial port when a transmission
or reception operation is executed; two from the timers when overflow occurs and two
come from the two input pins INT0, INT1. Each interrupt may be independently enabled
or disabled to allow polling on same sources and each may be classified as high or low
priority.
A high priority source can override a low priority service routine. These options
are selected by interrupt enable and priority control registers, IE and IP.
When an interrupt is activated, then the program flow completes the execution of
the current instruction and jumps to a particular program location where it finds the
interrupt service routine. After finishing the interrupt service routine, the program flows
return to back to original place.
The Program Memory Address, 0003H is allocated to the first interrupt and next
seven bytes can be used to do any task associated with that interrupt.
15
Register Addressing
Direct Addressing
Immediate Addressing
Index Addressing
16
Fig 3.1 Architecture of Microcontroller AT89S52
17
Fig 3.2 pin diagram of AT89S52
18
9 RST Reset Input
10 RXD Receive Data
11 TXD Transmit Data
12 INT0 Interrupt 0
13 INT 1 Interrupt 1
14 T0 Timer 0 input
15 T1 Timer 1 input
16 WR Write Strobe
17 RD Read Strobe
18 XTAL 2 Crystal Input 2
19 XTAL 1 Crystal Input 1
20 Vss Ground
21 A8 Address 8
22 A9 Address 9
23 A10 Address 10
24 A11 Address 11
25 A12 Address 12
26 A13 Address 13
27 A14 Address 14
28 A15 Address 15
29 PSEN Program Store Enable
30 (PROG)ALE Address Latch Enable (EPROM Program Plus)
31 (Vpp)/EA External enable(EPROM Program voltage)
32 AD7 Address/Data 7
33 AD6 Address/Data 6
34 AD5 Address/Data 5
35 AD4 Address/Data 4
36 AD3 Address/Data 3
37 AD2 Address/Data 2
38 AD1 Address/Data 1
39 AD0 Address/Data 0
40 Vcc +5v
19
3.10. PORTS
Port 0
Port 0 is an 8-bit open drain bidirectional 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 can 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.
Port 1
Port 1 is an 8-bit bidirectional 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.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count
input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown
in the following table. Port 1 also receives the low-order address bytes during Flash
programming and verification.
Port 2
Port 2 is an 8-bit bidirectional 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, Port 2 uses strong internal pull-ups when emitting 1s.
During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2
20
emits the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification.
Port 3
Port 3 is an 8-bit bidirectional 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
receives some control signals for Flash programming and verification. Port 3 also serves
the functions of various special features of the AT89S52, as shown in the following table.
Port 3 also receives some control registers for Flash Programming and
Programming verification.
21
3.11. INSTRUCTION SET OF MCS52
1. ARITHEMATIC OPERATIONS
2. LOGICAL OPERATIONS
3. DATA TRANSFER
3.13. CONCLUSION
The AT89S52 is a low-power, high-performance CMOS 8-bit microcomputer
with 8 Kbytes of Flash Programmable and Read Only Memory (PEROM). It is easy to
develop the program for the protection of motor from over and under voltages. The
output of the microcontroller is applied to the relays to switch ON and OFF the motor.
22
CHAPTER 4
4.1 INTRODUCTION
The motor voltage control using the microcontroller mainly includes fault
detection circuit to detect abnormal voltage conditions and the circuit was fully controlled
by the microcontroller and the microcontroller will continuously monitors the voltages of
the three phases and if the voltages goes abnormal then it will switch off the motor until
they are normal.
4.2 REGULATOR
The LM7805 monolithic 3-terminal voltage regulator employs internal current-
limiting, thermal shutdown and safe-area compensation, making them essentially
indestructible. If adequate heat sinking is provided, they can deliver over 1.0A output
current.
23
They are intended as fixed voltage regulators in wide range of applications
including local (on-card) regulation for elimination of noise and distribution of noise and
distribution problems associated with single-point regulation for elimination. In addition
to use as fixed voltage regulators, these devices can be used with external components to
obtain adjustable output voltages and currents. Considerable was expended to make the
entire series of regulators easy to use and minimize the number of external components.
It is not necessary to bypass the output, although this does improve transient response.
Input bypassing is needed only if the regulator is located far from the filter capacitor of
the power supply.
4.3.1 FEATURES
Wide supply
Very low supply current drain (0.4mA) --- independent of supply voltage
24
Low input biasing current: 25nA
25
4.4 LIQUID CRYSTAL DISPLAY
The most commonly used Character based LCDs are based on Hitachi's HD44780
controller or other which are compatible with HD44580. In this tutorial, we will discuss
about character based LCDs, their interfacing with various microcontrollers, various
interfaces (8-bit/4-bit), programming, special stuff and tricks you can do with these
simple looking LCDs which can give a new look to your application.
The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4
Line LCDs which have only 1 controller and support at most of 80 characters, whereas
LCDs supporting more than 80 characters make use of 2 HD44780 controllers.
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins
(two pins are extra in both for back-light LED connections).
To send data we simply need to select the data register. Everything is same as the
command routine. Following are the steps:
26
Send enable signal
Wait for LCD to process the data
Keeping these steps in mind we can write LCD command routine as.
The equivalent C code Keil C compiler. Similar code can be written for SDCC.
1. Finalizing the total circuit diagram, listing out the components and their sources
of procurement.
27
3. Making layout, preparing the interconnection diagram as per the circuit diagram,
preparing the drilling details, cutting the laminate to the required size
4. Drilling the holes on the board as per the components layout, painting the tracks
on the board as per the inter connection diagram.
5. Removing the un-wanted copper other than track portion. Then cleaning the board
with water, and solder coating the copper tracks to protect the tracks from rusting
or oxidation due to moisture.
6. Assembling the components as per the components layout of the circuit diagram
and soldering components
7. Integrating the total unit inter wiring the unit and final testing the unit. Keeping it
ready for demonstration.
The next stage in the PCB fabrication is artwork preparation. The artwork (master
drawing) is essentially a manufacturing tool used in the fabrication of PCB’s. It defines
the pattern to be generated on the board. Since the artwork is the first of many process
steps in the fabrication of PCB’s. Normally, in industrial applications the artwork is
drawn on an enlarged scale and photographically reduced to required size. It is not only
easy to draw the enlarged dimensions but also the errors in the artwork correspondingly
get reduced during photo reduction. For ordinary application of simple single sided
boards artwork is made on ivory art paper using drafting aids. After taping on a art paper
28
and photography the image of the photo given is transformed on silk screen printing.
After drying the paint, the etching process is carried out. This is done after drilling of the
holes on the laminate as per the components layout. The etching is the process of
chemically removing unwanted copper from the board.
The next stage after PCB fabrication is solder making the board to prevent tracks
from corrosion and rust formation. Then the components will be assembled on the board
as per the components layout.
The next stage after assembling is the soldering the components. The soldering
may be defined as process where in joining between metal parts is produced by heating to
suitable temperatures using non ferrous filler metals has melting temperatures below the
melting temperatures of the metals to be joined. This non-ferrous intermediate metal is
called solder. The solders are the alloys of lead and tin.
The basic functioning of the fault detection circuit can be explained as follows.
The center tapped step down transformer is supplied on the primary side from one of
29
three phases of the supply and its output voltage is rectified by a full wave rectifier. The
output from the rectifier is fed to the two operational amplifiers through a capacitor.
During the normal working conditions without any faults the zener diode connected to
the inverting and non-inverting terminals of the operational amplifiers IC2a and IC2b
respectively will be charged to a voltage of 4.2v and the output voltage of the two
opamps will be zero. This voltage across zener diode which remains constant is supplied
to the two opamps as a reference voltage. Of the two opamps one will be operating in
inverting mode (IC2a) and the other in non-inverting mode (IC2b). When the condition of
over voltage occurs, the voltage at the non inverting terminal of the opamp, IC2b will be
more than 4.2 volts as a result of this the output voltage of this opamp will be high and
this error signal will be fed to the micro controller which trips the relay and thus
disconnects the motor from the supply. Similarly the opamp (IC2a) sends an error signal
during under voltage condition.
Similar circuits are used for other two phases. The total fault detection circuit
shown below.
30
Fig 4.6. Three phase fault detection circuit
31
4.7. MAIN CIRCUIT DIAGRAM
32
4.7.1. CIRCUIT EXPLANATION
The Circuit diagram consists of three voltage sensor circuits and a relay driver
circuit, power supply circuit and the Microcontroller circuit.
The Main part of the above circuit diagrams is the Microcontroller AT89S52. The
Microcontroller will switch on the motor only the following conditions are satisfied.
The Three phase voltages are checked by dual opamp IC LM393. It checks the
input voltage with the reference voltage. The off time was set by the rotary switch for ½
hr to 2hr.
For driver the relay we are using NPN transistor is used as an current amplifier.
The Microcontroller will control the whole circuit according to program burned on its
ROM. All the conditions are displayed over the LCD display.
The power supply section is the important one. It should deliver constant output
regulated power supply for successful working of the project. An 0-12V/500mA
transformer is used for our purpose the primary of this transformer is connected into main
supply through on/off switch and fuse for protecting from overload and short circuit
protection. The secondary is connected to the diodes convert from 12V AC to 12V DC
voltage. Which is further regulated to +5v, by using IC 7805.
33
4.8. FLOW CHART
START
CHECK
ABNORMAL SWITCH ON
PHASE
MOTOR OFF
VOLTAGE
RELAY
S
NORM
AL
CHECK PRESSE
AUTO
ON
CHECK
NOT
PHASE
VOLTAGE
ABNORMA
S
NORMAL
SWITCH ON
MOTOR ON
RELAY
NOT
CALL
APPROXIMATE
DELAY
34
4.9. PROGRAM
The actual used for programming the micro controller is presented below.
INCLUDE REG_52.PDF
; ***LCD CONTROL***
35
LCD_DB4 EQU P0.3 ; PORT 1 IS USED FOR DATA
; ***SYSTEM INSTRUCTIONS***
; ---------==========----------==========---------=========---------
36
FLAGS: DS 1
NEW: DS 1
OFF_TIME: DS 1
;---------==========----------==========---------=========---------
;---------==========----------==========---------=========---------
JMP MAIN
37
ORG 001BH ; Timer Interrupt1
JMP SCROLL
; ---------==========----------==========---------=========---------
; ---------==========----------==========---------=========---------
MAIN:
MOV SP,#60H
MOV FLAGS,#00H
MOV NEW,#00H
MOV OFF_TIME,#00H
CLR OFFRLY
SETB LED1
SETB LED2
SETB LED3
CALL RESETLCD4
CALL INITLCD4
CALL TITLES
SETB NEW2
MOV TL1,#08H
MOV TH1,#01H
SETB ET1
MOV SCRL,#00H
38
MOV TIM,#120
SETB TR1
SETB EA
SETB PH2
SETB PH3
SETB AUTOON
SETB AUTOOFF
; Chk if motor is on
CALL DISP
JNB MOT, UP
JB PH2, MOTOR_OFF
JB PH3, MOTOR_OFF
AJMP UP
CALL DELAY1
JNB AUTOON,$
SETB LED1
39
AJMP UP
HJ1: JB MOT, UP
; AUTO ON
JNB AUTOON,$
CALL DELAY1
JNB AUTOON,$
CLR LED1
SETB NEW4
CALL DISP
JNB PH1,UP3
JB PH2,UP3
JB PH3,UP3
SETB OFFRLY
CLR LED3
CLR LD1
SETB MOTT
AJMP UP
JNB AUTOOFF,$
CALL DELAY1
40
JNB AUTOOFF,$
SETB NEW5
CLR LED2
CALL DELAY
AJMP SET_TIMER
UP1: AJMP UP
MOTOR_OFF:
SETB LED1
SETB LED2
SETB LED3
CLR MOT
CLR TR0
CLR TF0
CLR OFFRLY
SETB LD1
CLR NEW5
CLR NEW4
CLR MOTT
AJMP UP
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET_TIMER:
SETB TIM1
41
SETB TIM2
SETB TIM3
SETB TIM4
SETB PH1
SETB PH2
SETB PH3
SETB AUTOOFF
JB TIM1,VB1
MOV OFF_TIME,#01H
CALL HALF_HR_DELAY
AJMP MOTOR_OFF
VB1: JB TIM2,VB2
MOV OFF_TIME,#02H
CALL HALF_HR_DELAY
CALL HALF_HR_DELAY
AJMP MOTOR_OFF
VB2: JB TIM3,VB3
MOV OFF_TIME,#03H
CALL HALF_HR_DELAY
CALL HALF_HR_DELAY
CALL HALF_HR_DELAY
AJMP MOTOR_OFF
MOV OFF_TIME,#04H
42
CALL HALF_HR_DELAY
CALL HALF_HR_DELAY
CALL HALF_HR_DELAY
CALL HALF_HR_DELAY
AJMP MOTOR_OFF
VB4: AJMP UP
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HALF_HR_DELAY:
MOV R5, #30 ; count for 1/2 hour (30 for 1/2 Hour)
MOV R7,#20
SETB TR0
JB PH2, MOTOR_OFF1
JB PH3, MOTOR_OFF1
CLR TR0
43
CLR TF0
DJNZ R6, TP
RET
UPP: AJMP UP
MOTOR_OFF1:
SETB LED3
SETB MOT
CLR OFFRLY
CLR TF0
CLR MOTT
RET
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DELAY:
RE: NOP
DJNZ R2, RE
RET
44
;**********************************************************
DELAY1:
REA: NOP
RET
;**********************************************************
;##########################################################
; DISPLAY ROUTINES
;##########################################################
TITLES:
MOV DPTR,#MSAG
CALL LCD_MSG
RET
MSAG:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TITLE1:
MOV DPTR,#MSAG1
CALL LCD_MSG
RET
MSAG1:
45
DB 1H, 81H,'## R Phase: ##', 0C1H,'Voltage Normal', 00H
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TITLE2:
CALL LCD_MSG
RET
MSAG2:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TITLE3:
CALL LCD_MSG
RET
MSAG3:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TITLE11:
MOV DPTR,#MSAG4
CALL LCD_MSG
RET
MSAG4:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TITLE21:
MOV DPTR,#MSAG5
CALL LCD_MSG
46
RET
MSAG5:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TITLE31:
CALL LCD_MSG
RET
MSAG6:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MOT_OFF:
MOV DPTR,#MSAG7
CALL LCD_MSG
RET
MSAG7:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MOT_ON:
MOV DPTR,#MSAG8
CALL LCD_MSG
RET
MSAG8:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AUTO_OFF_ON:
47
MOV DPTR,#MSAG9
CALL LCD_MSG
RET
MSAG9:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AUTO_OFF_OFF:
MOV DPTR,#MSAG10
CALL LCD_MSG
RET
MSAG10:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AUTO_ON_ON:
MOV DPTR,#MSAG11
CALL LCD_MSG
RET
MSAG11:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AUTO_ON_OFF:
MOV DPTR,#MSAG12
CALL LCD_MSG
RET
MSAG12:
48
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TIMER1:
MOV DPTR,#MSAG13
CALL LCD_MSG
RET
MSAG13:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TIMER2:
MOV DPTR,#MSAG14
CALL LCD_MSG
RET
MSAG14:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TIMER3:
MOV DPTR,#MSAG15
CALL LCD_MSG
RET
MSAG15:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TIMER4:
MOV DPTR,#MSAG16
CALL LCD_MSG
RET
49
MSAG16:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TIMER5:
MOV DPTR,#MSAG17
CALL LCD_MSG
RET
MSAG17:
DB 0C2H,’Time: ‘00H
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;**********************************************************
;**********************************************************
INITLCD4:
; LINES, FONTS
CALL WRLCDCOM4
CALL WRLCDCOM4
CALL WRLCDCOM4
RET
50
; **********************************************************
; **********************************************************
RESETLCD4:
SETB LCD_DB5
SETB LCD_DB4
CALL MDELAY
CALL MDELAY
CALL MDELAY
51
MOV A, #1 ; DELAY 1 MILLISECOND
CALL MDELAY
CALL WRLCDCOM4
CALL WRLCDCOM4
CALL WRLCDCOM4
ACALL WRLCDCOM4
JMP INITLCD4
; **********************************************************
; **********************************************************
WRLCDCOM4:
CLR LCD_E
MOV LCD_DB5, C
MOV C, ACC.6
52
MOV LCD_DB6, C
MOV C, ACC.7
MOV LCD_DB7, C
CLR LCD_E
MOV LCD_DB4, C
MOV C, ACC.1
MOV LCD_DB5, C
MOV C, ACC.2
MOV LCD_DB6, C
MOV C, ACC.3
MOV LCD_DB7, C
CLR LCD_E
CLR LCD_E
CALL MADELAY
POP ACC
RET
; **********************************************************
; **********************************************************
WRLCDDATA:
CLR LCD_E
53
PUSH ACC ; SAVE ACCUMULATOR
MOV LCD_DB5, C
MOV C, ACC.6
MOV LCD_DB6, C
MOV C, ACC.7
MOV LCD_DB7, C
CLR LCD_E
MOV LCD_DB4, C
MOV C, ACC.1
MOV LCD_DB5, C
MOV C, ACC.2
MOV LCD_DB6, C
MOV C, ACC.3
MOV LCD_DB7, C
CLR LCD_E
CLR LCD_E
NOP
NOP
POP ACC
54
RET
; **********************************************************
; NULL (0).
; **********************************************************
LCD_MSG:
MOV R4, A
MOV R4, A
CALL WRLCDDATA
JMP LCD_MSG
MOV R4, A
55
Lcd_Msg_Data:
MOV R4, A
Lcd_Msg9:
; **********************************************************
; **********************************************************
MDELAY:
PUSH ACC
MOV A,#0A6H
MD_OLP:
INC A
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
JNZ MD_OLP
NOP
56
POP ACC
RET
MADELAY:
PUSH ACC
MOV A,#036H
MAD_OLP:
INC A
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
JNZ MAD_OLP
NOP
POP ACC
RET
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SCROLL:
CLR TR1
INC SCRL
CJNE A,#01H,DFV1
57
JB NEW1, DFF1 ; CHK R VOL
CALL TITLE1
AJMP GAG
AJMP GAG
CALL TITLE2
AJMP GAG
AJMP GAG
CALL TITLE3
AJMP GAG
AJMP GAG
JB MOTT,DFF4
CALL MOT_OFF
AJMP GAG
AJMP GAG
58
DFV4: CJNE A, #05H, DFV5 ; AUTO ON
CALL AUTO_ON_ON
AJMP GAG
AJMP GAG
CALL AUTO_OFF_ON
AJMP GAG
AJMP GAG
SETB TR1
RETI
59
SETB PH2
SETB PH3
CLR NEW1
AJMP DEE1
CLR NEW2
AJMP DEE2
CLR NEW3
RET
RET
END
4.10. CONCLUSION
Fault detection circuit is used for detection of the over and under voltages. From
the fault detection circuit output is given to microcontroller, by the program stored in the
microcontroller it activates the ON relay or OFF relay. The output of the microcontroller
is applied to the relays to switch ON and OFF the motor.
60
61
CHAPTER 5
5.2 CONCLUSION
In this project we are using LM 393 dual comparator to compare over/under
voltage.
Addition to this we are using two switches one for auto on and another for auto
off. Here the motor will run automatically when auto on is set and it will stop the motor
automatically after a particular time if auto off is set.
We have successfully completed the code required for the protection of the three
phase induction motor from the faults of unbalanced supply voltages and signal phasing.
The circuit is fabricated, the code is copied in to the microcontroller and we got
the desired results.
62
5.3 APPLICATION
This project can be used in any type of three phase motors, and the motor with any rating
can be easily adopted by just connecting the relay connections to the starter of the motor.
Agricultural motors
Industrial motors
Higher application.
63
BIBLIOGRAPHY:
1. P.S Bimbhra, Electric Machinery, Khanna Publishers, Edition Seventh 2004
August
3. www.8051projects.info
4. www.lmphotonics.com
5. www.taylorandfrancis.com
6. www.metapress.com_protection techniques
7. www.ia.omron.com_relays
64
Appendix 1
LM7805 Regulator
LM78LXX SERIES
3-TERMINAL POSITIVE REGULATORS
GENERAL DESCRIPTION
The LM78LXX series of three terminal positive regulators is available with several fixed
output voltages making them useful in a wide range of applications. When used as a
zener diode/resistor combination replacement, the LM78LXX usually results in an
effective output impedance improvement of two orders of magnitude, and lower
quiescent current. These regulators can provide local on card regulation, eliminating the
distribution problems associated with single point regulation. The voltages available
allow the LM78LXX to be used in logic systems, instrumentation, HiFi, and other solid
state electronic equipment.
The LM78LXX is available in the plastic TO-92 (Z) package, the plastic SO-8 (M)
package and a chip sized package (8-Bump micro SMD) using National’s micro SMD
package technology. With adequate heat sinking the regulator can deliver 100mA output
current. Current limiting is included to limit the peak output current to a safe value. Safe
area protection for the output transistors is provided to limit internal power dissipation. If
internal power dissipation becomes too high for the heat sinking provided, the thermal
shutdown circuit takes over preventing the IC from overheating.
Features
• LM78L05 in micro SMD package
• Output voltage tolerances of ±5% over the temperature range
• Output current of 100mA
• Internal thermal overload protection n Output transistor
safe area protection n Internal short circuit current limit
• Available in plastic TO-92 and plastic SO-8 low profile packages
• No external components
• Output voltages of 5.0V, 6.2V, 8.2V, 9.0V, 12V, 15V n See AN-1112
for micro SMD considerations
65
CONNECTION DIAGRAMS
Bottom
View
Top View
00774424
Top View
(Bump Side Down)
00774433
Top View
66
Typical Performance Characteristics
Maximum Average Power Dissipation (Z Package) Peak Output Current
00774414
00774416
00774417
00774418
67
TYPICAL APPLICATIONS
Fixed Output Regulator
00774408
*Required if the regulator is located more than 3" from the power supply filter.
**See (Note 4) in the electrical characteristics table.
00774409
Current Regulator
00774410
IOUT = (VOUT/R1) + IQ
>IQ = 1.5mA over line and load changes
68
00774411
*Solid tantalum. **Heat sink Q1. ***Optional: Improves ripple rejection and transient response. Load Regulation: 0.6% 0 ≤ IL ≤ 250mA pulsed with
tON = 50ms
Solid tatalum
VOUT = VG + 5V, R1 = (−VIN/IQ LM78L05)
69
Appendix 2
THEORY OF MICROCONTROLLER
FEATURES
Compatible with MCS®-51 Products
8K Bytes of In-System Programmable (ISP) Flash
Memory –Endurance: 10,000 Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight 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)
Green (Pb/Halide-free) Packaging Option
1. DESCRIPTION
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K
bytes of in-system programmable Flash memory. The device is manufactured using
Atmel’s high-density nonvolatile memory technology and is compatible with the indus-
try-standard 80C51 instruction set and pinout. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-
grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a
monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a
highly-flexible and cost-effective solution to many embedded control applications.
The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of
RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-
vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and
clock circuitry. In addition, the AT89S52 is designed with static logic for operation down
to zero frequency and supports two software selectable power saving modes. The Idle
70
Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt
system to continue functioning. The Power-down mode saves the RAM con-tents but
freezes the oscillator, disabling all other chip functions until the next interrupt or
hardware reset.
AUXR: Auxiliary
Register
- DISA
– - – WDIDLE DISRTO – – LE
Bit 7 6 5 4 3 2 1 0
Reserved for
– future expansion
DISAL Disable/Enable
E ALE
DISAL Operatin
E g Mode
0 ALE is emitted at a constant rate of 1/6 the oscillator frequency
1 ALE is active only during a MOVX or MOVC instruction
DISRTO Disable/Enable Reset out
DISRTO
0 Reset pin is driven High after WDT times out
1 Reset pin is input only
WDIDLE Disable/Enable WDT in IDLE mode
WDIDLE
0 WDT continues to count in IDLE mode
1 WDT halts counting in IDLE mode
Dual Data Pointer Registers: To facilitate accessing both internal and external data
memory, two banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address
locations 82H-83H and DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and
DPS = 1 selects DP1. The user should ALWAYS initialize the DPS bit to the appropriate
value before accessing the respective Data Pointer Register.
71
Power off Flag: The Power Off Flag (POF) is located at bit 4 (PCON.4) in the PCON
SFR. POF is set to “1” during power up. It can be set and rest under software control and
is not affected by reset
AUXR1: Auxiliary
Register 1
-- -- -- -- -- -- -- DPS
B
i
t 7 6 5 4 3 2 1 0
72
T2MOD – Timer 2 Mode Control Register
T2MOD Address =
0C9H Reset Value = XXXX XX00B
Not Bit
Addressable
– – – – – – T2OE DCEN
Bit 7 6 5 4 3 2 1 0
Symbol
Function
–
Not implemented, reserved for future
DCEN When set, this bit allows Timer 2 to be configured as an up/down counter
Figure 1 shows Timer 2 automatically counting up when DCEN = 0. In this mode, two
options are selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 counts up to
0FFFFH and then sets the TF2 bit upon overflow. The overflow also causes the timer
registers to be reloaded with the 16-bit value in RCAP2H and RCAP2L. The values in
Timer in Capture ModeRCAP2H and RCAP2L are preset by software. If EXEN2 = 1, a
16-bit reload can be triggered either by an overflow or by a 1-to-0 transition at external
input T2EX. This transition also sets the EXF2 bit. Both the TF2 and EXF2 bits can
73
generate an interrupt if enabled. Setting the DCEN bit enables Timer 2 to count up or
down, as shown in Figure 10-2. In this mode, the T2EX pin controls the direction of the
count. Logic 1 at T2EX makes Timer 2 count up. The timer will overflow at 0FFFFH and
set the TF2 bit. This overflow also causes the 16-bit value in RCAP2H and RCAP2L
to be reloaded into the timer registers, TH2 and TL2,respectively.
Logic 0 at T2EX makes Timer 2 count down. The timer underflows when
TH2 and TL2 equal the values stored in RCAP2H and RCAP2L. The underflow sets the
TF2 bit and causes 0FFFFH to be reloaded into the timer registers.
The EXF2 bit toggles whenever Timer 2 overflows or underflows and can be used as a
17th bit of resolution. In this operating mode, EXF2 does not flag an interrupt.
– IE.6 Reserved.
74
ET0 IE.1 Timer 0 interrupt enable bit.
User software should never write 1s to reserved bits, because they may be used in future AT89
products.
0 IE
0
INT1
1
TF0
0
IE
INT1 0
TF1
T1
R1
TF2
EXF
2
75
Table 3. Serial Programming Instruction Set
Instruction
Format
xxx
1010 1100 0101 0011 xxxx xxxx xxxx x
Enable Serial
Programming 0110 1001 Programming
Enable
(Output on while RST is high
MISO)
xxx
1010 1100 100x xxxx xxxx xxxx xxxx x Chip Erase Flash memory
Chip Erase
array
4A7A6A5A
D3D2D1D0
A3A2A1A0
D7D6D5D4
Read Program
Memory 0010 0000 xxx Read data from Program
A9A8
A11A10
A12
Write Program
D3D2D1D0
A7A6A5A4
D7D6
0010 0100 xxxx xxxx xxxx xxxx x xx Read back current status of
LB3
A
7
x
x
A9A8
A11A10
Read Signature 0010 1000 xxx x xxx0 Signature Byte Read Signature Byte
A12
Bytes
Read Program
A11A1
A9A8
A12
Memory 0011 0000 xxx Byte 0 Byte 1... Read data from Program
76
0
Byte 255 memory in the Page Mode
(Page Mode)
(256 bytes)
A9A8
A11A10
Write Program
A12
Memory
Byte 255 memory in the Page Mode
(Page Mode)
(256 bytes)
After Reset signal is high, 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. SCK
should be no faster than 1/16 of the system clock at XTAL1.
For Page Read/Write, the data always starts from byte 0 to 255. After the command byte
and upper address byte are latched, each byte thereafter is treated as data until all 256
bytes are shifted in/out. Then the next instruction will be ready to be decoded.
28. AC Characteristics
Under operating conditions, load capacitance for Port 0, ALE/PROG, and PSEN = 100
pF; load capacitance for all other outputs = 80 pF.
1/t
CLCL Oscillator Frequency 0 33 MHz
t
LHLL ALE Pulse Width 127 2tCLC L-40 ns
t
AVLL Address Valid to ALE Low 43 tC LCL-25 ns
t
LLAX Address Hold After ALE Low 48 tC LCL-25 ns
t
LLIV ALE Low to Valid Instruction In 233 4tCL CL-65 ns
t
LLPL ALE Low to PSEN Low 43 tC LCL-25 ns
t
PLPH PSEN Pulse Width 205 3tCLC L-45 ns
t
PLIV PSEN Low to Valid Instruction In 145 3tCL CL-60 ns
t
PXIX Input Instruction Hold After PSEN 0 0 ns
t
PXIZ Input Instruction Float After PSEN 59 tCL CL-25 ns
t t
PXAV PSEN to Address Valid 75 CLCL-8 ns
t
AVIV Address to Valid Instruction In 312 5tCL CL-80 ns
77
t
PLAZ PSEN Low to Address Float 10 10 ns
t
RLRH RD Pulse Width 400 6tCLCL-100 ns
t
WLW
H WR Pulse Width 400 6tCLCL-100 ns
t
RLDV RD Low to Valid Data In 252 5tCL CL-90 ns
t
RHDX Data Hold After RD 0 0 ns
t
RHDZ Data Float After RD 97 2tCL CL-28 ns
t
LLDV ALE Low to Valid Data In 517 8tCLCL-150 ns
t
AVDV Address to Valid Data In 585 9tCLCL-165 ns
t
LLWL ALE Low to RD or WR Low 200 300 3tCLC L-50 3tCLC L+50 ns
t
AVWL Address to RD or WR Low 203 4tCLC L-75 ns
t
QVWX Data Valid to WR Transition 23 tC LCL-30 ns
t
QVWH Data Valid to WR High 433 7tCLCL-130 ns
t
WHQX Data Hold After WR 33 tC LCL-25 ns
t
RLAZ
t
WHLH RD or WR High to ALE High 43 123 tC LCL-25 tC LCL+25 ns
78
Appendix 3
LM193/LM293/LM393/LM2903
General Description
The LM193 series consists of two independent precision voltage comparators with an
offset voltage specification as low as 2.0 mV max for two comparators which were
designed specifically to operate from a single power supply over a wide range of
voltages. Operation from split power supplies is also possible and the low power supply
current drain is independent of the magnitude of the power supplyvoltage. These
comparators also have a unique characteristic in that the input common-mode voltage
range includes ground, even though operated from a single power supplyvoltage.
Application areas include limit comparators, simple analog to digital converters; pulse,
squarewave and time delay generators; wide range VCO; MOS clock timers;
multivibrators and high voltage digital logic gates. The LM193 series was designed to
directly interface with TTL and CMOS. When operated from both plus and minus power
supplies, the LM193 series will directly interface with MOS logic where their low power
drain is a distinct advantage over standard comparators. The LM393 and LM2903 parts
are available in National’s innovative thin micro SMD package with 8 (12 mil) large
bumps.
Advantages
79
Features
Wide supply
Voltage range: 2.0V to 36V
Single or dual supplies: ±1.0V to ±18V
Very low supply current drain (0.4 mA) — independent
of supply voltage
Low input biasing current: 25 nA
Low input offset current: ±5 nA
Maximum offset voltage: ±3 mV
Input common-mode voltage range includes ground
Differential input voltage range equal to the power
supply voltage
Low output saturation voltage,: 250 mV at 4 mA
Output voltage compatible with TTL, DTL, ECL, MOS
and CMOS logic systems
Available in the 8-Bump (12 mil) micro SMD package
See AN-1112 for micro SMD considerations
80
Diagrams
00570902
Metal
Dual-In-
Line/SOIC
Package
S
c Miro SMD
h Micro SMD Maring
e
m
at
ic
a
n
d
C
o
n
n
ec
ti
Top View Top View
o
n
81
82
Typical Performance Characteristics
83
Application Hints
The LM193 series are high gain, wide bandwidth devices which, like most
comparators, can easily oscillate if the output lead is inadvertently allowed to capacitively
couple to the inputs via stray capacitance. This shows up only during the output voltage
transition intervals as the comparator change states. Power supply bypassing is not
required to solve this problem. Standard PC board layout is helpful as it reduces stray
input-output coupling. Reducing the input re-sistors to < 10 kΩ reduces the feedback
signal levels and finally, adding even a small amount (1.0 to 10 mV) of positive feedback
(hysteresis) causes such a rapid transition that oscillations due to stray feedback are not
possible. Simply socketing the IC and attaching resistors to the pins will cause input-
output oscillations during the small transition intervals unless hysteresis is used. If the
input signal is a pulse waveform, with relatively fast rise and fall times, hysteresis is not
required.
All input pins of any unused comparators should be tied to the negative supply.
The bias network of the LM193 series establishes a drain current which is independent of
the magnitude of the power supply voltage over the range of from 2.0 VDC to 30 VDC.
It is usually unnecessary to use a bypass capacitor across the power supply line.
The differential input voltage may be larger than V+ without damaging the device (Note
8). Protection should be provided to prevent the input voltages from going negative more
than −0.3 VDC (at 25˚C). An input clamp diode can be used as shown in the applications
section.
The output of the LM193 series is the uncommitted collector of a grounded-emitter NPN
output transistor. Many collectors can be tied together to provide an output OR’ing
function. An output pull-up resistor can be connected to any available power supply
voltage within the permitted supply voltage range and there is no restriction on this
voltage due to the magnitude of the voltage which is applied to the V + terminal of the
LM193 package. The output can also be used as a simple SPST switch to ground (when a
pull-up resistor is not used). The amount of current which the output device can sink is
limited by the drive available (which is independent of V+) and the β of this device. When
the maximum current limit is reached (approximately 16mA), the output transistor will
come out of saturation and the output voltage will rise very rapidly. The output saturation
84
voltage is limited by the ap-proximately 60Ω rSAT of the output transistor. The low offset
voltage of the output transistor (1.0mV) allows the output to clamp essentially to ground
level for small load currents.
85
Typical Applications (V+=5.0 VDC) (Continued)
Inverting Comparator with Hysteresis Output Strobing
86
Typical Applications (V+=5.0 VDC) (Continued)
Comparing Input Voltages of Opposite Polarity ORing the Outputs
One-Shot Multivibrator
87
Zero Crossing Detector Comparator With a Negative Reference
88
Typical Applications (V+=5.0 VDC) (Continued)
89