Sie sind auf Seite 1von 72

CHAPTER -1

INTRODUCTION
1.1 GENERAL

A tank is a tracked, armored fighting vehicle designed for front-line combat


which combines operational mobility, tactical offensive, and defensive capabilities.
Firepower is normally provided by a large-caliber main gun in a rotating turret and
secondary machine guns, while heavy armor and all-terrain mobility provide
protection for the tank and its crew, allowing it to perform all primary tasks of the
armoured troops on the battlefield.

Tank guns are a specific field of weapon design that meet the particular
needs of the tank. As the tank's primary armament, they are almost always
employed in a direct-fire mode to defeat a variety of ground targets at all ranges,
including dug-in infantry, lightly armored vehicles, and especially other heavily
armored tanks. They must provide accuracy, range, penetration, and rapid fire in a
package that is as compact and lightweight as possible, to allow mounting in the
cramped confines of an armored gun turret. Tank guns generally use self-contained
ammunition, allowing rapid loading (or use of an autoloader). They often show a
bulge in the barrel, which is a bore evacuator, or a device on the muzzle, which is a
muzzle brake. The three traditional factors determining a tank's capability
effectiveness are its firepower, protection, and mobility. Firepower is the ability of
a tank's crew to identify, engage, and destroy the enemy. Protection is the tank
crew's ability to evade detection, preserve themselves from enemy fire, and retain
full vehicle functionality after combat.

1
1.2 SCOPE

As the semi-conductor technology is experiencing rapid growth, human life


gets complicated without “embedded system”. Nowadays these new technologies
are introduced in the equipments engaged in the battlefield to improve the safety of
soldiers and also to ensure combat effectiveness. Our scope is to develop a
mechanism to automatically control the movement of the air defense gun mounted
on the tank. To understand our project better, let’s consider our indigenous tank
‘ARJUN’ designed by CVRDE, DRDO. It consists of hull and turret. The latter is
provided with three hatches .There are four crew members namely loader, gunner,
driver and commander .The tank is equipped with three guns, namely main gun,
machine gun and air defense gun. Main gun uses FSAPDS and HESH as
ammunition, the coaxial 7.62mm PKT machine gun and a 12.7mm air defense
machine gun. A 5.45mm AKS-74 assault rifle is carried on a storage rack.

Air defense gun is mounted on the loader’s hatch in the turret of


the tank and is controlled by the loader .It is primarily used to attack low flying
armored vehicles. Presently the gunner has to expose himself to track the enemy
vehicle and attack the target and so he becomes vulnerable to external foes, added
to it he has to manually adjust the desired elevation and depression of the air
defense gun.

2
Fig 1.1 TANK SKELETEL VIEW

3
1.3. LITERATURE REVIEW

1.3.1 PRESENT STATUS ON MBT ARJUN

Presently the air defense gun is maneuvered manually both in azimuth and
vertical planes. This entails operation of the air defense gun by the loader in the
hatch opened condition, exposing the loader to the attack by the enemy. Also this
manual operation will be a tiring activity.

1.3.2 PROPOSED IMPROVEMENT

Our project focuses on the safety of the gunner by employing


embedded systems to position the air defense gun without having the gunner
exposed.The scope of the project is to create a conceptual model enabling power
operated movement of air defense gun in place of the existing manual operation.

4
CHAPTER-2

HARDWARE DESCRIPTION

2.1 INTRODUCTION

Our bench model of REFLEXIVE ADAPDATION OF AIR DEFENSE


GUN can be represented in three setup blocks, namely the Microcontroller block,
Joystick block and Air Defense Gun setup.

The microcontroller block contains PIC16F877A microcontroller, it plays


the important role in automation of the project. It is connected to ADG via Drivers
and motors there by controls its movements, added to PIC,LCD,RF RX and Driver
is provided in this block.

The Joystick block consisted of a digital joystick and its corresponding


relays. The joystick plays the important role in manually operating the ADG.Just
by moving the joystick within its axis the ADG can by controlled and moved to
desired direction.

The ADG setup consist of three IR sensors to track the low flying aircraft,
motors to control the movement of ADG.The consists of LASER arrangement, its
our substitute of ADG. The whole ADG setup is supported by a wooden mount.

The low flying aircraft is represented by a setup consisting of IR sensor and


RF TX.this setup is man handeled and

5
2.1.1BASIC BLOCK DIAGRAM

FIG 2.1 BLOCK DIAGRAM

6
2.2 COMPONENT DESCRIPTION

2.2.1 POWER SUPPLY

FIG 2.2.1 POWER SUPPLY

 Transformer

The potential transformer will step down the power supply voltage (0-
230V) to (0-6V) level. Then the secondary of the potential transformer will be
connected to the precision rectifier, which is constructed with the help of op–amp.
The advantages of using precision rectifier are it will give peak voltage output as
DC, rest of the circuits will give only RMS output.

7
 Bridge rectifier

When four diodes are connected as shown in figure, the circuit is


called as bridge rectifier. The input to the circuit is applied to the diagonally
opposite corners of the network, and the output is taken from the remaining two
corners.

Let us assume that the transformer is working properly and there is a positive
potential, at point A and a negative potential at point B. the positive potential at
point A will forward bias D3 and reverse bias D4.

The negative potential at point B will forward bias D1 and reverse D2. At this
time D3 and D1 are forward biased and will allow current flow to pass through
them; D4 and D2 are reverse biased and will block current flow.

The path for current flow is from point B through D1, up through RL,
through D3, through the secondary of the transformer back to point B. this path is
indicated by the solid arrows. Waveforms (1) and (2) can be observed across D1
and D3.

One-half cycle later the polarity across the secondary of the


transformer reverse, forward biasing D2 and D4 and reverse biasing D1 and D3.
Current flow will now be from point A through D4, up through RL, through D2,
through the secondary of T1, and back to point A. This path is indicated by the
broken arrows. Waveforms (3) and (4) can be observed across D2 and D4. The
current flow through RL is always in the same direction. In flowing through RL
this current develops a voltage corresponding to that shown waveform (5). Since

8
current flows through the load (RL) during both half cycles of the applied voltage,
this bridge rectifier is a full-wave rectifier.

One advantage of a bridge rectifier over a conventional full-wave


