You are on page 1of 43

KEEP DISTANCE WARNING SYSTEM

CHAPTER-1 INTRODUCTION

1
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

KEEP DISTANCE WARNING SYSTEM


1.1)INTRODUCTION
Most of the accidents in high-ways are happening due to the drowsiness of drivers, most often this symptom is found in long distance truck drivers, these drivers may take some time to recognize the opposite vehicle, which is running at low speed, resulting accident. This kind of accidents may happen due to the drunken drivers also. So to increase safety an electronic warning system is essential to alert the drivers. This kind of system can be installed in all types of vehicles, especially in commercial vehicles, so that accident rate can be minimized. The warning system designed here can be called as driver attention system, which raises an alarm and energizes the display board automatically when the following vehicle came near to the in-front running vehicle. The system is designed with 89S52 microcontroller, the task is quite simple, the following vehicle detection circuit is designed with infrared sensors, when the IR signal is interrupted due to the following vehicle, the circuit generates high signal and it is fed to microcontroller. It offers several advantages over conventional multi-chip systems. There is a cost and space advantage as extra chip costs and printed circuit board and connectors

required to support multi-chip systems are eliminated.

SOFTWARE REQUIREMENT: 1. KEIL MICRO VISION-3 2. MICRO FLASH

HARDWARE REQUIREMENT: 1. MICROCONTROLLER (89S52) 2. LM7805. 3. ULTRASONIC SENSOR(GH-311) 4. LCD DISPLAY(2*16) 5.BUZZER

2
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

1.2 AIM:
The aim of this system is to alert the following vehicle whenever it came very close to the ahead vehicle; thereby to some extent accidents can be avoided .Many accidents at High-ways are taking place due to the close running of vehicles, all of sudden, if the in front vehicle driver reduces the speed or applied breaks, then it is quite difficult to the following vehicle driver to control his vehicle, resulting accidents avoid this kind of accident, the warning system, which contains alarm and display system can arrange at rear side of each and every vehicle.

1.3 BLOCK DIAGRAM:

POWER SUPPLY

LCD DISPLAY

AT 89S52 MICRO CONTROLLER ULTRASONIC SENSOR

BUZZER

FIG (1.3) BLOCK DIAGRAM

3
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

1.4 FLOW CHART:

START

Initialization of Microcontroller Initialization of LCD

Initialization of ultrasonic

If object is detected

NO

yes Buzzer on

Object detection is displayed on LCD

STOP STOP FIG (1.4) FLOWCHART

4
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

CHAPTER 2 DESCRIPTION OF MICROCONTROLLER

5
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

2.1 INTRODUCTION :
The 8051 is an original member of the 8051 family. There are two other members in the 8051 family of microcontrollers. They are 8052 and 8031. All the three microcontrollers will have the same internal architecture, but they differ in the following aspects. 8031 has 128 bytes of RAM, two timers and 6 interrupts. 89S51 has 4KB ROM, 128 bytes of RAM, two timers and 6 interrupts. 89S52 has 8KB ROM, 128 bytes of RAM, three timers and 8 interrupts. Of the three microcontrollers, 89S51 is the most preferable. Microcontroller supports both serial and parallel communication. In the concerned project 89S52 microcontroller is used. Here microcontroller used is AT89S52, which is manufactured by ATMEL laboratories. The AT89S52 provides the following standard features: 8Kbytes of Flash, 256 bytes of RAM, 32 I/O lines, three 16-bit timer/counters, 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 hardware reset. 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 hardware reset. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the AT89C52 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.

6
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

2.2 PIN CONFIGURATION:

FIG (2.2) PIN DIAGRAM OF 89S52 IC

7
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

2.3 PIN DESCRIPTION:


VCC Pin 40 provides Supply voltage to the chip. The voltage source is +5v

GND. Pin 20 is the grounded

Port 0
Port 0 is an 8-bit open drain bidirectional I/O port from pin 32 to 39. 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 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 from pin 1 to 8. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in following table. Port 1 also receives the low-order address bytes during Flash programming and program verification.

TABLE (2.3.1) PORT 1 FUNCTIONS

8
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups from pin 21 to 28. The Port 2 output buffers can sink / source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups.

Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups from pin 10 to 17. 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.

TABLE (2.3.2) PORT 3 FUNCTIONS

9
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

