Вы находитесь на странице: 1из 67

AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

CHAPTER-1

PEC KANPUR Page 1


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

INTRODUCTION

War is an organized armed conflict that is carried out by states, nations, national and social groups. So in
order to enhancing the security level this project is designed. This ultrasonic proximity detector
comprising independent, battery or AC powered transmitter and receiver section make use of a pair of
matched ultrasonic piezo ceramic transducers each operating at around 40 kHz. This circuit is used to get
reflected signals of 40 KHz from the object to feed that to a program to the microcontroller to switch on
appropriate load while the program is executed at the microcontroller end. When the microcontroller
receives the signal from ultrasonic receiver it activates the gun system by triggering the gate of MOSFET
through a transistor. The power supply consists of a step down transformer 230/12V, which steps down
the voltage to 12V AC. Then this is converted to DC using a Bridge rectifier. The ripples are then
removed using a capacitive filter and it is then regulated to +5V using a voltage regulator 7805 which is
required for the operation of the microcontroller and other components.
Transistors are used for amplification of the weak signals received upon reflection from the obstacle, by
the receiving ultrasonic transducer sent by the transmitting one, to switch on appropriate load while the
program is executed at the microcontroller end. This project consist of the ultrasonic transmitter and
receiver each of which works for the frequency of 40 kHz.
At the receiver side the received signal is amplified and given to the microcontroller which is used as to
operate the relay driver (ULN2003) for operating the relay to drive the loads. The power supply consists
of a step down transformer 230/12V AC which is converted to DC using a Bridge rectifier. The ripples
present are removed using a capacitive filter and it is then regulated to +5V using a voltage regulator
7805 which is required for the proper operation of the microcontroller and other components.
Target acquisition and tracking are frequent domains of active sensing methods such as RADAR, Ultra-
sound, or LASER scanning. The ability to track targets at manipulation range can significantly reduce
the cost and complexity of manipulator control. Ultrasonic sensors, in particular, provide an ideal
platform for experimental development in range detection. They are cheap, readily available, and
increasingly possessed of high-resolution sensors. Its various Applications range from robotic security
systems to environments such as production lines.

PEC KANPUR Page 2


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Where, distance measurement and obstacle measurement and manipulation of objects are routine
tasks with potential for wide-scale automation and defense [1].
Here, a robotic platform along with a stepper motor fitted with ultrasonic sensor is used to
automatically locate and aim at a stationary target, moving target at a pre-defined range and
destroying it successfully. Let‘s us, we summarize the project's main advances and indicate
possible directions for future work, thus
1. The main objectives of this project are: Monitoring the moving target.
2. Real time monitoring of target
3. Works in any lighting conditions.
4. Automatic target attacking.
5. Controlling the robot using RF TX and RX

PEC KANPUR Page 3


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

CHAPTER-2

PEC KANPUR Page 4


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

2.1 BLOCK DIAGRAM

RELAY

I\P O\P
A .C.
MOTOR

MICRO
CONTROLLER E.M.
AT89S52 GUN

ULTRASONIC
TRANSMITTER
ULTRASONIC
RECEIVER

Fig-2.1 Block Diagram of automated electromagnetic gun using ultrasonic sensors

PEC KANPUR Page 5


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

2.2 BLOCK DIAGRAM DESCRIPTION

Block diagram of this project consist of following parts-

1. Microcontroller –
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
non-volatile memory technology and is compatible with the industry standard 80C51 instruction
set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or
by a conventional non-volatile memory programmer. 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.

2. Ultrasonic sensors-
In this project ultrasonic sensors are used for detection of the object. For performing this
operation An ultrasonic sensor transmit ultrasonic waves into the air and detects reflected waves
from an object.

Ultrasonic sensing technology is based on the principle that sound has a relatively constant
velocity. The time for an ultrasonic sensor‘s beam to strike the target and return is directly
proportional to the distance to the object. Consequently, ultrasonic sensors are used frequently
for distance measurement applications such as level control.

Ultrasonic sensors are capable of detecting most objects — metal or nonmetal, clear or opaque,
liquid, solid, or granular — that have sufficient acoustic reflectivity. Another advantage of
ultrasonic sensors is that they are less affected by condensing moisture than photoelectric
sensors.

PEC KANPUR Page 6


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

3. Electromagnetic gun-
Electromagnetic gun is used for the purpose of shooting the object. An electromagnetic gun
consists of two parallel metal rails connected to an electrical power supply. When a conductive
projectile is inserted between the rails (at the end connected to the power supply), it completes
the circuit. Electrons flow from the negative terminal of the power supply up the negative rail,
across the projectile, and down the positive rail, back to the power supply. This current makes
the gun behave as an electromagnet. Hence this gun is called as an electromagnetic gun.
4. AC Motor-
AC motor is used for purpose of converting electrical energy in to mechanical energy. It consist
of three parts stator, rotor and enclosure. Where stator and rotor do the work while enclosure
protects stator and rotor.
Electromagnetism is the basic principle behind motor operation.

5. Relay-
A relay is an electrically operated switch. Many relays use an electromagnet to operate a
switching mechanism mechanically, but other operating principles are also used. Relays are used
where it is necessary to control a circuit by a low-power signal (with complete electrical isolation
between control and controlled circuits), or where several circuits must be controlled by one
signal.

PEC KANPUR Page 7


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

CHAPTER-3

PEC KANPUR Page 8


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

3.1 CIRCUIT DAIGRAM

GUN

Fig-3.1 circuit diagram of automated electromagnetic gun using ultrasonic sensors

PEC KANPUR Page 9


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

3.2 CIRCUIT DIAGRAM DESCRIPTION

In the circuit diagram of this automated electromagnetic gun using ultrasonic sensors, the
microcontroller 89S52 which is the heart of this project is connected to 5V power supply which
it gets through voltage regulator IC 7805, which converts 9V DC in to 5V DC. This 5V DC
supply is connected at pin no. 40 of microcontroller AT89S52, while pin no. 20 is connected to
ground. A crystal oscillator is connected at pin no. 18 & 19 of microcontroller. While it receives
an I/P signal from ultrasonic receiver at pin no. 10. Microcontroller provides its O/P to relay
through pin no. 11. Relay which is normally connected to AC motor and normally open to
electromagnetic gun. Relay receives its I/P signal through pin no.11 of the microcontroller.
Upon the basis of signal received through microcontroller it changes its connection from normal
open to normal connect and vice versa. Ultrasonic transmitter section is connected to 9V DC
supply. It consist of a 555 timer IC for its switching purpose. 555 timer IC is connected through
2 transistors one is NPN and another one is PNP transistor. Ultrasonic receiver section operates
on 9V DC supply. It consist of a comparator IC CA3140. Ultrasonic receiver is connected to pin
no. 10 of microcontroller.AC motor is normally connected to relay but in case of detection of
object it is normally open. Electromagnetic gun is normally open to relay but in case an object is
detected it is normally connected.
3.3 WORKING-
The working of this automated electromagnetic gun using ultrasonic sensors starts with
ultrasonic sensors. Out of two ultrasonic sensors one works as a transmitter and another works as
a receiver. Transmitter transmits the signal at the frequency of 40 KHZ as an object is detected it
transmits the signal to the receiver section at 40 KHZ. The transmitter and receiver section make
use of a pair of matched ultrasonic piezo ceramic transducers. As a signal is received by the
receiver section it feeds this reflected signal to the program of the microcontroller .As
microcontroller receives signal from receiving end it sends a signal to relay section. Initially,
relay is normal connected to motor and normal open with electromagnetic gun. But as it receives
a signal from the microcontroller section its connections are reversed i.e. electromagnetic gun is
normally connected with relay and motor is normal open. After that working of electromagnetic
gun comes in to existence and it starts shooting of the detected object. NPN transistors are used
for the amplification of the weak signals received upon reflection from the obstacle.

PEC KANPUR Page 10


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

CHAPTER-4

PEC KANPUR Page 11


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

4.1 HARDWARE REQUIREMENTS-

4.1.1 MICROCONTROLLER-
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
non-volatile memory technology and is compatible with the industry standard 80C51 instruction
set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or
by a conventional non-volatile memory programmer. 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 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 contents but freezes the oscillator, disabling
all other chip functions until the next interrupt or hardware reset [a].
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

PEC KANPUR Page 12


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

• 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
Block Diagram of AT89S52:

FIG-4.1 BLOCK DIAGRAM OF AT89S52

PEC KANPUR Page 13


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Pin Configurations of AT89S52