rectifier is that with a given transformer the bridge rectifier produces a voltage
output that is nearly twice that of the conventional full-wave circuit.
This may be shown by assigning values to some of the components
shown in views A and B. assume that the same transformer is used in both circuits.
The peak voltage developed between points X and y is 1000 volts in both circuits.
In the conventional full-wave circuit shown—in view A, the peak voltage from the
center tap to either X or Y is 500 volts. Since only one diode can conduct at any
instant, the maximum voltage that can be rectified at any instant is 500 volts.
The maximum voltage that appears across the load resistor is nearly-
but never exceeds-500 volts, as result of the small voltage drop across the diode. In
the bridge rectifier shown in view B, the maximum voltage that can be rectified is
the full secondary voltage, which is 1000 volts. Therefore, the peak output voltage
across the load resistor is nearly 1000 volts. With both circuits using the same
transformer, the bridge rectifier circuit produces a higher output voltage than the
conventional full-wave rectifier circuit.

2.2.1.1 SECONDARY BATTERIES

Secondary batteries must be charged before use; they are usually assembled
with active materials in the discharged state. Rechargeable batteries or secondary
cells can be recharged by applying electric current, which reverses the chemical
reactions that occur during its use. Devices to supply the appropriate current are
called chargers or rechargers.

9
The oldest form of rechargeable battery is the lead-acid battery.[37] This
battery is notable in that it contains a liquid in an unsealed container, requiring that
the battery be kept upright and the area be well ventilated to ensure safe dispersal
of the hydrogen gas produced by these batteries during overcharging. The lead-
acid battery is also very heavy for the amount of electrical energy it can supply.
Despite this, its low manufacturing cost and its high surge current levels make its
use common where a large capacity (over approximately 10Ah) is required or
where the weight and ease of handling are not concerns.

2.2.2 IC VOLTAGE REGULATORS

Voltage regulators comprise a class of widely used ICs. Regulator IC


units contain the circuitry for reference source, comparator amplifier, control
device, and overload protection all in a single IC. IC units provide regulation of
either a fixed positive voltage, a fixed negative voltage, or an adjustably set
voltage. The regulators can be selected for operation with load currents from
hundreds of milli amperes to tens of amperes, corresponding to power ratings from
milli watts to tens of watts.

10
Fig 2.2.2.1 IC VOLTAGE REGULATORS

A fixed three-terminal voltage regulator has an unregulated dc input voltage,


Vi, applied to one input terminal, a regulated dc output voltage, Vo, from a second
terminal, with the third terminal connected to ground.

The series 78 regulators provide fixed positive regulated voltages from


5 to 24 volts. Similarly, the series 79 regulators provide fixed negative regulated
voltages from 5 to 24 volts.

 For ICs, microcontroller, LCD --------- 5 volts


 For sensor, motors ---------- 12 volts

11
2.2.3MICROCONTROLLER

2.2.3.1PIN DIAGRAM

Fig 2.2.3 pin diagram of PIC16F877A

 High-Performance RISC CPU:

• Only 35 single-word instructions to learn


• All single-cycle instructions except for program
branches, which are two-cycle
• Operating speed: DC – 20 MHz clock input
DC – 200 ns instruction cycle
• Up to 8K x 14 words of Flash Program Memory,

12
Up to 368 x 8 bytes of Data Memory (RAM),
Up to 256 x 8 bytes of EEPROM Data Memory
• Pinout compatible to other 28-pin or 40/44-pin
PIC16CXXX and PIC16FXXX microcontrollers

 Peripheral Features:
• Timer0: 8-bit timer/counter with 8-bit prescaler
• Timer1: 16-bit timer/counter with prescaler,
can be incremented during Sleep via external
crystal/clock
• Timer2: 8-bit timer/counter with 8-bit period
register, prescaler and postscaler
• Two Capture, Compare, PWM modules
- Capture is 16-bit, max. resolution is 12.5 ns
- Compare is 16-bit, max. resolution is 200 ns
- PWM max. resolution is 10-bit
• Synchronous Serial Port (SSP) with SPI™
(Master mode) and I2C™ (Master/Slave)
• Universal Synchronous Asynchronous Receiver
Transmitter (USART/SCI) with 9-bit address
detection
• Parallel Slave Port (PSP) – 8 bits wide with
external RD, WR and CS controls (40/44-pin only)
• Brown-out detection circuitry for
Brown-out Reset (BOR)

 Analog Features:
• 10-bit, up to 8-channel Analog-to-Digital
13
Converter (A/D)
• Brown-out Reset (BOR)
• Analog Comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference
(VREF) module
- Programmable input multiplexing from device
inputs and internal voltage reference
- Comparator outputs are externally accessible
 Special Microcontroller Features:
• 100,000 erase/write cycle Enhanced Flash
program memory typical
• 1,000,000 erase/write cycle Data EEPROM
memory typical
• Data EEPROM Retention > 40 years
• Self-reprogrammable under software control
• In-Circuit Serial Programming™ (ICSP™)
via two pins
• Single-supply 5V In-Circuit Serial Programming
• Watchdog Timer (WDT) with its own on-chip RC
oscillator for reliable operation
• Programmable code protection
• Power saving Sleep mode
• Selectable oscillator options
• In-Circuit Debug (ICD) via two pins
 CMOS Technology:
• Low-power, high-speed Flash/EEPROM
14
technology
• Fully static design
• Wide operating voltage range (2.0V to 5.5V)
• Commercial and Industrial temperature ranges

• Low-power consumption

2.2.3.2 DESCRIPTION:

The 16F877A is one of the most popular PIC microcontrollers and it


comes in a 40 pin DIP pinout and it has many internal peripherals.  The 40 pins
make it easier to use the peripherals as the functions are spread out over the pins.
This makes it easier to decide what external devices to attach without worrying too
much if there enough pins to do the job.  One of the main advantages is that each
pin is only shared between two or three function.

 Operating Speed Max 20 MHz, Voltage-(2-5.5)v

 Memory:
Flash Program 8Kx14 Words,

RAM 368 Bytes,

EEPROM Data Memory 256 Bytes

 Low power, High speed Flash/EEPROM Technology


 It has 5 Ports for Internal and External usage
 It has on chip Timers. 3 Timers are avail
 It has in built Analog to Digital Converter

15
 In built Multiplexer availability for signal Selection
 It has serial as well as Parallel Communication facilities

16
FIG 2.2.3.2 MICROCONTROLLER

2.2.4 MOTOR DRIVER IC L293D:

2.2.4.1FEATURES 0F L293D

 Wide Supply-Voltage Range: 4.5 V to 36 V


 Separate Input-Logic Supply
 Internal ESD Protection
 Thermal Shutdown
 High-Noise-Immunity Inputs
 Functional Replacements for SGS L293 and SGS L293D
 Output Current 1 A Per Channel