RST
Pin 9 is the Reset input. It is active high. Upon applying a high pulse to this pin, the microcontroller will reset and terminate all activities. A high on this pin for two machine cycles while the oscillator is running resets the device.

ALE/PROG
Address Latch is an output pin and is active high. Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.

PSEN
Program Store Enable is the read strobe to external program memory. When the AT89C52 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 when 12-volt programming is selected.

10
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2
Output from the inverting oscillator amplifier.

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 5.3. 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 .

FIGURE (2.3.1) CRYSTAL CONNECTIONS

FIGURE( 2.3.2) EXTERNAL CLOCK DRIVE CONFIGURATION

11
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

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.

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. It should be noted that when idle is terminated by a hardware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory.

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.

Table (2.3.3) Status of External Pins During Idle and Power Down Mode

12
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

2.4 TIMERS:
Timer 0 and 1 Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer 1 in the AT89S52. Register pairs (TH0, TL1), (TH1, TL1) are the 16-bit counter registers for timer/counters 0 and 1. Timer 2 Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON. Timer 2 has three operating modes: capture, auto-reload (up or down counting), and baud rate generator. The modes are selected by bits in T2CON, as shown in Table 5.2. Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.

Table (2.4) Timer 2 Operating Modes

In the Counter function, the register is incremented in response to a 1-to-0 transition at its corresponding external input pin, T2. In this function, the external input is sampled during S5P2 of every machine cycle. When the samples show a high in one cycle and a low in the next cycle, the count is incremented. The new count value appears in the register during S3P1 of the cycle following the one in which the transition was detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0 transition, the maximum count rate is 1/24 of the oscillator frequency. To ensure that a given level is sampled at least once before it changes, the level should be held for at least one full machine cycle. 13
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

There are no restrictions on the duty cycle of external input signal, but it should for at least one full machine to ensure that a given level is sampled at least once before it changes.

2.5 INTERRUPTS:
The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts are all shown in Figure 2.5

FIGURE (2.5) INTERRUPTS SOURCE Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to. In fact, the service routine may have to determine whether it was TF2 or EXF2 that generated the interrupt, and that bit will have to be cleared in software. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow.

14
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

Table (2.5) Interrupts Enable Register

2.6 MEMORY ORGANIZATION :


The total memory of 89S52 system is logically divided in Program memory and Data memory. Program memory stores the programs to be executed, while data memory stores the data like intermediate results, variables and constants required for the execution of the program. Program memory is invariably implemented using EPROM, because it stores only program code which is to be executed and thus it need not be written into. However, the data memory may be read from or written to and thus it is implemented using RAM. Further, the program memory and data memory both may be categorized as on-chip (internal) and external memory, depending upon whether the memory physically exists on the chip or it is externally interfaced. The 89S52 can address 8Kbytes on-chip memory whose map starts from 0000H and ends at 1FFFH. It can address 64Kbytes of external program memory under the control of PSEN (low) signal.

15
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

CHAPTER-3 POWER SUPPLY

16
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

3.1 INTRODUCTION:
Power supplies are designed to convert high voltage AC mains electricity to a suitable low voltage supply for electronics circuits and other devices.

Fig (3.1) Block Diagram of a Regulated Power Supply System 3.2 TRANSFORMER:
A transformer steps down high voltage AC mains to low voltage AC. Here we are using a center-tap transformer whose output will be sinusoidal with 24V peak to peak. .

Fig( 3.2) Output Waveform of transformer

The low voltage AC output is suitable for lamps, heaters and special AC motors. It is not suitable for electronic circuits unless they include a rectifier and a smoothing capacitor. The transformer output is given to the rectifier circuit.

17
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

3.3 RECTIFIER:
A rectifier converts AC to DC, but the DC output is varying. There are several types of rectifiers; here we use a bridge rectifier. The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using both half cycles of the input ac voltage. The circuit has four diodes connected to form a bridge. The ac input voltage is applied to the diagonally opposite ends of the bridge. The load resistance is connected between the other two ends of the bridge.For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct. The conducting diodes will be in series with the load resistance RL and hence the load current flows through R L. For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct.The conducting diodes D2 and D4 will be in series with the load resistance RL and hence the current flows through RL in the same direction as in the previous half cycle. Thus a bi-directional wave is converted into unidirectional.