FIG 4.2: PIN DIAGRAM OF AT89S52

Pin Description:

VCC:
Supply voltage.
GND:
Ground

PEC KANPUR Page 14


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

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).
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 emits the contents of the P2 Special Function Register.
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.

PEC KANPUR Page 15


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The
DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state
of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG:
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG) during
Flash programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and
may be used for external timing or clocking purposes. Note, however, that one ALE pulse is
skipped during each access to external data memory.

PSEN:
Program Store Enable (PSEN) is the read strobe to external program memory. When the
AT89S52 is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to external data
memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH. Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be
strapped to VCC for internal program executions. This pin also receives the 12-volt
programming enable voltage (VPP) during Flash programming.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
Output from the inverting oscillator amplifier

PEC KANPUR Page 16


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6.2. There are no
requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.

FIG- 4.3 Oscillator Connections

FIG- 4.4 External Clock Drive Configuration

Idle Mode
In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active. The
mode is invoked by software. The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode. The idle mode can be terminated by any enabled
interrupt or by a hardware reset.

PEC KANPUR Page 17


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Power down Mode


In the power down mode the oscillator is stopped, and the instruction that invokes power
down is the last instruction executed. The on-chip RAM and Special Function Registers retain
their values until the power down mode is terminated. The only exit from power down is a
hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset
should not be activated before VCC is restored to its normal operating level and must be held
active long enough to allow the oscillator to restart and stabilize [b].

4.1.2 ULTRASONIC SENSORS-


An ultrasonic sensor transmit ultrasonic waves into the air and detects reflected waves from an
object. There are many applications for ultrasonic sensors, such as in intrusion alarm systems,
automatic door openers and backup sensors for automobiles.

Ultrasonic sensors emit a sound pulse that reflects off of objects entering the wave field. The
reflected sound, or ―echo‖ is then received by the sensor. Detection of the sound generates an
output signal for use by an actuator, controller, or computer. The output signal can be analog or
digital.

Ultrasonic sensing technology is based on the principle that sound has a relatively constant
velocity. The time for an ultrasonic sensor‘s beam to strike the target and return is directly
proportional to the distance to the object. Consequently, ultrasonic sensors are used frequently
for distance measurement applications such as level control.
Ultrasonic sensors are capable of detecting most objects — metal or nonmetal, clear or opaque,
liquid, solid, or granular — that have sufficient acoustic reflectivity. Another advantage of
ultrasonic sensors is that they are less affected by condensing moisture than photoelectric
sensors.
A downside to ultrasonic sensors is that sound absorbing materials, such as cloth, soft rubber,
flour and foam, make poor target objects.

PEC KANPUR Page 18


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Ultrasonic Sensor Construction :


There are four basic components of an ultrasonic proximity sensor:
1. Transducer/receiver
2. Comparator
3. Detector circuit
4. Solid-state output
Basic Components :
Transducer/Receiver-

The ultrasonic transducer pulses, sending sound waves outward from the face of the sensor. The
transducer also receives echoes of those waves as reflected off an object.

Comparator and Detector Circuit-

When the sensor receives the reflected echo, the comparator calculates the distance by
comparing the emit-to-receive timeframes to the speed of sound.

Solid-State Output Switching Device-

The solid state output generates an electrical signal to be interpreted by an interface device like a
programmable logic controller (PLC). The signal from digital sensors indicates the presence or
absence of an object in the sensing field. The signal from analog sensors indicates the distance to
an object in the sensing field.

Sensing Frequency-

In general, industrial sensors operate between 25 kHz and 500 kHz. Medical ultrasound units
operate at 5 MHz or more. Sensing frequency is inversely proportional to sensing distance.
While a 50 kHz sound wave may work to 10 m (33 ft) or more, a 200 kHz sound wave is limited
to sensing ranges of about 1 m (3 ft).

PEC KANPUR Page 19


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Sensing Range and Effective Beam-

The sensing range of an ultrasonic sensor is the area between the minimum and the maximum
sensing limits.

Ultrasonic Sensing Distance -

1. Minimum Sensing Distance:

Ultrasonic proximity sensors have a small unusable area near the face of the sensor. If the
ultrasonic beam leaves the sensor, strikes the target, and returns before the sensor has completed
its transmission, the sensor is unable to receive the echo accurately. This unusable area is known
as the blind zone.
The outer edge of the blind zone is the minimum distance an object can be from the sensor
without returning echoes that will be ignored or misread by the sensor.

2. Maximum Sensing Distance :

Target size and material determine the maximum distance at which the sensor is capable of
seeing the object. The harder an object is to detect, the shorter the maximum sensing distance can
be.
Materials that absorb sound — foam, cotton, rubber, etc. — are more difficult to detect than
acoustically reflective materials, like steel, plastic, or glass. If detected at all, these absorbent
materials can limit maximum sensing distance.

Effective Beam :-
When the transducer vibrates, it emits ultrasonic pulses that propagate in a cone-shaped beam.
This cone can be adjusted, usually via potentiometer, to widen or extend the sensing range.
Manufacturers provide guidelines for the sensitivity characteristics of their sensors. Some
experimentation is required to determine the maximum sensing distance in any given application.

PEC KANPUR Page 20


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Background Suppression and Non target Objects :


Some analog models offer a background suppression feature which allows the sensor to ignore
all objects beyond a specified distance. This distance is set by the user at installation by adjusting
a potentiometer or teach button.
Non target objects in the sensing field can be hidden from the sensor by covering them with
sound-absorbent material or by positioning them so that their echoes are reflected away from the
sensor.

Spacing Considerations :
Spacing between sensors is determined by their beam angles. The sensors must be spaced so they
do not interfere with each other. This interference is sometimes called ―crosstalk.‖

Spacing of Ultrasonic Sensors :


When more than one ultrasonic sensor is in use, some experimentation may be needed to
determine optimal spacing for the application. The following values should only be used as a
reference:

Sensor Alignment :
Aim the sensor at the target. Slowly turn the potentiometer until the LED illuminates, indicating
target presence. Adjust the angle of the sensor to maximize the brightness of the LED.
If an analog sensor detects objects behind the desired target, turn the potentiometer to suppress
the background objects, but not so far that the sensor no longer detects the target.
To set the sensing distance of a discrete sensor, adjust the potentiometer until the LED turns off
while the target is not present. Next replace the target, and slowly turn the potentiometer until the
LED turns back on.

. Not appropriate for transmitted beam style ultrasonic sensors.


. Applicable to certain ultrasonic models utilizing potentiometers.

PEC KANPUR Page 21


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Target Considerations :-
Generally, ultrasonic proximity sensors are affected less by target surface characteristics than are
diffuse mode photo electrics; however, they require the transducer face be within 3° of parallel to
smooth, flat target objects. Smooth flat targets require precise sensor alignment
When sensing the sound-scattering surfaces of irregularly shaped targets, the approach angle
becomes less critical. Irregular targets require less precision
The surface temperature of a target can also influence the sensing range. Radiated heat from high
temperature targets distorts the sound beam, leading to shortened sensing range and inaccurate
readings. Target temperature affects sensing capabilities

Target Size :-
The smaller the target the more difficult to detect.
Target-to-Sensor Distance :-
The further a target is away from the sensor, the longer it takes the sensor to receive the echo.
Target to sensor distance
Environmental Considerations :-

Ambient Noise
Ultrasonic sensors have noise suppression circuitry that allows them to function reliably in noisy
environments.

Air Pressure :
Normal atmospheric pressure changes have little effect on measurement accuracy; however,
ultrasonic sensors are not intended for use in high or low air pressure environments as pressure
extremes may physically damage the transducer or the sensor face.

Air Temperature :
The velocity of sound in air is temperature dependent. An increase in temperature causes a
slowing of the speed of sound and, therefore, increases the sensing distance.

PEC KANPUR Page 22


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Air Turbulence :
Air currents, turbulence and layers of different densities cause refraction of the sound wave. An
echo may be weakened or diverted to the extent that it is not received at all. Sensing range,
accuracy, and stability can deteriorate under these conditions.
Protective Measures :
In wet applications, the sensor should not be mounted in such a way that standing water or other
fluids can rest on the sensing face. In general, to maintain operating efficiency, care must be
taken to prevent solid or liquid deposits from forming on the sensor face.
The sensor‘s face can also be vulnerable to aggressive acid or alkaline atmospheres [3].