(600 mA for L293D)
 Peak Output Current 2 A Per Channel
(1.2 A for L293D)
 Output Clamp Diodes for Inductive
 Transient Suppression (L293D)

2.2.4.2 DESCRIPTION:
The L293 and L293D are quadruple high-current half-H drivers. The
L293 is designed to provide bidirectional drive currents of up to 1 A at voltages
from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents
of up to 600-mA at voltages from 4.5 V to 36 V.

Both devices are designed to drive inductive loads such as relays,


solenoids, dc and bipolar stepping motors, as well as other high-current/high-
17
voltage loads in positive-supply applications. All inputs are TTL compatible. Each
output is a complete totem-pole drive circuit, with a Darlington transistor sink and
a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2
enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is
high, the associated drivers are enabled and their outputs are active and in phase
with their inputs.

FIG 2.2.4.2.1: PIN DIAGRAM OF L293D IC

The pin numbers 3 and 6 are connected to one motor wile the pins
11 and 14 are connected to the other motor. The power supply to the motors is also
given through the motor driver IC.

The motor driver IC consists of two Darlington pairs. The Darlington


transistor (often called a Darlington pair) is a compound structure consisting of two

18
bipolar transistors (either integrated or separated devices) connected in such a way
that the current amplified by the first transistor is amplified further by the second
one. This configuration gives a much higher current gain than each transistor
taken separately and, in the case of integrated devices, can take less space than two
individual transistors because they can use a shared collector.

FIG 2.2.4.2: CIRCUIT DIAGRAM OF MOTOR DRIVER IC

2.2.5 LCD:

2.2.5.1 Display Unit:

19
This section describes the operation modes of LCDs, then describes how to
program and interface an LCD to PIC Microcontroller.

2.2.5.2 LCD Operation:

In recent years the LCD is finding widespread use replacing LEDs (seven-
segment LEDs or other multisegment LEDs). This is due to the following reasons:

 The declining prices of LCDs.


 The ability to display numbers, characters, and graphics. This is in
contrast to LEDs, which are limited to numbers and a few characters.
 Incorporation of a refreshing controller into the LCD, thereby
relieving the CPU of the task of refreshing the LCD. In contrast, the
LED must be refreshed by the CPU (or in some other way) to keep
displaying the data.
 Ease of programming for characters and graphics.
2.2.5.3 LCD PIN DESCRIPTIONS:

The LCD discussed in this section has 14 pins. The function of each pin is
given in below.

 VCC,VSS, and VEE :

While VCC and VSS provide +5V and ground, respectively, VEE is used for
controlling LCD contrast.

 RS, Register Select :

There are two very important registers inside the LCD. The RS pin is used
for their selection as follows. If RS=0, the instruction command code register is

20
selected, allowing the user to send a command such as clear display, cursor at
home, etc. If RS=1 the data register is selected, allowing the user to send data to be
displayed on the LCD.

 R/W, Read/Write :

R/W input allows the user to write information to the LCD or read
information from it. R/W=1 when reading; R/W=0 when writing.

 E,Enable :

The enable pin is used by the LCD to latch information presented to its data
pins. When data is supplied to data pins, a high-to-low pulse must be applied to
this pin in order for the LCD to latch in the data present at the data pins. This pulse
must be a minimum of 450ns wide.

 D0-D7 :

The 8-bit data pins, D0-D7, are used to send information to the LCD or read
the contents of the LCD’s internal registers.

To display letters and numbers, we send ASCII codes for the letters A-Z, a-
z, and numbers 0-9 to these pins while making RS=1.

There are also instruction command codes that can be sent to the LCD to
clear the display or force the cursor to the home position or blink the cursor. Table
lists the instruction command codes.We also use RS=0 to check the busy flag bit to
see if the LCD is ready to receive information. The busy flag is D7 and can be read
when R/W=1 and RS=0, as follows: if R/W=1, RS=0. When D7=1 ( busy flag=1 ),

21
the LCD is busy taking care of internal operations and will not accept any new
information.

TABLE 2.2.5.3 COMANDS TO LCAD IR

Code Command to LCD Instruction Register

( Hex )
1 Clear display screen

2 Return home

4 Decrement cursor ( shift cursor to left )

6 Increment cursor ( shift cursor to right )

5 Shift display right

7 Shift display left

8 Display off, cursor off

A Display off, cursor on

C Display on, cursor off

E Display on, cursor blinking

F Display off, cursor blinking

10 Shift cursor position to left

14 Shift cursor position to right

18 Shift the entire display to the left

1C Shift the entire display to the right

80 Force cursor to beginning of 1st line

22
C0 Force cursor to beginning of 2nd line

38 2 lines and 5x7 matrix

TABLE 2.2.5.3.2 FUNCTION AND USE OF PINS IN LCD

Pin Name Function USE


No
1 Vss Ground
2 Vdd +ve Supply 5v Volts Regulated DC
3 Vee Contrast This is used to set the contrast1
4 RS Register Set Register select signal
“0”:Instruction register (when writing)
Busy flag & address counter (When
reading)
“1”:Data register (when writing &
reading)
5 R/W Read / Write Read/write select signal
“0” for writing , “1” for reading
6 E Enable Operation (data read/write) enable

23
signal
7 D0 Data Bit 0
8 D1 Data Bit 1
9 D2 Data Bit 2
10 D3 Data Bit 3
11 D4 Data Bit 4
12 D5 Data Bit 5
13 D6 Data Bit 6
14 D7 Data Bit 7
15 A +4.2 for Back Positive supply for back light if
light available
16 K Power supply
Back light ( 0V)

2.2.5.4 STEPS TO INTERFACE LCD WITH PIC


MICROCONTROLLER

 STEP 1 : Identify :

LCD are available in as follows: 16x1 , 16x2 , 20x2 in the format AxB where
A is the number of columns and B is the number of Rows An LCD might also be
Back lit .

 STEP 2 : Connect :

24
FIG 2.2.5.4.1: LCD INTERFACED WITH MICROCONTROLLER

 STEP 3 : Interface :

Pins are connected RS , RW , E , D0 - D7 to pins on the micro controller .


Data bus is connected on port A and the RS , RW , E on port B .

SEVEN DARLINGTON ARRAYS

2.2.6 ULN2003 RELAY

2.2.6.1 DESCRIPTION

 The UTC ULN2003 is high-voltage,high-current darlighton


drivers comprised of seven NPN darlington pairs.
 The ULN2002A, ULN2003A, ULN2003AI, ULN2004A, ULQ2003A, and