FIG (3.3.1) Rectifier circuit

FIG (3.3.2) Rectifier output

18
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

Smoothing:
The smoothing block smoothes the DC from varying greatly to a small ripple and the ripple voltage is defined as the deviation of the load voltage from its DC value. Smoothing is also named as filtering. Filtering is frequently effected by shunting the load with a capacitor. The action of this system depends on the fact that the capacitor stores energy during the conduction period and delivers this energy to the loads during the no conducting period. In this way, the time during which the current passes through the load is prolonging Ted, and the ripple is considerably decreased. The action of the capacitor is shown with the help of waveform.

Figure (3.3.3) Smoothing action of capacitor

Figure (3.3.4) Waveform of the rectified output smoothing

19
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

3.4 Voltage Regulator:


Voltage Regulator eliminates ripple by setting DC output to a fixed voltage. Voltage regulator ICs are available with fixed (typically 5V, 12V and 15V) or variable output voltages.Many of the fixed voltage regulator ICs has 3 leads (input, output and high impedance). Zener diode is an example of fixed regulator which is shown here.

Figure (3.4) Voltage Regulator 3.5 POWER SUPPLY CIRCUIT:

Fig (3.5) POWER SUPPLY CIRCUIT

20
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

CHAPTER 4 ULTRASONIC SENSOR(GH-311RT)

21
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

4.1 INTRODUCTION :
Parallax's ultrasonic sensor provides a very low-cost and easy method of distance measurement. This sensor is perfect for any number of applications that require you to perform measurements between moving or stationary objects. Naturally, robotics applications are very popular but you'll also find this product to be useful in security systems or as an infrared replacement if so desired.

FIG (4.1) ULTRASONIC SENSOR

Pin Definitions: GND Ground (Vss), 5 V 5 VDC (Vdd) SIG Signal (I/O pin)
List of technical specifications:

Range - 2cm to 3m (~.75" to 10') Supply Voltage: 5V +/-10% (Absolute: Minimum 4.5V, Maximum 6V) Supply Current: 30 mA typ; 35 mA max 3-pin interface (power, ground, signal) 20 mA power consumption Narrow acceptance angle Simple pulse in / pulse out communication Indicator LED shows measurement in progress Input Trigger - positive TTL pulse, 2 s min, 5 s typ. Echo Pulse - positive TTL pulse, 115 s to 18.5 ms Echo Hold-off - 750 s from fall of Trigger pulse Burst Frequency - 40 kHz for 200 s 22
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

4.2 GH-311 Ultrasound Motion Sensor:


The GH-311 ultrasonic Motion sensor provides precise, non-contact distance measurements from about 2 cm (0.8 inches) to 3 meters (3.3 yards). It is very easy to connect to microcontrollers such as the BASIC Stamp, SX or Propeller chip, requiring only one I/O pin. The GH-311 sensor works by transmitting an ultrasonic (well above human hearing range) burst and providing an output pulse that corresponds to the time required for the burst echo to return to the sensor. By measuring the echo pulse width, the distance to target can easily be calculated.

4.3 Modules External Connection schematic

Pin Definitions:
GND Ground (Vss), 5 V 5 VDC (Vdd) SIG Signal (I/O pin) The GH-311 sensor has a male 3-pin header used to supply ground, power (+5 VDC) and signal. The header may be plugged into a directly into solder less breadboard, or into a standard 3- wire extension cable

23
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

4.4 Communication Protocol:


The GH-311 sensor detects objects by emitting a short ultrasonic burst and then listening" for the echo. Under control of a host microcontroller (trigger pulse), the sensor emits a short 40 kHz (ultrasonic) burst. This burst travels through the air, hits an object and then bounces back to the sensor. The GH-311 sensor provides an output pulse to the host that will terminate when the echo is detected, hence the width of this pulse corresponds to the distance to the target.

Practical Considerations for Use, (Object Positioning)


The GH-311 sensor cannot accurately measure the distance to an object that: a) is more than 3 meters away, b) that has its reflective surface at a shallow angle so that sound will not be reflected back towards the sensor, or c) is too small to reflect enough sound back to the sensor. In addition, if your GH-311 is mounted low on your device, you may detect sound reflecting off of the floor.

24
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

Target Object Material