Ultrasonic Advantages -
1. An ultrasonic sensor‘s response is not dependent upon the surface color or optical
reflectivity of the object. For example, the sensing of a clear glass plate, a brown pottery plate, a
white plastic plate, and a shiny aluminum plate is the same.
2. Ultrasonic sensors with digital (ON/OFF) outputs have excellent repeat sensing accuracy.
It is possible to ignore immediate background objects, even at long sensing distances because
switching hysteresis is relatively low.
3. The response of analog ultrasonic sensors is linear with distance. By interfacing the
sensor to an LED display, it is possible to have a visual indication of target distance. This makes
ultrasonic sensors ideal for level monitoring or linear motion monitoring applications.

Ultrasonic Disadvantages-
1. Ultrasonic sensors must view a surface (especially a hard, flat surface) squarely
(perpendicularly) to receive ample sound echo. Also, reliable sensing requires a minimum target
surface area, which is specified for each sensor type.
2. While ultrasonic exhibit good immunity to background noise, these sensors are still likely to
falsely respond to some loud noises, like the ―hissing‖ sound produced by air hoses and relief
valves.
3. Proximity style ultrasonic sensors require time for the transducer to stop ringing after each
transmission burst before they are ready to receive returned echoes. As a result, sensor response
times are typically slower than other technologies at about 0.1 second. This is generally not a
disadvantage in most level sensing and distance measurement applications. Extended response
times are even advantageous in some applications. Transmitted beam style ultrasonic sensors are
much faster with response times on the order of 0.002 or 0.003 seconds.
4. Ultrasonic sensors have a minimum sensing distance.

PEC KANPUR Page 23


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

5. Changes in the environment, such as temperature, pressure, humidity, air turbulence, and
airborne particles affect ultrasonic response.
6. Targets of low density, like foam and cloth, tend to absorb sound energy; these materials may
be difficult to sense at long range.
7. Smooth surfaces reflect sound energy more efficiently than rough surfaces; however, the
sensing angle to a smooth surface is generally more critical than to a rough surface.

4.1.3 ELECTROMAGNETIC GUN-


An electromagnetic gun is an electromagnetic projectile launcher based on similar principles to
the homo polar motor. An electromagnetic gun uses a pair of parallel conductors, or rails, along
which a sliding armature is accelerated by the electromagnetic effects of a current that flows
down one rail, into the armature and then back along the other rail.
Electromagnetic guns are being researched as a weapon that would use neither explosives nor
propellant, but rather rely on electromagnetic forces to achieve a very high kinetic energy of a
projectile.
Electromagnetic gun uses electromagnetic force (Lorentz force) to propel an electrically
conductive projectile that is initially part of a chain. Current flowing through the rails , generates
magnetic field in the rails and armature. As a result, under the action of force , the armature is
pushed out of the magnetic field of the rails and the projectile accelerates.

DESIGN-An electromagnetic gun consists of two parallel metal rails connected to an electrical
power supply. When a conductive projectile is inserted between the rails (at the end connected to
the power supply), it completes the circuit. Electrons flow from the negative terminal of the
power supply up the negative rail, across the projectile, and down the positive rail, back to the
power supply.

This current makes the electromagnetic gun behave as an electromagnet, creating a magnetic
field inside the loop formed by the length of the rails up to the position of the armature. In
accordance with the right-hand rule, the magnetic field circulates around each conductor. Since
the current is in the opposite direction along each rail, the net magnetic field between the rails
(B) is directed at right angles to the plane formed by the central axes of the rails and the

PEC KANPUR Page 24


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

armature. In combination with the current (I) in the armature, this produces a Lorentz force
which accelerates the projectile along the rails, away from the power supply. There are also

Fig-4.5 magnetic field effect of electromagnetic gun

Lorentz forces acting on the rails and attempting to push them apart, but since the rails are
mounted firmly, they cannot move [4].

Materials used-

The rails and projectiles must be built from strong conductive materials; the rails need to survive
the violence of an accelerating projectile, and heating due to the large currents and friction
involved. Some erroneous work has suggested that the recoil force in electromagnetic guns can
be redirected or eliminated; careful theoretical and experimental analysis reveals that the recoil
force acts on the breech closure just as in a chemical firearm. The rails also repel themselves via
a sideways force caused by the rails being pushed by the magnetic field, just as the projectile is.
The rails need to survive this without bending and must be very securely mounted. Currently
published material suggests that major advances in material science must be made before rails
can be developed that allow electromagnetic guns to fire more than a few full-power shots before
replacement of the rails is required.

Applications-

Electromagnetic guns have a number of potential practical applications, primarily for the
military. However, there are other theoretical applications currently being researched.

PEC KANPUR Page 25


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

4.1.4 AC MOTOR-

AC motors are used worldwide in many applications to transform electrical energy into
mechanical energy. There are many types of AC motors, but three phase induction motor is the
most common type of motor used in industrial applications.

Construction:
Three-phase AC induction motors are commonly used in industrial applications. This type of
motor has three main parts rotor, stator and enclosure. The stator and rotor do the work and the
enclosure protects the stator and rotor.

Stator Core –

The stator is the stationary part of the motor‘s electromagnetic circuit. The stator core is made up
of many thin metal sheets, called laminations. Laminations are used to reduce energy loses that
would result if a solid core were used.

Stator Windings Stator laminations are stacked together forming a hollow cylinder. Coils of
insulated wire are inserted into slots of the stator core.

When the assembled motor is in operation, the stator windings are connected directly to the
power source. Each grouping of coils, together with the steel core it surrounds, becomes an
Electro magnet when current is applied. Electromagnetism is the basic principle behind motor
operation.

Fig- 4.6 A.c. motor

PEC KANPUR Page 26


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Rotor Construction-

The rotor is the rotating part of the motor‘s electromagnetic circuit. The most common type of
rotor used in a three-phase induction motor is a squirrel cage rotor. The squirrel cage rotor is so
called because its construction is reminiscent of the rotating exercise wheels found in some pet
cages. A squirrel cage rotor core is made by stacking thin steel laminations to form a cylinder.

Rather than using coils of wire as conductors, conductor bars are die cast into the slots evenly
spaced around the cylinder. Most squirrel cage rotors are made by die casting aluminum to form
the conductor bars.

Enclosure

The enclosure consists of a frame (or yoke) and two end brackets (or bearing housings). The
stator is mounted inside the frame. The rotor fits inside the stator with a slight air gap separating
it from the stator. There is no direct physical connection between the rotor and the stator.

The enclosure protects the internal parts of the motor from water and other environmental
elements. The degree of protection depends upon the type of enclosure. Enclosure types are
discussed later in this course.

Bearings, mounted on the shaft, support the rotor and allow it to turn.

Magnetism-

The principles of magnetism play an important role in the operation of an AC motor. Therefore,
in order to understand motors, we must understand magnets. To begin with, all magnets have two
characteristics. They attract iron and steel objects, and they interact with other magnets.

Electromagnetism-

When current flows through a conductor, it produces a magnetic field around the conductor. The
strength of the magnetic field is proportional to the amount of current.

PEC KANPUR Page 27


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Electromagnet-

An electromagnet can be made by winding a conductor into a coil and applying a DC voltage.
The lines of flux, formed by current flow through the conductor, combine to produce a larger and
stronger magnetic field. The center of the coil is known as the core. This simple electromagnet
has an air core.

Developing Rotating Magnetic Field-


The principles of electromagnetism explain the shaft rotation of an AC motor. Recall that the
stator of an AC motor is a hollow cylinder in which coils of insulated wire are inserted.
Rotor Rotation-
Permanent magnet to see how a rotor works, a magnet mounted on a shaft can be substituted for
the squirrel cage rotor. When the stator windings are energized, a rotating magnetic field is
established.
The magnet has its own magnetic field that interacts with the rotating magnetic field of the
stator. The north pole of the rotating magnetic field attracts the south pole of the magnet, and the
south pole of the rotating magnetic field attracts the north pole of the magnet. As the magnetic
field rotates, it pulls the magnet along. AC motors that use a permanent magnet for a rotor are
referred to as permanent magnet synchronous motors. The term synchronous means that the
rotors rotation is synchronized with the magnetic field , and the rotor‘s speed is the same as the
motor‘s synchronous speed.
Induced Voltage Instead of a permanent magnet rotor, a squirrel cage induction. Electromagnet
motor induces a current in its rotor, creating an electromagnet. When current is flowing in
a stator winding, the electromagnetic field created cuts across the nearest rotor bars.