ULQ2004A are high-voltage high-current

25
 Darlington transistor arrays. Each consists of seven npn Darlington pairs that
feature high-voltage outputs withcommon-cathode clamp diodes for
switching inductive loads. The collector-current rating of a single
Darlingtonpair is 500 mA. The Darlington pairs can be paralleled for higher
current capability. Applications include relaydrivers, hammer drivers, lamp
drivers, display drivers (LED and gas discharge), line drivers, and logic
buffers.
 The ULN2001A is a general-purpose array and can be used with TTL and
CMOS technologies. The ULN2002Ais designed specifically for use with
14-V to 25-V PMOS devices. Each input of this device has a Zener diodeand
resistor in series to control the input current to a safe limit. The ULN2003A
and ULQ2003A have a 2.7-kΩseries base resistor for each Darlington pair
for operation directly with TTL or 5-V CMOS devices. The
 ULN2004A and ULQ2004A have a 10.5-kΩ series base resistor to allow
operation directly from CMOS devices
 that use supply voltages of 6 V to 15 V. The required input current of the
ULN/ULQ2004A is below that of the
 ULN/ULQ2003A, and the required voltage is less than that required by the
ULN2002A.

2.2.6.2FEATURES

 Output current (single output) 500mA MAX.


 High sustaining voltage output 50V MIN.
 Output clamp diodes
 Inputs compatible with various types of logic

26
2.2.6.3 APPLICATIONS

 Relay, hammer, lamp and display (LED) drivers.

• Inputs Compatible With Various Types of

Logic

• 500-mA-Rated Collector Current (Single Output)

• High-Voltage Outputs: 50 V

• Output Clamp Diodes

• Relay-Driver Applications

27
FIG2.2.6.1.1PIN DIAGRAM

2.2.6.4 LOGIC DIAGRAM

28
FIG 2.2.6.5.1 LOGIC DIAGRAM OF ULN2003

2.2.6.5 RELAY OPERATION

A relay is usually an electromechanical device that is actuated by an


electrical current.

29
The current flowing in one circuit causes the opening or closing of another circuit.
Relays are like remote control switches and are used in many applications because
of their relative simplicity, long
life, and proven high reliability.
Relays are used in a wide variety
of applications throughout

Fig 2.2.7.1 relay operation

industry, such as in telephone exchanges, digital computers and automation


systems. Highly sophisticated relays are utilized to protect electric power systems
against trouble and power blackouts as well as to regulate and control the
generation and distribution of power. In the home, relays are used in refrigerators,
washing machines and dishwashers, and heating and air-conditioning controls.
Although relays are generally associated with electrical circuitry, there are many
other types, such as pneumatic and hydraulic. Input may be electrical and output
directly mechanical, or vice versa.
How do relays work?
All relays contain a sensing unit, the electric coil, which is powered by AC or DC
current. When the applied current or voltage exceeds a threshold value, the coil
activates the armature, which operates either to close the open contacts or to open
the closed contacts. When a power is supplied to the coil, it generates a magnetic
force that actuates the switch mechanism. The magnetic force is, in effect, relaying
the action from one circuit to another. The first circuit is called the control circuit;
the second is called the load circuit.

There are three basic functions of a relay: On/Off Control, Limit Control and Logic
Operation.

30
On/Off Control: Example: Air conditioning control, used to limit and control a
“high power”
load, such as a compressor
Limit Control: Example: Motor Speed Control, used to disconnect a motor if it
runs slower or
faster than the desired speed
Logic Operation: Example: Test Equipment, used to connect the instrument to a
number of
testing points on the device under test

2.2.6.6 SOLID STATE RELAYS


These active semiconductor devices use light instead of magnetism to actuate a
switch. The light comes from an LED, or light emitting diode. When control power
is applied to the device’s
output, the light General Purpose Relay is turned on and shines across an open
space. On the load side of this space, a part of the device senses the presence of the
light, and triggers a solid state switch that either opens or closes the circuit under
control. Often, solid state relays are used where the circuit under control must be

protected

31
FIG 2.2.6.1.1solid state relay
from the introduction of electrical noises. Advantages of Solid State Relays include
low EMI/RFI, long life, no moving parts, no contact bounce, and fast response.
The drawback to using a solid state relay is that it can only accomplish single pole
switching.
Contact Information
    The contacts are the most important constituent of a relay. Their characteristics
are significantly affected by factors such as the material of the contacts, voltage
and current values applied to them (especially, the voltage and current waveforms
when energizing and de-energizing the contacts), the type of load, operating
frequency, and bounce. If any of these factors fail to satisfy a predetermined value,
problems such as metal degradation between contacts, contact welding, wear, or a
rapid increase in the contact resistance may occur. The quantity of electrical
current that flows through the contacts directly influences the contacts’
characteristics. For example, when the relay is used to control an inductive load,
such as a motor or a lamp. The contacts will wear faster and metal decomposition
between the mating contacts will occur more often as the inrush current to the
contacts increases.
    To prolong the life expectancy of a relay, a contact protection circuit is
recommended. This protection will suppress noise and prevent the generation of
carbon at the contact surface when the relay is opened. Examples of these
synergistic components that provide contact circuit protection include resistor
capacitors, diodes, Zener diodes and varistors.
Contact Arrangement/Poles
    The arrangement of contacts on a relay includes a form factor and a number of
poles. Each form factor is explained below.
    Form A is a contact that is Normally Open (NO), or “make” contact. It is open
32
when the coil is de-energized and closes when the coil is energized. Form A
contacts are useful in applications that must switch a single power source of high
current from a remote location. An example of this is a car horn, which cannot
have a high current applied directly to the steering wheel. A Form A relay can be
used to switch the high current to the horn. Form B is a contact that is Normally
Closed (NC), or “break” contact. It is closed in the de-energized position and opens
when the coil is energized.
    Form B contacts are useful in applications that require the circuit to remain
closed, and when the relay is activated, the circuit is shut off. An example of this is
a machine’s motor that needs to run at all times, but when the motor must be
stopped, the operator can do so by activating a Form B relay and breaking the
circuit.
    Form C is a combination of Form A and B arrangement, sharing the same