In addition, objects that absorb sound or have a soft or irregular surface, such as a stuffed animal, may not reflect enough sound to be detected accurately. The GH-311 sensor will detect the surface of water, however it is not rated for outdoor use or continual use in a wet environment. Condensation on itstransducers may affect performance and lifespan of the device.

DC LOAD CIRCUIT SCHEMATIC:

25
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

Ultrasonic sensors (also known as transducers when they both send and receive) work on a principle similar to radar or sonar which evaluate attributes of a target by interpreting the echoes from radio or sound waves respectively. Ultrasonic sensors generate high frequency sound waves and evaluate the echo which is received back by the sensor. Sensors calculate the time interval between sending the signal and receiving the echo to determine the distance to an object. This technology can be used for measuring: wind speed and direction (anemometer), fullness of a tank, and speed through air or water. For measuring speed or direction a device uses multiple detectors and calculates the speed from the relative distances to particulates in the air or water. To measure the amount of liquid in a tank, the sensor measures the distance to the surface of the fluid. Further applications include: humidifiers, sonar, medical ultrasonography, burglar alarms, and non-destructive testing. Systems typically use a transducer which generates sound waves in the ultrasonic range, above 20,000 hertz, by turning electrical energy into sound, then upon receiving the echo turn the sound waves into electrical energy which can be measured and displayed. The technology is limited by the shapes of surfaces and the density or consistency of the material. For example foam on the surface of a fluid in a tank could distort a reading.

26
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

4.5 Applications of Ultrasonic sensors:


Use in medicine: Medical ultrasonic transducers (probes) come in a variety of different shapes and sizes for use in making pictures of different parts of the body. The transducer may be passed over the surface of the body or inserted into an body opening such as the rectum or vagina. Clinicians who perform ultrasound-guided procedures often use a probe positioning system to hold the ultrasonic transducer.

Use in industry:
Ultrasonic sensors are used to detect the presence of targets and to measure the distance to targets in many automated factories and process plants. Sensors with an on or off digital output are available for detecting the presence of objects, and sensors with an analog output which varies proportionally to the sensor to target separation distance are commercially available.

Ultrasonic sensors are commonly used for a wide variety of noncontact presence, proximity,
or distance measuring applications. These devices typically transmit a short burst of ultrasonic sound toward a target, which reflects the sound back to the sensor. The system then measures the time for the echo to return to the sensor and computes the distance to the target using the speed of sound in the medium.

27
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

Wavelength of Sound as a Function of Sound Speed and Frequency:


The wavelength of sound changes as a function of both the speed of sound and the frequency, as shown by the expression: = c/f where: = wavelength C = speed of light F = frequency Figure 2 is a plot of the wavelength of sound as a function of frequency at room temperature in air.

FIG (4.2) PLOT OF WAVE LENGTH VS FREQUENCY

BackgroundNoise

The level of background ultrasonic noise diminishes as the frequency increases. The reason is that less noise at the higher frequencies is produced in the environment, and the noise that is produced is greatly attenuated as it travels through the air.

28
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

4.6 Ultrasonic sensor drive circuit:


The inverter is used for the drive of the ultrasonic sensor. The two inverters are connected in parallel because of the transmission electric power increase.

The phase with the voltage to apply to the positive terminal and the negative terminal of the sensor has been 180 degrees shifted. Because it is cutting the direct current with the capacitor, about twice of Voltage of the inverter output are applied to the sensor.

Signalamplificationcircuit:
Generally, the positive and the negative power supply are used for the operational amplifier. The circuit this time works with the single power supply of +9 V. Therefore, for the positive input of the operational amplifiers, the half of the power supply voltage is appied as the bias voltage and it is made 4.5 V in the central voltage of the amplified alternating current signal. When using the operational amplifier with the negative feedback, the voltage of the positive input terminal and the voltage of the negative input terminal become equal approximately. So, by this bias voltage, the side of the positive and the side of the negative of the alternating current signal can be equally amplified. When not using this bias voltage, the distortion causes the alternating current signal.

Signal detector:
This circuit is the circuit which detects the ultrasonic which returned from the measurement object. The output of the detection circuit is detected using the comparator. At the circuit this time, the operational amplifier of the single power supply is used instead of the comparator.