When a conductor, such as a rotor bar, passes through a magnetic field, a voltage (emf) is
induced in the conductor. The induced voltage causes current flow in the conductor. In a squirrel
cage rotor, current flows through the rotor bars and around the end ring and produces a magnetic
field around each rotor bar. Because the stator windings are connected to an AC source, the
current induced in the rotor bars continuously changes and the squirrel cage rotor becomes an
electromagnet with alternating north and south poles. The following illustration shows an instant
when winding A1 is a north pole and its field strength is increasing. The expanding field cuts

PEC KANPUR Page 28


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

across an adjacent rotor bar, inducing a voltage. The resultant current flow in one rotor bar
produces a south pole. This causes the motor to rotate towards the A1 winding. At any given
point in time, the magnetic fields for the stator windings are exerting forces of attraction and
repulsion against the various rotor bars. This causes the rotor to rotate, but not exactly at the
motor‘s synchronous speed.

Slip For a three-phase AC induction motor, the rotating magnetic field must rotate faster than the
rotor to induce current in the rotor . When power is first applied to the motor with the rotor
stopped, this difference in speed is at its maximum and a large amount of current is induced in
the rotor. After the motor has been running long enough to get up to operating speed, the
difference between the synchronous speed of the rotating magnetic field and the rotor speed is
much smaller. This speed difference is called slip. Slip is necessary to produce torque. Slip is
also dependent on load. An increase in load causes the rotor to slow down, increasing slip. A
decrease in load causes the rotor to speed up, decreasing slip . Slip is expressed as a percentage
[5].

4.1.5 555 TIMER IC


Description
IC 555 timer is a well-known component in the electronic circles but what is not known to most
of the people is the internal circuitry of the IC and the function of various pins present there in
the IC. Let me tell you a fact about why 555 timer is called so, the timer got its name from the
three 5 kilo-ohm resistor in series employed in the internal circuit of the IC.
IC 555 timer is a one of the most widely used IC in electronics and is used in various electronic
circuits for its robust and stable properties. It works as square-wave form generator with duty
cycle varying from 50% to 100%, Oscillator and can also provide time delay in circuits. The 555
timer got its name from the three 5k ohm resistor connected in a voltage-divider pattern which is
shown in the figure below. A simplified diagram of the internal circuit is given below for better
understanding as the full internal circuit consists of over more than 16 resistors, 20 transistors, 2
diodes, a flip-flop and many other circuit components.

PEC KANPUR Page 29


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

The 555 timer comes as 8 pin DIP (Dual In-line Package) device. There is also a 556 dual
version of 555 timer which consists of two complete 555 timers in 14 DIP and a 558 quadruple
timer which is consisting of four 555 timer in one IC and is available as a 16 pin DIP in the
market.

FIG- 4.7 PIN DIAGRAM OF NE555

FIG- 4.8 INTERNAL DIAGRAM OF NE555

PEC KANPUR Page 30


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Basics Concepts:

Comparator: The Comparator are the basic electronic component which compares the two input
voltages i.e. between the inverting (-) and the non-inverting (+) input and if the non-inverting
input is more than the inverting input then the output of the comparator is high. Also the input
resistance of an ideal comparator is infinite.

Voltage Divider: As we know that the input resistance of the comparators is infinite hence the
input voltage is divided equally between the three resistors. The value being Vin/3 across each
resistor.

Flip/Flop: Flip/Flop is a memory element of Digital-electronics. The output (Q) of the flip/flop
is ‗high‘ if the input at ‗S‘ terminal is ‗high‘ and ‗R‘ is at ‗Low‘ and the output (Q) is ‗low‘ when
the input at ‗S‘ is ‗low‘ and at ‗R‘ is high [6].

Function of different Pins:-

1. Ground: This pin is used to provide a zero voltage rail to the Integrated circuit to divide
the supply potential between the three resistors shown in the diagram.

2. Trigger: As we can see that the voltage at the non-inverting end of the comparator is Vin/3,
so if the trigger input is used to set the output of the F/F to ‗high‘ state by applying a voltage
equal to or less than Vin/3 or any negative pulse, as the voltage at the non-inverting end of the
comparator is Vin/3.

3. Output: It is the output pin of the IC, connected to the Q‘ (Q-bar) of the F/F with an
inverter in between as show in the figure4.8.

4. Reset: This pin is used to reset the output of the F/F regardless of the initial condition of
the F/F and also it is an active low Pin so it connected to ‗high‘ state to avoid any noise
interference, unless a reset operation is required. So most of the time it is connected to the
Supply voltage as shown in the figure4.8.

PEC KANPUR Page 31


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

5. Control Voltage: As we can see that the pin 5 is connected to the inverting input having a
voltage level of (2/3) Vin. It is used to override the inverting voltage to change the width of the
output signal irrespective of the RC timing network.

6. Threshold: The pin is connected to the non-inverting input of the first comparator. The
output of the comparator will be high when the threshold voltage will be more than (2/3) Vin thus
resetting the output (Q) of the F/F from ‗high‘ to ‗low‘.

7. Discharge: This pin is used to discharge the timing capacitors (capacitors involved in the
external circuit to make the IC behave as a square wave generator) to ground when the output of
Pin 3 is switched to ‗low‘.

8. Supply: This pin is used to provide the IC with the supply voltage for the functioning and
carrying of the different operations to be fulfilled with the 555 timer.

Uses:-

The IC 55 timer is used in many circuits, for example One-shot pulse generator in Monostable
mode as an Oscillator in Astable Mode or in Bi-stable mode to produce a flip/flop type action. It
is also used in many types of other circuit for achievement of various purposes for instance Pulse
Amplitude Modulation (PAM), Pulse Width Modulation (PWM) etc.

4.1.6 CA 3140 COMPARATOR IC-


The CA3140 are integrated circuit operational amplifiers that combine the advantages of high
voltage PMOS transistors with high voltage bipolar transistors on a single chip monolithic chip.
The CA3140 BIMOS operational amplifiers feature gate protected MOSFET (PMOS) transistors
in the input circuit to provide very high input impedance, very low input current and high speed
performance. The CA3140 operate at supply voltage from 4V to 36V (either single or dual
supply).These operational amplifiers are internally phase compensated to achieve stable
operation in unity gain follower operation, and additionally, have access terminal for a
supplementary external capacitor if additional frequency roll-off is desired. Terminals are also
provided for use in applications requiring input offset voltage nulling. The use of PMOS field
effect transistors in the input stage results in common mode input voltage capability down to

PEC KANPUR Page 32


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

0.5V below the negative supply terminal, an important attribute for single supply applications.
The output stage uses bipolar transistors and includes built-in protection against damage from
load terminal short circuiting to either supply rail or to ground [6].

Features

 MOSFET Input Stage


 Very High Input Impedance (ZIN) -1.5TΩ (Typ)
 Very Low Input Current (Il) -10pA (Typ) at ±15V
 Wide Common Mode Input Voltage Range (VlCR) - Can be Swung 0.5V Below
Negative Supply Voltage Rail
 Output Swing Complements Input Common Mode Range
 Directly Replaces Industry Type 741 in Most Applications
 Pb-Free Plus Anneal Available (RoHS Compliant)

Fig- 4.9 pin diagram of CA3140

Applications

 Ground-Referenced Single Supply Amplifiers in Automobile and Portable


Instrumentation
 Sample and Hold Amplifiers
 Long Duration Timers/Multivibrators(μseconds-Minutes-Hours)

PEC KANPUR Page 33


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

 Photocurrent Instrumentation
 Peak Detectors
 Active Filters
 Comparators
 Interface in 5V TTL Systems and Other Low Supply Voltage Systems
 All Standard Operational Amplifier Applications
 Function Generators
 Tone Controls
 Power Supplies
 Portable Instruments
 Intrusion Alarm Systems

4.1.7 VOLTAGE REGULATOR 7805-


Features
 Output Current up to 1A.
 Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.
 Thermal Overload Protection.
 Output Transistor Safe Operating Area Protection
 Short Circuit Protection.

FIG- 4.10 Voltage Regulator 7805

PEC KANPUR Page 34


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

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

FIG- 4.11 Internal Block Diagram of 7805

4.1.8 RELAY-
A relay is an electrically operated switch. Many relays use an electromagnet to operate a
switching mechanism mechanically, but other operating principles are also used. Relays are used
where it is necessary to control a circuit by a low-power signal (with complete electrical isolation
between control and controlled circuits), or where several circuits must be controlled by one
signal.

PEC KANPUR Page 35


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

FIG- 4.12 RELAY