movable contact in the switching circuit. Form C contact are useful in applications
that require one circuit to remain open; when the relay is activated, the first circuit
is shut off, and another circuit is turned on. An example of this is on a piece of
equipment that runs continually: when the relay is activated, it stops that piece of
equipment and opens a second circuit to another piece of equipment.
Make-before-break Contact: a contact arrangement in which part of the
switching section is shared between both a Form A and a Form B contact. When
the relay operates or releases, the contact that closes the circuit operates before the
contact that opens the circuit releases. Thus both contact are closed momentarily at
the same time. The inverse of a Make-before break contact is a Break-before-make
contact. Poles are the number of separate switching circuits within the relay. The
most common versions are Single Pole, Double Pole and Four Pole.
and a maintained action switch.

33
2.2.7 ENCODER: RF TRANSMITTER

2.2.7.1 FEATURES

 Operating voltage: 2.4V~12V


ow power and high noise immunity CMOS
technology
 Low standby current
 Three words transmission
 Built-in oscillator needs only 5% resistor
 Easy interface with an RF or infrared transmission media
 Minimal external components
2.2.7.2 APPLICATIONS
 Burglar alarm system
 Smoke and fire alarm system
 Garage door controllers
 Car door controllers
 Car alarm system
 Security system
 Cordless telephones
 Other remote control systems

2.2.7.3 GENERAL DESCRIPTION


The 3^18 encoders are a series of CMOS LSIs for remote control system
applications. They are capable of encoding 18 bits of information which consists of

34
N address bits and 18_N data bits. Each address/data input is externally trinary
programmable if bonded out. It is otherwise set floating internally. Various
packages of the 3^18 encoders offer flexible combinations of programmable
address/data to meet various application needs. The programmable address/ data is
transmitted together with the header bits via an RF or an infrared transmission
medium upon receipt of a trigger signal. The capability to select a TE trigger type
or a DATA trigger type further enhances the application flexibility of the 3^18
series of encoders.

2.2.7.4 PIN DIAGRAM

Fig 2.2.8.4.1 pin diagram HT640

2.2.7.4.2PIN DESCRIPTION

35
36
2.2.8 HT648L DECODER: RF RECEIVER

2.2.8.1 FEATURES

 Operating voltage: 2.4V~12V


 Low power and high noise immunity CMOS technology
 Low standby current
 Capable of decoding 18 bits of information
 Pairs with HOLTEK’s 318 series of encoders
 8~18 address pins
 0~8 data pins
 Ternary address setting
 Two times of receiving check
 Built-in oscillator needs only a 5% resistor
 Valid transmission indictor
 Easily interface with an RF or an infrared transmission medium
 Minimal external components

2.2.8.2 APPLICATIONS
 Burglar alarm system
 Smoke and fire alarm system
 Garage door controllers
 Car door controllers
 Car alarm system
 Security system
 Cordless telephones

37
 Other remote control systems

2.2.8.3 PIN DIAGRAM

FIG 2.2.8.3.1 PIN DIAGRAM OF HT648L


2.2.8.4 GENERAL DESCRIPTION

The 318 decoders are a series of CMOS LSIs for remote control system
applications. They are paired with the 318 series of encoders. For proper
operation a pair of encoder/decoder pair with the same number of address and
data format should be selected (refer to the encoder/decoder cross reference

38
tables). The 318 series of decoders receives serial addressand data from that
series of encoders that are transmitted by a carrier using an RF or an IR
transmission medium. It then compares the serial input data twice continuously
with its local address. If no errors or unmatched codes are encountered, the
input data codes are decodedand then transferred to the output pins. The VT pin
also goes high to indicate a valid transmission. The 318 decoders are capable of
decoding 18 bits of information that consists of N bits of address and 18–N bits
of data. To meet various applications they are arranged to provide a number of
data pins whose range is from 0 to 8 and an address pin whose range is from 8
to 18. In addition, the 318 decoders provide various combinations of
address/data number in different packages.

2.2.9 JOYSTICK

Joysticks pull off a really neat trick. They take something entirely physical --
the movement of your hand -- and translate it into something entirely mathematical
-- a string of ones and zeros (the language of computers). With a good joystick, the
translation is so flawless that you completely forget about it. When you're really
engaged in a game, you feel like you're interacting with the virtual world directly.

A joystick is an input device consisting of a stick that pivots on a base and


reports its angle or direction to the device it is controlling. Joysticks are often used
to control video games, and usually have one or more push-buttons whose state can
also be read by the computer.

Most joysticks are two-dimensional, having two axes of movement (similar


to a mouse), but one and three-dimensional joysticks do exist. A joystick is

39
generally configured so that moving the stick left or right signals movement along
the X axis, and moving it forward (up) or back (down) signals movement along the
Y axis. In joysticks that are configured for three-dimensional movement, twisting
the stick left (counter-clockwise) or right (clockwise) signals movement along the
Z axis. These three axes - X Y and Z - are, in relation to an aircraft, roll, pitch, and
yaw.

An analog joystick is a joystick which has continuous states, i.e. returns an


angle measure of the movement in any direction in the plane or the space (usually
using potentiometers) and a digital joystick gives only on/off signals for four
different directions, and mechanically possible combinations (such as up-right,
down-left, etc.). (Digital joysticks were very common as game controllers for
the video game consoles, arcade machines, and home computers of the 1980s.)

Additionally joysticks often have one or more fire buttons, used to trigger some
kind of action. These are simple on/off switches.

Some joysticks have haptic feedback capability. These are thus active devices, not
just input devices. The computer can return a signal to the joystick that causes it to
resist the movement with a returning force or make the joystick vibrate.

In our project, Joystick is used for manual handling or controlling of the


ADG.

40
2.2.10 DC MOTORS

2.2.10.1 PRINCIPLE AND OPERATION

The principle of operation of a d.c motor can be stated in a single statement


as ‘when a current carrying conductor is placed in a magnetic field; it experiences
a mechanical force’. In a practical d.c. motor, field winding produces a required
magnetic field while armature conductors play a role of a current carrying
conductors and hence armature conductors experience a force. As conductors are
placed in the slots which are on the periphery, the individual force experienced by
the conductors acts as a twisting or turning force on the armature which is called a
torque. The torque is the product of force and the radius at which this force acts. So
overall armature experiences a torque and starts rotating. Let us study this
motoring action in detail.

Consider a single conductor placed in a magnetis field as shown in the figure


below The magnetic field is produced by a permanent magnet but in a practical
d.c. motor it is produced by the field winding when it carries a current.

S
S

Flux by
Conductor conductor
Main Flux

N
Magnet
Current carrying N
conductor
41
Fig 2.2.11.1.1 conductor in mag. Fig .2.11.1.2 flux produced
flied by current carrying conductor

Now, this conductor is excited by a separate supply so that it