In case of the operational amplifier which doesn't have the negative feedback, at a little input voltage, the output becomes the saturation state. So, when the positive input becomes higher a little than the negative input, the difference is tens of thousands of times amplified and the output becomes the same as the power supply almost. (It is the saturation state) Oppositely, when the positive input becomes lower a little than the negative input, the difference is tens of thousands of times amplified and the output becomes 0 V almost.(It is in the OFF condition) This operation is the same as the operation of the comparator. However, because the inner circuit is different about the comparator and the operational amplifier, the comparator can not be used .

29
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

CHAPTER 5 LCD DISPLAY CIRCUIT

30
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

The alphanumeric 16 character X 2line LCD requires 8data lines and also 3 control signals and they are interfaced to 3664.By using 2 ports, port 0&3 data pins are connected to LCD as data bus. Port0 can be basically used as I/O port i.e. it can be programmed as an input or as an output port. That means if it is programmed as output port, suppose if it is required to read data from LCD immediately it is not possible. Before reading the data it is required to make the port as an input port. Data reading from LCD gives an erroneous reading & should not be implemented. Because of this port5 is made as input / output port depending on the situation. The control signals are connected to port 3 pins. They are EN bar & RS bar, RW bar. At different instance such as data write / command write / data read etc. Various signals are to be provided as indicated by the by the LCD manufacturers. To interface the LCD, to the Micro controller it require an 8 bit and also three control signals differentiate the data from the control words send to the LCD. The Micro controller has to send the necessary control words followed by the data to be displayed. Depending on the operation to be performed the control words are selected and passes to the LCD. The data to be displayed on the LCD is to be sent in the ASCII format. Thus all the character to be displayed are converted into ASCII form and then sent to the LCD along with different control words. The control word differentiated the various operations and are executed. It is also possible to read the LCD data if required. The control signals to the LCD are also provided by the Micro controller. This is also done through pins 3.5,3.6&3.7.Through program necessary control signals are passed to the LCD by using the bits of the port. The remaining can be used for some other purpose if there is a need. The software controls the necessary ports and performs the task it is designed for. The soft ware and associated hardware perform the LCD interface. A liquid crystal is a material (normally organic for LCDs) that will flow like a liquid but whose molecular structure has some properties normally associated with solids. The Liquid Crystal Display (LCD) is a low power device. The power requirement is typically in the order of microwatts for the LCD.

31
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

LCD DISPLAY
Gnd vcc preset rs rw en d0 d1 d2 d3 d4 d5 d6 d7 vcc gnd

FIG (5.1.1) LCD DISPLAY

A liquid crystal is a material (normally organic for LCDs) that will flow like a liquid but whose molecular structure has some properties normally associated with solids. The Liquid Crystal Display (LCD) is a low power device. The power requirement is typically in the order of microwatts for the LCD. However, an LCD requires an external or internal light source. It is limited to a temperature range of about 0C to 60C and lifetime is an area of concern, because LCDs can chemically degrade. There are two major types of LCD s which are: 1) Dynamic-scattering LCD s 2) Field-effect LCD s Field-effect LCD s are normally used in such applications where source of energy is a prime factor (e.g., watches, portable instrumentation etc.).They absorb considerably less power than the light-scattering type. However, the cost for field-effect units is typically higher, and their height is limited to 2 inches. On the other hand, light-scattering units are available up to 8 inches in height. Field-effect LCD is used in the project for displaying the appropriate information. The turn-on and turn-off time is an important consideration in all displays. The response time of LCD s is in the range of 100 to 300ms.The lifetime of LCD s is steadily increasing beyond 10,000+hours limit. Since the colour generated by LCD units is dependent on the source of illumination, there is a wide range of colour choice.

To send any of the commands from given table to the lcd, make pin RS =0.For data, make RS=1.then send a high to low pulse to the E pin to enable the internal latch of the LCD. As shown in figure for LCD connections.

32
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

Fig(5.1.2) 8-bit LCD interface

33
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

CHAPTER 6 CIRCUIT DIAGRAM

34
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

35
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

CHAPTER 7 SOFTWARE DESCRIPTION

36
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

SOFTWATRE USED
The software that we used in this project is Kiel Micro vision 3, micro flash. Kiel micro vision 3 is a complier. Micro flash is used to burn software into hardware in AT89S52