A relay is an electrically operated switch. Current flowing through the coil of the relay creates a
magnetic field which attracts a lever and changes the switch contacts. The coil current can be on
or off so relays have two switch positions and most have double throw (changeover) switch
contacts as shown in the diagram.

Fig- 4.13 Relay showing coil and switch contacts

Relays allow one circuit to switch a second circuit which can be completely separate from the
first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains
circuit. There is no electrical connection inside the relay between the two circuits; the link is
magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can be
as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips) cannot
provide this current and a transistor is usually used to amplify the small IC current to the larger

PEC KANPUR Page 36


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

value required for the relay coil. The maximum output current for the popular 555 timer IC is
200mA so these devices can supply relay coils directly without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of switch contacts, for
example relays with 4 sets of changeover contacts are readily available. For further information
about switch contacts and the terms used to describe them please see the page on switches.
Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay.
The supplier's catalogue should show you the relay's connections. The coil will be obvious and it
may be connected either way round. Relay coils produce brief high voltage 'spikes' when they
are switched off and this can destroy transistors and ICs in the circuit. To prevent damage you
must connect a protection diode across the relay coil[7].

The figure shows a relay with its coil and switch contacts. You can see a lever on the left
being attracted by magnetism when the coil is switched on. This lever moves the switch contacts.

FIG- 4.14 Transistor as a relay deriver

PEC KANPUR Page 37


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

There is one set of contacts (SPDT) in the foreground and another behind them, making the relay
DPDT.
The relay's switch connections are usually labelled COM, NC and NO:
 COM = Common, always connect to this; it is the moving part of the switch.

 NC = Normally Closed, COM is connected to this when the relay coil is off.

 NO = Normally Open, COM is connected to this when the relay coil is on.

Applications of relays

Relays are used to and for:

 Control a high-voltage circuit with a low-voltage signal, as in some types of modems or


audio amplifiers.

 Control a high-current circuit with a low-current signal, as in the starter solenoid of an


automobile.

 Detect and isolate faults on transmission and distribution lines by opening and closing
circuit breakers.

 Time delay functions. Relays can be modified to delay opening or delay closing a set of
contacts. A very short (a fraction of a second) delay would use a copper disk between the
armature and moving blade assembly. Current flowing in the disk maintains magnetic
field for a short time, lengthening release time. For a slightly longer (up to a minute)
delay, a dashpot is used. A dashpot is a piston filled with fluid that is allowed to escape
slowly. The time period can be varied by increasing or decreasing the flow rate. For longer
time periods, a mechanical clockwork timer is installed.

PEC KANPUR Page 38


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

4.1.9 CAPACITOR-
A capacitor or condenser is a passive electronic component consisting of a pair of conductors
separated by a dielectric. When a voltage potential difference exists between the conductors, an
electric field is present in the dielectric. This field stores energy and produces a mechanical force
between the plates. The effect is greatest between wide, flat, parallel, narrowly separated
conductors.
An ideal capacitor is characterized by a single constant value, capacitance, which is measured
in farads. This is the ratio of the electric charge on each conductor to the potential difference
between them. In practice, the dielectric between the plates passes a small amount of leakage
current. The conductors and leads introduce an equivalent series resistance and the dielectric has
an electric field strength limit resulting in a breakdown voltage.
The properties of capacitors in a circuit may determine the resonant frequency and quality factor
of a resonant circuit, power dissipation and operating frequency in a digital logic circuit, energy
capacity in a high-power system, and many other important aspects.

Fig- 4.15 capacitors


A capacitor (formerly known as condenser) is a device for storing electric charge. The forms of
practical capacitors vary widely, but all contain at least two conductors separated by a non-
conductor. Capacitors used as parts of electrical systems, for example, consist of metal foils
separated by a layer of insulating film.
Capacitors are widely used in electronic circuits for blocking direct current while allowing
alternating current to pass, in filter networks, for smoothing the output of power supplies, in the
resonant circuits that tune radios to particular frequencies and for many other purposes.

PEC KANPUR Page 39


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

A capacitor is a passive electronic component consisting of a pair of conductors separated by a


dielectric (insulator). When there is a potential difference (voltage) across the conductors, a static
electric field develops in the dielectric that stores energy and produces a mechanical force
between the conductors. An ideal capacitor is characterized by a single constant value,
capacitance, measured in farads. This is the ratio of the electric charge on each conductor to the
potential difference between them.
The capacitance is greatest when there is a narrow separation between large areas of conductor,
hence capacitor conductors are often called "plates", referring to an early means of construction.
In practice the dielectric between the plates passes a small amount of leakage current and also
has an electric field strength limit, resulting in a breakdown voltage, while the conductors and
leads introduce an undesired inductance and resistance.

Theory of operation
Capacitance

Fig-4.16 operation of parallel plate capacitor


Charge separation in a parallel-plate capacitor causes an internal electric field. A dielectric
(orange) reduces the field and increases the capacitance.

Fig- 4.17 A simple demonstration of a parallel-plate capacitor

PEC KANPUR Page 40


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

A capacitor consists of two conductors separated by a non-conductive region. The non-


conductive region is called the dielectric or sometimes the dielectric medium. In simpler terms,
the dielectric is just an electrical insulator. Examples of dielectric mediums are glass, air, paper,
vacuum, and even a semiconductor depletion region chemically identical to the conductors. A
capacitor is assumed to be self-contained and isolated, with no net electric charge and no
influence from any external electric field. The conductors thus hold equal and opposite charges
on their facing surfaces, and the dielectric develops an electric field. In SI units, a capacitance of
one farad means that one coulomb of charge on each conductor causes a voltage of one volt
across the device.
The capacitor is a reasonably general model for electric fields within electric circuits. An ideal
capacitor is wholly characterized by a constant capacitance C, defined as the ratio of charge ±Q
on each conductor to the voltage V between them:

Sometimes charge build-up affects the capacitor mechanically, causing its capacitance to vary. In
this case, capacitance is defined in terms of incremental changes:

Energy storage
Work must be done by an external influence to "move" charge between the conductors in a
capacitor. When the external influence is removed the charge separation persists in the electric
field and energy is stored to be released when the charge is allowed to return to its equilibrium
position. The work done in establishing the electric field, and hence the amount of energy stored,
is given by:

Current-voltage relation
The current i(t) through any component in an electric circuit is defined as the rate of flow of a
charge q(t) passing through it, but actual charges, electrons, cannot pass through the dielectric
layer of a capacitor, rather an electron accumulates on the negative plate for each one that leaves
the positive plate, resulting in an electron depletion and consequent positive charge on one

PEC KANPUR Page 41


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

electrode that is equal and opposite to the accumulated negative charge on the other. Thus the
charge on the electrodes is equal to the integral of the current as well as proportional to the
voltage as discussed above. As with any antiderivative, a constant of integration is added to
represent the initial voltage v (t0). This is the integral form of the capacitor equation,

.
Taking the derivative of this, and multiplying by C, yields the derivative form,

.
The dual of the capacitor is the inductor, which stores energy in the magnetic field rather than the
electric field. Its current-voltage relation is obtained by exchanging current and voltage in the
capacitor equations and replacing C with the inductance L[7].
POLY CAPACITOR-

Film capacitors, plastic film capacitors, film dielectric capacitors, or polymer film capacitors,
generically called ―film caps‖ as well as power film capacitors, are electrical capacitors with an
insulating plastic film as the dielectric, sometimes combined with paper as carrier of the
electrodes. The dielectric films, depending on the desired dielectric strength, are drawn in a
special process to an extremely thin thickness, and are then provided with electrodes. The
electrodes of film capacitors may be metallized aluminum or zinc applied directly to the surface
of the plastic film, or a separate metallic foil overlying the film. Two of these conductive layers
are wound into a cylinder shaped winding, usually flattened to reduce mounting space
requirements on a printed circuit board, or layered as multiple single layers stacked together, to
form a capacitor body. Film capacitors, together with ceramic capacitors and electrolytic
capacitors, are the most common capacitor types for use in electronic equipment, and are used in
many AC and DC microelectronics and electronics circuits.

A related component type is the power (film) capacitor. Although the materials and construction
techniques used for large power film capacitors are very similar to those used for ordinary film
capacitors, capacitors with high to very high power ratings for applications in power systems and
electrical installations are often classified separately, for historical reasons. As modern electronic
equipment gained the capacity to handle power levels that were previously the exclusive domain

PEC KANPUR Page 42


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