carries a current in a particular direction. Consider that it carries a current away
from an observer as shown in above Fig. 2. Any current carrying conductor
produces its own magnetic field around it, Hence this conductor also produces its
own flux, around. The direction of this flux can be determined by right hand thumb
rule. For direction of current considered, the direction of flux around a conductor is
clockwise.

Now there are two fluxes present

1, The flux produced by the permanent magnet called main flux.

2. The flux produced by the current carrying conductor.

These are shown in the fig.3. From this, it is clear that on one side of the
conductor, both the fluxes are in the same direction. In this case, on the left of the
conductor there is gathering of the flux lines as two fluxes help each other. As
against this, on the right of the conductor, two fluxes are in opposite direction and
hence try to cancel each other. Due to this, the density of the flux lines in this area
gets weakened. So on the left, there exists high flux density area while on the right
of the conductor there exists low flux density area as shown in fig.

This flux distribution around the conductor acts like a stretched rubber band under
tension. This exerts a mechanical force on the conductor which acts from high flux
density area towards low flux density area, i.e. from left to right for the case
considered as shown in fig.

42
S Fig.4 S
Direction
of Force
Cancellation

Gathering of flux

Addition Weakening
of flux

N N

Fig 2.2.11.1.3 interaction of two fluxes Fig 2.2.11.1.4 force


experienced by conductor

DC motors consist of one set of coils, called an armature, inside another set
of coils or a set of permanent magnets, called the stator. Applying a voltage to the
coils produces a torque in the armature, resulting in motion.

Small permanent magnet motors are cheap, but as size increases, the price
advantage shifts to wound motors.

2.2.10.2 DC MOTOR TYPES

1. Permanent Magnet: No field coils at all.

43
2. Series Wound: the field coils are connected in series with the armature coil.
Powerful and efficient at high speed, series wound motors generate the most
torque for a given current. Speed varies wildly with load, and can run away
under no-load conditions.

3. Shunt Wound: the field coils are connected in parallel with the armature coil.
Shunt wound motors generate the least torque for a given current, but speed
varies very little with load. Will not run away under no-load, but may if the
field windings fail.

4. Compound Wound: a combination of series and shunt wound. This is an


attempt to make a motor that will not run away under no load or if the field
fails, yet is as efficient and powerful as a series wound motor.

 Torque and Current

Torque is proportional to the product of armature current and the resultant


flux density per pole.

T = K × f × Ia

where T is torque, K is some constant, f is the flux density, and Ia is the armature
current.

In series wound motors, flux density approximates the square root of current, so
torque becomes approximately proportional to the 1.5 power of torque.

T = K × Ia1.5±

where T is torque, K is some constant, and Ia is the armature current.

44
 Speed, Voltage, and Induced Voltage

Resistance of the armature widings has only a minor effect on armature


current. Current is mostly determined by the voltage induced in the windings by
their movement through the field. This induced voltage, also called "back-emf" is
opposite in polarity to the applied voltage, and serves to decrease the effective
value of that voltage, and thereby decreases the current in the armature.

An increase in voltage will result in an increase in armature current, producing an


increase in torque, and acceleration. As speed increases, induced voltage will
increase, causing current and torque to decrease, until torque again equals the load
or induced voltage equals the applied voltage.

A decrease in voltage will result in a decrease of armature current, and a decrease


in torque, causing the motor to slow down. Induced voltage may momentarily be
higher than the applied voltage, causing the motor to act as a generator. This is the
essense of regenerative breaking.

Induced voltage is proportional to speed and field strength.

Eb = K × N × f

where Eb is induced voltage, K is some constant particular to that motor, N is the


speed of the motor, and f is the field strength.

This can be solved for speed to get the "Speed Equation" for a motor:

N = K × Eb ÷ f

45
where N is rpm, K is some constant (the inverse of the K above), Eb is the induced
voltage of the motor, and f is the flux density.

Note that speed is inversely proportional to field strength. That is to say, as field
strength decreases, speed increases.

2.2.10.3 DC MOTOR APPLICATION

The application of DC Motors depends on the following aspects

 Starting
 Speed Control

 Braking

D.C. shunt motor- lathes,fans,pumps disc and band saw drive requiring moderate
torques.

D.C. series motor- Electric traction, high speed tools

D.C., compound motor- Rolling mills and other loads requiring large momentary
toques.

2.2.11 IR SENSOR

46
The basic idea is to send infra red light through IR-LEDs, which is then reflected
by any object in front of the sensor.
Then all you have to do is to pick-up the reflected IR light. For detecting the
reflected IR light, we are going to use a very original technique: we are going to
use another IR-LED, to detect the IR light that was emitted from another led of the
exact same type!
This is an electrical property of Light Emitting Diodes (LEDs) which is the fact
that a led Produce a voltage difference across its leads when it is subjected to light.
As if it was a photo-cell, but with much lower output current. In other words, the
voltage generated by the leds can't be - in any way - used to generate electrical
power from light, It can barely be detected. that's why Opams are mostly used for
accurately detection of low voltages.

2.2.11.1 FEATURES

 IR LED at 900nm
 GaAlAs Infrared Light Emitting Diode
 Shines invisible IR light on the user’s eye
 IR 900nm sensor
 Light Detector
 Detects reflected IR light

2.2.12 ELECTRONIC SWITCHES

A relay is an electrically operated switch. Many relays use an electromagnet


to operate a switching mechanism mechanically, but other operating principles
are also used.

47
Solid-state relays control power circuits with no moving parts, instead using
a semiconductor device to perform switching—often a silicon-controlled
rectifier or triac.

2.2.12.1DPST SWITCH(DOUBLE POLE SINGLE THROW SWITCH)

Fig 2.2.13.1 DPST SWITCH

 A pair of on-off switches which operate together (shown by the dotted line
in the circuit symbol).
 A DPST switch is often used to switch mains electricity because it can
isolate both the live and neutral connections.

 Here DPST switches are used to switch between manual and automated
modes for controlling ADG.

CHAPTER -3
TESTING AND RESULTS
The main objective of our project is to control the AIR DEFENSE GUN in
manual and automated mode.

48
Fig 3.1:BASIC BLOCK CONNECTION
 The automated mode deals with controlling the set up by means of
PIC16F877A microcontroller and manually by means of JOYSTICK.
 Both operations can used separately by means of a switch(DUAL POLE
SINGLE THROW)
 The mechanism for both operations are explained here.

49
3.1.1 AUTOMATIC CONTROL OF AIR DEFENSE GUN

 When the switch is in on position, the automatic mode is activated.


 In our projet,the enemy aircraft is represented by means of setup consisting