PROGRAM: #include<reg51.h> sfr ldata=0x90; sbit rs=P2^5; sbit rw=P2^6; sbit en=P2^7; sbit usonic=P0^1; sbit buzzer=P0^7; lcddata(char temp[ ],int ); lcdcmd(unsigned char); lcddelay(unsigned int); main ( ) { Buzzer =1; Lcdcmd (0x38); Lcdcmd (0x0E); Lcdcmd (0x01); Lcdcmd (0x81); Lcddata ("KEEP DISTANCE",14); While (1) { If (usonic==0) { Lcdcmd (0xC0); Buzzer =0; Lcddata ("VEHICLE AHEAD",13); Lcdcmd (0x0C); } 37
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

//port 1

KEEP DISTANCE WARNING SYSTEM

else { Buzzer =1; Lcdcmd (0xC0); Lcddata ("NO VEHICLE AHEAD",16); Lcdcmd (0x0C); }}} Lcddelay (unsigned int k) { int i,j; for (i=0;i<=k;i++) for (j=0;j<=1275;j++); } lcdcmd (unsigned char value) { Ldata =value; Rs =0; Rw =0; En =1; Lcddelay (1); En =0; return; } Lcddata (char temp[16],int s) { For (s=0;s<16;s++) Ldata =temp[s]; rs =1; rw =0; en=1; lcddelay (1); en =0 } }

38
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

CHAPTER 8 EXPERIMENTAL RESULTS

39
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

Most of the accidents in high-ways are happening due to the drowsiness of drivers, most often this symptom is found in long distance truck drivers, these drivers may take some time to recognize the opposite vehicle, which is running at low speed, resulting accident. This kind of accidents may happen due to the drunken drivers also. So to increase safety an electronic warning system is essential to alert the drivers. This kind of system can be installed in all types of vehicles, especially in commercial vehicles, so that accident rate can be minimized. The warning system designed here can be called as driver attention system, which raises an alarm and energizes the display board automatically when the following vehicle came near to the in-front running vehicle.

8.1 APPLICATIONS:
This system is best for guiding the perimeter of a house or a business center the points where an intruder would enter the building. In this system IR sensor is used to detect the intrusion. Similarly the vibration and temperature sensors recognize vibration disturbances and accidental fires respectively. This project provides an efficient and economical security system. This system finds applications in industries, banks and homes.

8.2 RESULTS:
The project work keep distance warning system that is designed for Automobiles, any vehicle ranging from motor cycle to heavy duty truck can adopt this system. This alerts the following vehicle whenever it came very close to the ahead vehicle; thereby to some extent accidents can be avoided. The circuit is designed such that whenever the infrared signal is interrupted, logic high signal is generated and it is fed to microcontroller, on receipt of this signal, the controller activates the display board and alarm automatically.

40
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

CONCLUSION

Hence, here by we conclude that Keep Distance Warning System is mainly used to avoid accidents. This kind of system can be installed in all types of vehicles, especially in commercial vehicles, so that accident rate can be minimized. This project provides an efficient and economical security system.

41
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

FUTURE SCOPE
This system is a rapidly growing field and there are new and improved strategies popping up all the time. For the most part these systems are all built around the same basic structure, a central box that monitors several detectors and perimeter guards and sounds an alarm when any of them are triggered. Incorporating the features discussed below can further enhance the system This system can detect intrusion only at discrete points. This system detection feature can be extended to scanning a complete area. Thus the intrusion into the building can be detected with much more efficiently. The redialing feature can also be incorporated such that if the call is not put forward the first time, the auto dialer will dial the same number until the call is successfully completed. A pre-recorded voice message can delivered to the owner notifying him about the intrusion into the premises. The addition of the above discussed advancements certainly builds this project into a much flexible and reliable security system

42
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

KEEP DISTANCE WARNING SYSTEM

REFERENCES
1)http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=4608344&url=http%3A%2F%2Fiee explore.ieee.org%2Fiel5%2F4599586%2F4608308%2F04608344.pdf%3Farnumber%3D460 8344 2) https://sites.google.com/site/newfinalyearprojects/report-on-distance-warning-system 3) http://www.scribd.com/doc/56911862/Distance-Warning-System 4) http://www.scribd.com/full/45628858?access_key=key-grbkg54h9ofe9ew17f9

43
RAJAMAHENDRI INSTITUTE IO ENGINEERING AND TECNOLOGY DEPARTMENT OF ECE

You might also like