of "electrical power" components, the distinction between the "electronic" and "electrical" power
ratings has become less distinct. In the past, the boundary between these two families was
approximately at a reactive power of 200 volt-amperes, but modern power electronics can handle
increasing amounts of power.

Film capacitors are made out of two pieces of plastic film covered with metallic electrodes,
wound into a cylindrical shaped winding, with terminals attached, and then encapsulated. In
general, film capacitors are not polarized, so the two terminals are interchangeable. There are
two different types of plastic film capacitors, made with two different electrode configurations:

Film/foil capacitors or metal foil capacitors are made with two plastic films as the dielectric.
Each is layered with a thin metal foil, usually aluminum, as the electrodes. Advantages of this
construction type are easy electrical connection to the metal foil electrodes, and its ability to
handle high current surges.

Fig- 4.18 poly capacitor

Metallized film capacitors are made of two metallized films with plastic film as the dielectric. A
very thin (~ 0.03 µm[2]) vacuum-deposited aluminum metallization is applied to one or both
sides to serve as electrodes. This configuration can have "self-healing" properties, in that
dielectric breakdowns or short circuits between the electrodes do not necessarily lead to the
destruction of the component. With this basic design, it is possible to make high quality products
such as "zero defect" capacitors and to produce wound capacitors with larger capacitance values
(up to 100 µF and larger) in smaller cases (high volumetric efficiency) compared to film/foil
construction. However, a disadvantage of metallized construction is its limited current surge
rating.
A key advantage of modern film capacitor internal construction is direct contact to the electrodes

PEC KANPUR Page 43


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

on both ends of the winding. This contact keeps all current paths to the entire electrode very
short. The setup behaves like a large number of individual capacitors connected in parallel, thus
reducing the internal ohmic losses (ESR) and the parasitic inductance (ESL). The inherent
geometry of film capacitor structure results in very low ohmic losses and a very low parasitic
inductance, which makes them especially suitable for applications with very high surge currents
(snubbers) and for AC power applications, or for applications at higher frequencies.

Another feature of film capacitors is the possibility of choosing different film materials for the
dielectric layer to select for desirable electrical characteristics, such as stability, wide
temperature range, or ability to withstand very high voltages. Polypropylene film capacitors are
specified because of their low electrical losses and their nearly linear behavior over a very wide
frequency range, for stability Class 1 applications in resonant circuits, comparable only with
ceramic capacitors. For simple high frequency filter circuits, polyester capacitors offer low-cost
solutions with excellent long-term stability, allowing replacement of more expensive tantalum
electrolytic capacitors. The film/foil variants of plastic film capacitors are especially capable of
handling high and very high current surges.

Typical capacitance values of smaller film capacitors used in electronics start around 100 pf and
extend upwards to microfarads.

Unique mechanical properties of plastic and paper films in some special configurations allow
them to be used in capacitors of very large dimensions. The larger film capacitors are used as
power capacitors in electrical power installations and plants, capable of withstanding very high
power or very high applied voltages. The dielectric strength of these capacitors can reach into the
four-digit voltage range [7].

4.1.10 NPN TRANSISTOR BC 548-

The name is transistor derived from ‗transfer resistors‘ indicating a solid state Semiconductor
device. In addition to conductor and insulators, there is a third class of material that exhibits
proportion of both. Under some conditions, it acts as an insulator, and under other conditions it‘s
a conductor. This phenomenon is called Semi-conducting and allows a variable control over
electron flow. So, the transistor is semiconductor device used in electronics for amplitude.

PEC KANPUR Page 44


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Transistor has three terminals, one is the collector, one is the base and other is the emitter, (each
lead must be connected in the circuit correctly and only then the transistor will function).
Electrons are emitted via one terminal and collected on another terminal, while the third terminal
acts as a control element. Each transistor has a number marked on its body. Every number has its
own specifications.

There are mainly two types of transistor (i) NPN & (ii) PNP

NPN Transistors:
When a positive voltage is applied to the base, the transistor begins to conduct by allowing
current to flow through the collector to emitter circuit. The relatively small current flowing
through the base circuit causes a much greater current to pass through the emitter / collector
circuit. The phenomenon is called current gain and it is measure in beta.

PNP Transistor:
It also does exactly same thing as above except that it has a negative voltage on its collector and
a positive voltage on its emitter.

Fig-4.19 Transistors

Transistor is a combination of semi-conductor elements allowing a controlled current


flow. Germanium and Silicon is the two semi-conductor elements used for making it. There are
two types of transistors such as POINT CONTACT and JUNCTION TRANSISTORS. Point

PEC KANPUR Page 45


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

contact construction is defective so is now out of use. Junction triode transistors are in many
respects analogous to triode electron tube.
A junction transistor can function as an amplifier or oscillator as can a triode tube, but has the
additional advantage of long life, small size, ruggedness and absence of cathode heating power.
Junction transistors are of two types which can be obtained while manufacturing.
The two types are: -
1) PNP TYPE: This is formed by joining a layer of P type of germanium to an N-P Junction.

P N P

Fig- 4.20 PNP Transistor


2) NPN TYPE: This is formed by joining a layer of N type germanium to a P-N Junction.

N P N

Fig- 4.21 NPN Transistor


Both types are shown in figure, with their symbols for representation. The centre section
is called the base, one of the outside sections-the emitter and the other outside section-the
collector. The direction of the arrowhead gives the direction of the conventional current with the
forward bias on the emitter. The conventional flow is opposite in direction to the electron flow.

PEC KANPUR Page 46


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

OPERATION OF PNP TRANSISTOR:-

A PNP transistor is made by sand witching two PN germanium or silicon diodes, placed back to
back. The centre of N-type portion is extremely thin in comparison to P region. The P region of
the left is connected to the positive terminal and N-region to the negative terminal i.e. PN is
biased in the forward direction while P region of right is biased negatively i.e. in the reverse
direction as shown in Fig. The P region in the forward biased circuit is called the emitter and P
region on the right, biased negatively is called collector. The centre is called base.

Fig-4.22 Transistor Operation

The majority carriers (holes) of P region (known as emitter) move to N region as they are
repelled by the positive terminal of battery while the electrons of N region are attracted by the
positive terminal. The holes overcome the barrier and cross the emitter junction into N region.
As the width of base region is extremely thin, two to five percent of holes recombine with the
free electrons of N-region which result in a small base current while the remaining holes (95% to
98%) reach the collector junction. The collector is biased negatively and the negative collector
voltage aids in sweeping the hole into collector region.
As the P region at the right is biased negatively, a very small current should flow but the
following facts are observed:-

1) A substantial current flows through it when the emitter junction is biased in a forward
direction.
2) The current flowing across the collector is slightly less than that of the emitter.

PEC KANPUR Page 47


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

3) The collector current is a function of emitter current i.e. with the decrease or increase
in the emitter current a corresponding change in the collector current is observed.

The facts can be explained as follows:-

1.As already discussed that 2 to 5% of the holes are lost in recombination with the electron n
base region, which result in a small base current and hence the collector current is slightly less
than the emitter current.

2. The collector current increases as the holes reaching the collector junction are attracted by
negative potential applied to the collector.

3. When the emitter current increases, most holes are injected into the base region, which is
attracted by the negative potential of the collector and hence results in increasing the collector
current. In this way emitter is analogous to the control of plate current by small grid voltage in a
vacuum triode.

Hence we can say that when the emitter is forward biased and collector is negatively biased, a
substantial current flows in both the circuits. Since a small emitter voltage of about 0.1 to 0.5
volts permits the flow of an appreciable emitter current the input power is very small. The
collector voltage can be as high as 45 volts[7].

3.1.7 IN4007-
Diodes are used to convert AC into DC these are used as half wave rectifier or full wave
rectifier. Three points must he kept in mind while using any type of diode.

1.Maximum forward current capacity


2.Maximum reverse voltage capacity
3.Maximum forward voltage capacity

PEC KANPUR Page 48


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Fig- 4.23 1N4007 diodes


The number and voltage capacity of some of the important diodes available in the market
are as follows:
 Diodes of number IN4001, IN4002, IN4003, IN4004, IN4005, IN4006 and IN4007 have
maximum reverse bias voltage capacity of 50V and maximum forward current capacity of 1
Amp.
 Diode of same capacities can be used in place of one another. Besides this diode of more