of RF TX and IR SENSOR.
 When the aircraft enters within the range of RF Receiver it gets detected
and receives 8-bit data from the transmitter RF,which in turn sends the
signals to the PIC16F877A.the IR sensor detects the aircraft only when its
near its surveillance area.
 Now the signals from RF RX and IR sensor are send to the PIC.
 The signal is compared with the prewritten program’s data, if both of the
code matches then the aircraft is considered as friend, and so the PIC orders
the sensors to stop tracking, by means of sending signals via driver to the
motors controlling the movements of ADG (AIR DEFENSE GUN).
 When the PIC confirms the presence of enemy, it sends signal to the sensors
to continue to track the enemy movements via signals through driver
which controls the motors which aids the movements of ADG.In the mean
time the PIC orders the GUN to fire the enemy(In our case LASER acts as a
substitute for AIR DEFENSE GUN) ,Aiming accurately at the enemy
aircraft.
 NOTE:ATT(Automatic Target Tracking) mechanism is employed here.

3.1.2MANUAL MODE CONTROL

50
 The manual mode operation is activated when the switch is in released
position.
 All the activities of the ADG is controlled by JOYSTICK, which is
manually handled by the gunner.
 JOYSTICK is connected to the two motors which controls the movement of
ADG( vertical and horizontal) through relay circuits broads.
 The JOYSTICK is divided into two axis as shown below:

0 X

 Initially the JOYSTICK is at the mid position(rest position) indicated as a


point ‘0’.
 When the JOYSTICK is moved in the +x direction the motor 2 is activated
and rotates in clockwise direction to move the ADG in vertical
direction(up).Similarly when the JOYSTICK is moved in the –x
direction,then the motors controlling ADG moves downwards.
 When the JOYSTICK is adjusted for azimuth movements i.e., y axis of
joystick is used for this purpose, then motors corresponding to this
connection responds and moves the ADG in clockwise direction(left to right

51
direction). When the ADG needs to be moved in other direction
(anticlockwise direction),then the –y axis of JOYSTICK is manhandled to
get the desired positioning of ADG.

 Then the GUN is fired (in our case LASER is used)


While used in real time application, more robust and less wired components
are required with even more sophisticated architecture.

52
CHAPTER -4
CONCLUSION
4.1 CONCLUSION
Thus the bench model of Reflexive Adaptation of Air Defense Gun is
successfully completed and is tested to perfection. Our project protects the gunner
from the possible dangers faced when he is exposed to vulnerable situations in the
battle flied, while handling the Air Defense Gun all by himself. So now with our
project, the gunner could control the Gun in two modes, namely automatic and
manual by just resting inside the turret cabin, there by shielding him as well as
providing accurate tracking and firing of the enemy flying aircraft. Thus making
our project a superlative improvement for present MBT ARJUN TANKS.

4.2 FUTURE ENHANCEMENTS


 WE CAN FIX TWO MORE SENSORS TO TRACK THE MOVEMENT
OF THE AIRCRAFT IN VERTICAL DIRECTION
 Gun can be attached and triggering mechanisms can be employed with the
help of solenoid arrangement.
 This whole structure can be made as a separate structure which can be
controlled by remote away from the battle field
 This separate arrangement can be made to work for rescue mission in battle
fields.
 Gun can be operated in burst and trigger mode.
 Gun can be made to be controlled manually or automatically by
microcontroller
 In real time applications RADAR is used for detection of aircrafts in defense
systems.
 Camera can be installed for monitoring the flying aircraft outside the tank
without exposing himself to the outside threat.

53
 Camera can be interfaced with the computer or a separate monitor for
display purpose.
 Instead of camera a periscope can be fixed within the hull for the gunner to
sight the target in manual mode of operation.
 Instead of IR sensor we can use RADAR in real time application.

54
APPENDICES
A.1 16F877A MICROCONTROLLER CODING
#include<16f877a.h>

#fuses HS,NOWDT, NO PROTECT, NO LVP

#use delay(CLOCK=20000000)

#byte portc=0x07

#byte trisc=0x87

#byte portb=0X06

#byte trisb=0X86

#byte portd=0x08

#byte trisd=0x88

#byte porta = 0x05

#byte trisa = 0x85

#byte trise= 0x89

#byte porte =0x09

#byte ADCON1=0x9F

void lcddata (unsigned char value );

void lcdcmd (unsigned char valu);

int x;

int y;

int v;

55
void main()

ADCON1=0x07;

trisb=0x00;

trise = 0x00;

porte = 0x00;

trisa = 0xff;

trisc = 0x00;

portc=0x80;

trisd = 0xff;

//portd= 0x10;

ADCON1=0x07;

trisc=0x00;

portc=0x00;

bit_clear(porte,2); // to select command register

delay_ms(150);

lcdcmd(0x38); // 2 lines and 5x7 matrix

delay_ms(150);

lcdcmd(0x0E); // display on cursor blinking

delay_ms(15);

lcdcmd(0x01); // clear display

56
delay_ms(15);

//lcdcmd(0x01);

//delay_ms(15);

lcdcmd(0x06); // increment cursor

delay_ms(15);

lcdcmd(0x81); // display first line

delay_ms(15);

lcddata ('R');

delay_ms(15);

lcddata('A');

delay_ms(15);

lcddata ('A');

delay_ms(15);

lcddata ('G');

delay_ms(15);

trisc=0x00;

x=porta;

y=portd;

while(1)

trisc = 0x00;

57
portc=0xF0;

x=porta;

y=portd;

if (x==0x01)

portc = 0xF0;

bit_clear(porte,2); // to select command register

delay_ms(150);

lcdcmd(0x38); // 2 lines and 5x7 matrix

delay_ms(150);

lcdcmd(0x0E); // display on cursor blinking

delay_ms(15);

lcdcmd(0x01); // clear display

delay_ms(15);

//lcdcmd(0x01);

//delay_ms(15);

lcdcmd(0x06); // increment cursor

delay_ms(15);

lcdcmd(0x81); // display first line

delay_ms(15);

lcddata ('F');

58
delay_ms(15);

lcddata('R');

delay_ms(15);

lcddata ('I');

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata ('N');

delay_ms(15);

lcddata ('D');

delay_ms(15);

else if (y==0x04)

bit_clear(porte,2); // to select command register

delay_ms(150);

lcdcmd(0x38); // 2 lines and 5x7 matrix

delay_ms(150);

lcdcmd(0x0E); // display on cursor blinking

delay_ms(15);