capacity can be used in place of diode of low capacity but diode of low capacity cannot be used
in place of diode of high capacity. For example, in place of IN4002; IN4001 or IN4007 can be
used but IN4001 or IN4002 cannot be used in place of IN4007.The diode BY125made by
company BEL is equivalent of diode from IN4001 to IN4003. BY 126 is equivalent to diodes
IN4004 to 4006 and BY 127 is equivalent to diode IN4007 [7].

Fig- 4.24 :PN Junction diode

PEC KANPUR Page 49


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

PN JUNCTION OPERATION

Now that you are familiar with P- and N-type materials, how these materials are joined
together to form a diode, and the function of the diode, let us continue our discussion with the
operation of the PN junction. But before we can understand how the PN junction works, we must
first consider current flow in the materials that make up the junction and what happens initially
within the junction when these two materials are joined together.

Current Flow in the N-Type Material

Conduction in the N-type semiconductor, or crystal, is similar to conduction in a copper


wire. That is, with voltage applied across the material, electrons will move through the crystal
just as current would flow in a copper wire. This is shown in figure 18. The positive potential of
the battery will attract the free electrons in the crystal. These electrons will leave the crystal and
flow into the positive terminal of the battery. As an electron leaves the crystal, an electron from
the negative terminal of the battery will enter the crystal, thus completing the current path. Therefore, the
majority current carriers in the N-type material (electrons) are repelled by the negative side of the
battery and move through the crystal toward the positive side of the battery.

Current Flow in the P-Type Material

Current flow through the P-type material is illustrated. Conduction in the P material is by
positive holes, instead of negative electrons. A hole moves from the positive terminal of the P
material to the negative terminal. Electrons from the external circuit enter the negative terminal
of the material and fill holes in the vicinity of this terminal. At the positive terminal, electrons
are removed from the covalent bonds, thus creating new holes. This process continues as the
steady stream of holes (hole current) moves toward the negative terminal

PEC KANPUR Page 50


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

3.1.12 RESISTORS-
A resistor is a two-terminal electronic component designed to oppose an electric current by
producing a voltage drop between its terminals in proportion to the current, that is, in accordance
with Ohm's law:
V = IR
Resistors are used as part of electrical networks and electronic circuits. They are extremely
commonplace in most electronic equipment. Practical resistors can be made of various
compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as
nickel/chrome).
The primary characteristics of resistors are their resistance and the power they can
dissipate. Other characteristics include temperature coefficient, noise, and inductance. Less well-
known is critical resistance, the value below which power dissipation limits the maximum
permitted current flow, and above which the limit is applied voltage. Critical resistance depends
upon the materials constituting the resistor as well as its physical dimensions; it's determined by
design.
Resistors can be integrated into hybrid and printed circuits, as well as integrated
circuits. Size, and position of leads (or terminals) are relevant to equipment designers; resistors
must be physically large enough not to overheat when dissipating their power.

FIG- 4.25 Resistors


A resistor is a two-terminal passive electronic component which implements electrical
resistance as a circuit element. When a voltage V is applied across the terminals of a resistor, a
current I will flow through the resistor in direct proportion to that voltage. The reciprocal of the

PEC KANPUR Page 51


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

constant of proportionality is known as the resistance R, since, with a given voltage V, a larger
value of R further "resists" the flow of current I as given by Ohm's law:

Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in most electronic equipment. Practical resistors can be made of various compounds
and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel-
chrome). Resistors are also implemented within integrated circuits, particularly analog devices,
and can also be integrated into hybrid and printed circuits.
The electrical functionality of a resistor is specified by its resistance: common
commercial resistors are manufactured over a range of more than 9 orders of magnitude. When
specifying that resistance in an electronic design, the required precision of the resistance may
require attention to the manufacturing tolerance of the chosen resistor, according to its specific
application. The temperature coefficient of the resistance may also be of concern in some
precision applications. Practical resistors are also specified as having a maximum power rating
which must exceed the anticipated power dissipation of that resistor in a particular circuit: this is
mainly of concern in power electronics applications. Resistors with higher power ratings are
physically larger and may require heat sinking. In a high voltage circuit, attention must
sometimes be paid to the rated maximum working voltage of the resistor.
The series inductance of a practical resistor causes its behaviour to depart from ohms law;
this specification can be important in some high-frequency applications for smaller values of
resistance. In a low-noise amplifier or pre-amp the noise characteristics of a resistor may be an
issue. The unwanted inductance, excess noise, and temperature coefficient are mainly dependent
on the technology used in manufacturing the resistor. They are not normally specified
individually for a particular family of resistors manufactured using a particular technology. A
family of discrete resistors is also characterized according to its form factor, that is, the size of
the device and position of its leads (or terminals) which is relevant in the practical manufacturing
of circuits using them [7].

PEC KANPUR Page 52


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Units-
The ohm (symbol: Ω) is the SI unit of electrical resistance, named after Georg Simon
Ohm. An ohm is equivalent to a volt per ampere. Since resistors are specified and manufactured
over a very large range of values, the derived units of milliohm (1 mΩ = 10−3 Ω), kilo ohm (1 kΩ
= 103 Ω), and mega ohm (1 MΩ = 106 Ω) are also in common usage.
The reciprocal of resistance R is called conductance G = 1/R and is measured in Siemens
(SI unit), sometimes referred to as a mho. Thus a Siemens is the reciprocal of an ohm: S = Ω − 1.
Although the concept of conductance is often used in circuit analysis, practical resistors are
always specified in terms of their resistance (ohms) rather than conductance.

PEC KANPUR Page 53


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

CHAPTER-5

PEC KANPUR Page 54


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

SOFTWARE REQUIREMENTS-

5.1 INTRODUCTION TO KEIL MICRO VISION (IDE)


Keil an ARM Company makes C compilers, macro assemblers, real-time kernels,
debuggers, simulators, integrated environments, evaluation boards, and emulators for
ARM7/ARM9/Cortex-M3, XC16x/C16x/ST10, 251, and 8051 MCU families.
Keil development tools for the 8051 Microcontroller Architecture support every level of
software developer from the professional applications engineer to the student just learning about
embedded software development. When starting a new project, simply select the microcontroller
you use from the Device Database and the µVision IDE sets all compiler, assembler, linker, and
memory options for you.
Keil is a cross compiler. So first we have to understand the concept of compilers and
cross compilers. After then we shall learn how to work with keil [8].

5.2 CONCEPT OF COMPILER


Compilers are programs used to convert a High Level Language to object code. Desktop
compilers produce an output object code for the underlying microprocessor, but not for other
microprocessors. I.E the programs written in one of the HLL like ‗C‘ will compile the code to
run on the system for a particular processor like x86 (underlying microprocessor in the
computer). For example compilers for Dos platform is different from the Compilers for Unix
platform So if one wants to define a compiler then compiler is a program that translates source
code into object code.
The compiler derives its name from the way it works, looking at the entire piece of
source code and collecting and reorganizing the instruction. See there is a bit little difference
between compiler and an interpreter. Interpreter just interprets whole program at a time while
compiler analyses and execute each line of source code in succession, without looking at the
entire program [8].
The advantage of interpreters is that they can execute a program immediately. Secondly
programs produced by compilers run much faster than the same programs executed by an
interpreter. However compilers require some time before an executable program emerges. Now

PEC KANPUR Page 55


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

as compilers translate source code into object code, which is unique for each type of computer,
many compilers are available for the same language.

5.3 CONCEPT OF CROSS COMPILER


A cross compiler is similar to the compilers but we write a program for the target
processor (like 8051 and its derivatives) on the host processors (like computer of x86). It means
being in one environment you are writing a code for another environment is called cross
development. And the compiler used for cross development is called cross compiler. So the
definition of cross compiler is a compiler that runs on one computer but produces object code for
a different type of computer [8].

5.4 KEIL C CROSS COMPILER


Keil is a German based Software development company. It provides several
development tools like
• IDE (Integrated Development environment)
• Project Manager
• Simulator
• Debugger
• C Cross Compiler, Cross Assembler, Locator/Linker
The Keil ARM tool kit includes three main tools, assembler, compiler and linker. An assembler
is used to assemble the ARM assembly program. A compiler is used to compile the C source
code into an object file. A linker is used to create an absolute object module suitable for our in-
circuit emulator [8].

5.5 Building an Application in µVision2


To build (compile, assemble, and link) an application in µVision2, you must:
1. Select Project -(forexample,166\EXAMPLES\HELLO\HELLO.UV2).

2. Select Project - Rebuild all target files or Build target.µVision2 compiles, assembles,

3. and links the files in your project.

PEC KANPUR Page 56


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

5.6 Creating Your Own Application in µVision2


To create a new project in µVision2, you must:
1. Select Project - New Project.

2. Select a directory and enter the name of the project file.

3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the
Device Database™.

4. Create source files to add to the project.

5. Select Project - Targets, Groups, Files. Add/Files, select Source Group1, and add the
source files to the project.

6. Select Project - Options and set the tool options. Note when you select the target device
from the Device Database™ all special options are set automatically. You typically only
need to configure the memory map of your target hardware. Default memory model
settings are optimal for most applications.

7. Select Project - Rebuild all target files or Build target.

5.7 Debugging an Application in µVision2


To debug an application created using µVision2, you must:
1. Select Debug - Start/Stop Debug Session.

2. Use the Step toolbar buttons to single-step through your program. You may enter G, main
in the Output Window to execute to the main C function.

3. Open the Serial Window using the Serial #1 button on the toolbar.

Debug your program using standard options like Step, Go, Break, and so on.

PEC KANPUR Page 57


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

5.8 Starting µVision2 and Creating a Project


µVision2 is a standard Windows application and started by clicking on the program icon.
To create a new project file select from the µVision2 menu Project – New Project…. This opens
a standard Windows dialog that asks you for the new project file name. We suggest that you use
a separate folder for each project. You can simply use the icon Create New Folder in this dialog
to get a new empty folder. Then select this folder and enter the file name for the new project, i.e.
Project1. µVision2 creates a new project file with the name PROJECT1.UV2 which contains a
default target and file group name. You can see these names in the Project [8].

5.9 Window – Files.


Now use from the menu Project – Select Device for Target and select a CPU for your project.
The Select Device dialog box shows the µVision2 device data base. Just select the
microcontroller you use. We are using for our examples the Philips 80C51RD+ CPU. This
selection sets necessary tool Options for the 80C51RD+ device and simplifies in this way the
tool Configuration.

5.10 Building Projects and Creating a HEX Files


Typical, the tool settings under Options – Target are all you need to start a new
application. You may translate all source files and line the application with a click on the Build
Target toolbar icon. When you build an application with syntax errors, µVision2 will display
errors and warning messages in the Output Window – Build page. A double click on a message
line opens the source file on the correct location in a µVision2 editor window. Once you have
successfully generated your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to download the
software into an EPROM programmer or simulator. µVision2 creates HEX files with each build
process when Create HEX files under Options for Target – Output is enabled. You may start
your PROM programming utility after the make process when you specify the program under the
option Run User Program #1.

PEC KANPUR Page 58


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

5.11 CPU Simulation


µVision2 simulates up to 16 Mbytes of memory from which areas can be mapped for
read, write, or code execution access. The µVision2 simulator traps
and reports illegal memory accesses. In addition to memory mapping, the simulator also provides
support for the integrated peripherals of the various 8051 derivatives. The on-chip peripherals of
the CPU you have selected are configured from the Device.

5.12 Database selection


You have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral using the
controls in the dialog boxes [8].

5.13 Start Debugging


You start the debug mode of µVision2 with the Debug – Start/Stop Debug Session
Command. Depending on the Options for Target – Debug Configuration, µVision2 will load the
application program and run the startup code µVision2 saves the editor screen layout and
restores the screen layout of the last debug session. If the program execution stops, µVision2
opens an editor window with the source text or shows CPU instructions in the disassembly
window. The next executable statement is marked with a yellow arrow. During debugging, most
editor features are still available.
For example, you can use the find command or correct program errors. Program source
text of your application is shown in the same windows. The µVision2 debug mode differs from
the edit mode in the following aspects:
_ The ―Debug Menu and Debug Commands‖ described on page 28 are available. The additional
debug windows are discussed in the following.
_ The project structure or tool parameters cannot be modified. All build commands are disable.

PEC KANPUR Page 59


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

5.14 Disassembly Window


The Disassembly window shows your target program as mixed source and assembly
program or just assembly code. A trace history of previously executed instructions may be
displayed with Debug – View Trace Records. To enable the trace history, set Debug –
Enable/Disable Trace Recording.
If you select the Disassembly Window as the active window all program step commands
work on CPU instruction level rather than program source lines. You can select a text line and
set or modify code breakpoints using toolbar buttons or the context menu commands.
You may use the dialog Debug – Inline Assembly… to modify the CPU instructions.
That allows you to correct mistakes or to make temporary changes to the target program you are
debugging. Numerous example programs are included to help you get started with the most
popular embedded 8051 devices.
The Keil µVision Debugger accurately simulates on-chip peripherals (I²C, CAN, UART,
SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM Modules) of your 8051
device. Simulation helps you understand hardware configurations and avoids time wasted on
setup problems. Additionally, with simulation, you can write and test applications before target
hardware is available [8].

5.15 EMBEDDED C
Use of embedded processors in passenger cars, mobile phones, medical equipment,
aerospace systems and defense systems is widespread, and even everyday domestic appliances
such as dish washers, televisions, washing machines and video recorders now include at least one
such device.
Because most embedded projects have severe cost constraints, they tend to use low-cost
processors like the 8051 family of devices considered in this book. These popular chips have
very limited resources available most such devices have around 256 bytes (not megabytes!) of
RAM, and the available processor power is around 1000 times less than that of a desktop
processor. As a result, developing embedded software presents significant new challenges, even
for experienced desktop programmers. If you have some programming experience - in C, C++
or Java - then this book and its accompanying CD will help make your move to the embedded
world as quick and painless as possible [9].

PEC KANPUR Page 60


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

CHAPTER-6

PEC KANPUR Page 61


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

6.1 APPLICATION-

(1) For enhancing the border security electronically.


(2) For automatic detection of object in specific area.
(3) On small scale can be used for home security.

6.2 ADVANTAGES-
(1) It can be used for reducing the work load and responsibility of border man.
(2) Enhances the security level.
(3) Automatically shoots the target.
(4) Automatically detects the object.
(5) Easy to install.
(6) Less dependency on environmental factors.
(7) Cost is less.

6.3 DISADVANTAGES-
(1) It can be used for limited range.
(2) In some cases performance of ultrasonic sensors degraded.
(3) It also can shoot undesired object.

PEC KANPUR Page 62


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

CHAPTER-7

PEC KANPUR Page 63


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

7.1 CONCLUSION-
In this paper we can detect the object in the specific range and destroy it by using automatic
electromagnetic gun. For this we use ultrasonic sensors so object can be easily detected and
destroyed.

7.2 FUTURE SCOPE-


In this project we only detect the object using ultrasonic sensors and then destroy it by using
automatic electromagnetic gun. We also can use a GSM module to send the signal to station .We
also can measure the location of object [10].
.

PEC KANPUR Page 64


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

REFERENCES-
ONLINE REFERENCES-
1. https://en.wikipedia.org/wiki/automaticgunsystem

2. http://www.ijiert.org/admin/papers/1429469524_Volume%202%20Issue4.pdf

3. http://www.edgefxkits.com/objectdetectionusingultrasonicsensors

4. http://www.ti.com/lit/ds/symlink/adc0804-n.pdf

5. http://www.st.com/web/catalog/sense_power/FM151/SC252/PF64090

6. http://www.edaboard.com/thread207937.html

7. https://en.wikipedia.org/wiki/Main_Page

8. http://www.engineersgarage.com/tutorials/introduction-micro-vision-keil

9. https://en.wikipedia.org/wiki/Embedded_C

10. http://www.irdindia.in/journal_ijeecs/pdf/vol2_iss7/4.pdf

OFFLINE REFERENCES
a. ―The 8051 Microcontroller and Embedded systems‖
by Muhammad Ali Mazidi and Janice Gillispie Mazidi , Pearson Education.
b. ATMEL 89S52 Data Sheets

PEC KANPUR Page 65


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

APPENDIX-
#include<reg52.h>

#include<stdio.h>

sbit relay pin=p2^0;

void delay ms(int);

void main()

Do

relay pin=0;

delay ms(1000);

relay pin=1;

delay ms(1000);

}while(1);

SCON=0x50;

TMOD=0x20;

TH1=0xf3;

IR1=1;

TI=1;

While(1)

Unsigned char aaa;

Aaa= getkey();

PEC KANPUR Page 66


AUTOMATED ELECTROMAGNETIC GUN USING ULTRASONIC SENSORS

Putchar(aaa);

Void delay ms (int k)

Int j;

Int i;

For(i=0;i<k;i++)

For(j=0;j<100;j++)

PEC KANPUR Page 67

Вам также может понравиться