lcdcmd(0x01); // clear display

59
delay_ms(15);

//lcdcmd(0x01);

//delay_ms(15);

lcdcmd(0x06); // increment cursor

delay_ms(15);

lcdcmd(0x81); // display first line

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata('N');

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata ('M');

delay_ms(15);

lcddata ('Y');

delay_ms(15);

lcddata ('-');

delay_ms(15);

lcddata ('F');

delay_ms(15);

60
lcddata ('I');

delay_ms(15);

lcddata ('R');

delay_ms(15);

lcddata ('E');

delay_ms(15);

portc=0x01;

delay_ms(40);

portc = 0x00;

delay_ms(60);

else if (y==0x02)

bit_clear(porte,2); // to select command register

delay_ms(150);

lcdcmd(0x38); // 2 lines and 5x7 matrix

delay_ms(150);

lcdcmd(0x0E); // display on cursor blinking

delay_ms(15);

lcdcmd(0x01); // clear display

delay_ms(15);

61
//lcdcmd(0x01);

//delay_ms(15);

lcdcmd(0x06); // increment cursor

delay_ms(15);

lcdcmd(0x81); // display first line

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata('N');

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata ('M');

delay_ms(15);

lcddata ('Y');

delay_ms(15);

lcddata ('-');

delay_ms(15);

lcddata ('F');

delay_ms(15);

lcddata ('I');

62
delay_ms(15);

lcddata ('R');

delay_ms(15);

lcddata ('E');

delay_ms(15);

portc=01;

delay_ms(40);

portc =0x00;

delay_ms(60);

else if (y==0x03)

bit_clear(porte,2); // to select command register

delay_ms(150);

lcdcmd(0x38); // 2 lines and 5x7 matrix

delay_ms(150);

lcdcmd(0x0E); // display on cursor blinking

delay_ms(15);

lcdcmd(0x01); // clear display

delay_ms(15);

//lcdcmd(0x01);

63
//delay_ms(15);

lcdcmd(0x06); // increment cursor

delay_ms(15);

lcdcmd(0x81); // display first line

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata('N');

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata ('M');

delay_ms(15);

lcddata ('Y');

delay_ms(15);

lcddata ('-');

delay_ms(15);

lcddata ('F');

delay_ms(15);

lcddata ('I');

delay_ms(15);

64
lcddata ('R');

delay_ms(15);

lcddata ('E');

delay_ms(15);

portc=01;

delay_ms(40);

portc = 0x00;

delay_ms(60);

else if (y==0x01)

bit_clear(porte,2); // to select command register

delay_ms(150);

lcdcmd(0x38); // 2 lines and 5x7 matrix

delay_ms(150);

lcdcmd(0x0E); // display on cursor blinking

delay_ms(15);

lcdcmd(0x01); // clear display

delay_ms(15);

//lcdcmd(0x01);

//delay_ms(15);

65
lcdcmd(0x06); // increment cursor

delay_ms(15);

lcdcmd(0x81); // display first line

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata('N');

delay_ms(15);

lcddata ('E');

delay_ms(15);

lcddata ('M');

delay_ms(15);

lcddata ('Y');

delay_ms(15);

lcddata ('-');

delay_ms(15);

lcddata ('F');

delay_ms(15);

lcddata ('I');

delay_ms(15);

lcddata ('R');

66
delay_ms(15);

lcddata ('E');

delay_ms(15);

portc=01;

delay_ms(40);

portc=0x00;

delay_ms(60);

portc=0x00;

void lcdcmd(unsigned char valu)

portb = valu;

bit_clear(porte,0);

//bit_clear(porte,1);

bit_set(porte,2);

delay_ms(2);

bit_clear(porte,2);

return;

67
void lcddata(unsigned char value)

portb = value;

bit_set(porte,0);

//bit_clear(porte,1);

bit_set(porte,2); // to select data register

delay_ms(2);

bit_clear(porte,2);

return;

A.2 LCD CODING


#include<16F877a.h>

#fuses HS,NOWDT,NO PROTECT,NOLYP

#use delay(CLOCK=20000000)

#byte port c=0*07

#byte trisc=0*87

#byte port b=0*06

#byte tris b=0*86

#byte port d=0*08

#byte tris d=0*88

#byte port a=0*05

68
#byte tris a=0*85

#byte tris e=0*89

#byte port e=0*09

#byte ADCONI=0*09

void lcddata(unsigned char value);

void ldcmd(unsigned char value);int x;

int y;

int v;

void main()

ADCONI=0*07;

tris b=0*00;

tris e=0*00;

port e=0*00;

tris a=0*ff;

tris c=0*00;

port c=0*80;

tris d=0*ff;

ADCONI=0*07;

tris c=0*00;

port c=0*00;//to select comand reg

69
bit_clear(port e,2);

delay_ms(150);

lcd cmd(0*38);//2 lines and margin

delay_ms(15);

lcd cmd(0*06);//increment cursor

delay_ms(15);

lcdcmd(0*81);//display

delay_ms(15);//frist line

lcd data('R');

delay_ms(15);

lcd data('A');

delay_ms(15);

lcd data('A');

delay_ms(15);

lcad data('G');

delay_ms(15);

void lcdcmd(unsigned char value)

port b=value;

bit_clear(port e,0);

70
bit.set(port e,2);

delay_ms(2);

bit_clear(port e,2);

return;

void lcddata(unsigned char value)

port b=value;

bit_set(port e,0);

bit_set(port e,2);//to slect data register

delay_ms(2);

bit_clear(port e,2);

return;

71
REFERENCES
 Bradley, B.A., et al, Mechatronics: Electronics in products and process,
Champman & hall, London, 1991
 Hute,G.M. and R.D.Chute,Electronics in industry,5th ed.,McGraw-Hill,New
York,1979.
 Dubey, G.K., Fundamentals of electrical drives,Narosa Publishing House,
India,1995.
 Gross,H.,Ed.,Electrical feed drives for machene tools,John wiley
&sons,USA,1993.
 Hunt, V.D., Mechatronics:Japan’s newest threat,chapman & hall,
London,1998.
 Electronics fundamentals and applications., J.D.Ryder,Prentise Hall of
India,1969.
 Communication systems, simon Haykin, Wiley Eastern,1985.
 Transistor Physics and Circuit Design,D.C.Sarkar, S.Chand and co,1985
 Theraja.B.L., A text book of electrical technology, Niraj Construction and
development Co, (P) Ltd., India, 1987

72

Das könnte Ihnen auch gefallen