You are on page 1of 26

www.final-yearprojects.co.cc | www.troubleshoot4free.

com/fyp/

SPEED DETECTOR FOR HIGHWAYS

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

INDEX
CONTENTS
1. Figures locations 2. Abstract 3. Introduction 4. Block Diagram 5. Block Diagram Description 6. Schematic 7. Schematic Description 8. Hardware Components
Power supply Microcontroller LCD IR TRANSMITTER IR RECEIVER

9. Circuit Description 10.Software components


a. About Keil b. Embedded C

11. KEIL procedure description 12.Conclusion (or) Synopsis 13. Future Aspects

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

ABSTRACT

A system designed to record and report on discrete activities within a process is called as Tracking System. In the same procedure we have developed a methodology of vehicle speed & direction system for robotics to control and achieve accurate direction speed for a class of non-linear systems in the presence of disturbances and parameter variations by using wireless communication technique. In this methodology we are using a micro controller, resulting in the state trajectory 'sliding' along path-varying slides on the surface. This idealized control law achieves perfect direction & speed however. The method is applied to the control of a two-link manipulator handling variable loads in a flexible manufacturing system environment. In our project we use IR sensors to detect the presence of a vehicle. According to this project, 2 IR sensors are placed apart with a fixed known distance. When ever IR rays are interrupted by a vehicle during first sensor the count up timer is started. When the other IR sensor senses the presence of vehicle, the count up timer is stopped. As the distance and time the IR receiver receives the IR signals is noted by microcontroller and from that we need to calculate speed. Here speed is calculated from the well known formula of speed which is distance/time. In this circuit we are using LCD display for indicating the speed. It is easy to set up and supports the required hardware. To design a vehicle that supports the newest technology available will be more expensive than boards that are already close to obsolete.

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

INTRODUCTION

BLOCK-DIAGRAM

LCD

POWER SUPPLY

MICRO CONTROLLER

IR-Rx 1

IR-TX 1

IR-Rx 2

IR-TX 2

BLOCK DIAGRAM EXPLANATION:


The project SPEED CHECKER FOR HI-WAYS is made to calculate the speed of the vehicle by using the following methodology. In this project we use IR sensors to detect the presence of a vehicle. According to this project, 2 IR sensors are placed apart with a fixed known distance. When ever IR rays are interrupted by a vehicle during first sensor the count up timer is started. When the other IR sensor senses the presence of vehicle, the count up timer is stopped. As the distance and time the IR receiver receives the IR signals is noted by microcontroller and

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

from that we need to calculate speed. Here speed is calculated from the well known formula of speed which is distance/time. The LCD is used to display the speed of the vehicle. The microcontroller is used to monitor the all control operations needed for the project.

Schematic diagram:

SCHEMATIC DESCRIPTION:
Power Supply: The main aim of this power supply is to convert the 230V AC into 5V DC in order to give supply for the TTL or CMOS devices. In this process we are using a step down transformer, a bridge rectifier, a smoothing circuit and the RPS.

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

At the primary of the transformer we are giving the 230V AC supply. The secondary is connected to the opposite terminals of the Bridge rectifier as the input. From other set of opposite terminals we are taking the output to the rectifier. The bridge rectifier converts the AC coming from the secondary of the transformer into pulsating DC. The output of this rectifier is further given to the smoother circuit which is capacitor in our project. The smoothing circuit eliminates the ripples from the pulsating DC and gives the pure DC to the RPS to get a constant output DC voltage. The RPS regulates the voltage as per our requirement.

Lcd:
The data pins of the LCD(i.e. pin mo 7 to 14 are connected to the port 0 of the microcontroller. The control pins are connected to the port 2.7 to p2.5 respectively. IR section: The IR LED is used as the IR transmitter, which is connected by using the resistor logic as shown in the schematic. The IR receiver is connected by using the transistor logic whose collector is connected to the base of the transistor. The base of the transistor is connected to the photo diode through the resistor.

Hardware Components
Power supply Microcontroller LCD IR TRANSMITTER IR RECEIVER

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

HARDWARE EXPLANATION:

MICRO CONTROLLER (AT89S51)

Introduction
A Micro controller consists of a powerful CPU tightly coupled with memory, various I/O interfaces such as serial port, parallel port timer or counter, interrupt controller, data acquisition interfaces-Analog to Digital converter, Digital to Analog converter, integrated on to a single silicon chip. If a system is developed with a microprocessor, the designer has to go for external memory such as RAM, ROM, EPROM and peripherals. But controller is provided all these facilities on a single chip. Development of a Micro controller reduces PCB size and cost of design. One of the major differences between a Microprocessor and a Micro controller is that a controller often deals with bits not bytes as in the real world application. Intel has introduced a family of Micro controllers called the MCS-51.

Figure: micro controller

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Block diagram:

Figure: Block diagram

Features:
Compatible

with MCS-51 Products

4K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 1000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 128 x 8-bit Internal RAM 32 Programmable I/O Lines Two 16-bit Timer/Counters

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Six Interrupt Sources Full Duplex UART Serial Channel Low-power Idle and Power-down Modes

Description
The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of in-system programmable Flash memory. The device is manufactured using Atmels highdensity nonvolatile memory technology and is compatible with the industry- standard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S51 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.

Pin diagram:

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Figure: pin diagram of micro controller

Pin Description:
VCC - Supply voltage. GND - Ground. 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:

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

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. Port 1 also receives the low-order address bytes during Flash programming and verification.

Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S51, as shown in the following table.

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

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. 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 (PSEN) is the read strobe to external program memory. When the AT89S51 is executing code from external program memory, PSEN is activated twice each

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

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. 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 Figs 6.2.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 as shown in Figure 6.2.4.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 flipflop, but minimum and maximum voltage high and low time specifications must be observed.

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Fig 6.2.3 Oscillator Connections

Fig 6.2.4 External Clock Drive Configuration

Liquid Crystal Display


Introduction to LCD:
In recent years the LCD is finding widespread use replacing LED s (seven-segment LED or other multi segment LED s). This is due to the following reasons: 1. The declining prices of LCD s. 2. The ability to display numbers, characters and graphics. This is in contract to LED s, which are limited to numbers and a few characters. 3. Incorporation of a refreshing controller into the LCD, there by relieving the CPU of the task of refreshing the LCD. In the contrast, the LED must be refreshed by the CPU to keep displaying the data. 4. Ease of programming for characters and graphics.

USES: The LCD s used exclusively in watches, calculators and measuring instruments is the simple seven-segment displays, having a limited amount of numeric data. The recent advances in technology have resulted in better legibility, more information displaying capability and a wider temperature range. These have resulted in the LCD s being extensively used in telecommunications and entertainment electronics. The LCD s has

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

even started replacing the cathode ray tubes (CRTs) used for the display of text and graphics, and also in small TV applications.

Specifications

Number of Characters: 16 characters x 2 Lines Character Table: English-European (RS in Datasheet) Module dimension: 80.0mm x 36.0mm x 13.2mm(MAX) View area: 66.0 x 16.0 mm Active area: 56.2 x 11.5 mm Dot size: 0.56 x 0.66 mm Dot pitch: 0.60 x 0.70 mm Character size: 2.96 x 5.46 mm Character pitch: 3.55 x 5.94 mm LCD type: STN, Positive, Transflective, Yellow/Green Duty: 1/16 View direction: Wide viewing angle Backlight Type: yellow/green LED RoHS Compliant: lead free Operating Temperature: -20C to + 70C

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

LCD PIN DIAGRAM:

LCD pin description


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

TABLE 1: Pin description for LCD: Pin


1 2 3 4

symbol
Vss Vcc VEE RS

I/O
---I

Description
Ground +5V power supply Power supply to control contrast RS=0 to select command register RS=1 to select data register R/W=0 for write R/W=1 for read Enable The 8-bit data bus

5 6 7-14

R/W E DB0-DB7

I I/O I/O

Power supply

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

The power supplies are designed to convert high voltage AC mains electricity to a suitable low voltage supply for electronics circuits and other devices. A power supply can by broken down into a series of blocks, each of which performs a particular function. A d.c power supply which maintains the output voltage constant irrespective of a.c mains fluctuations or load variations is known as Regulated D.C Power Supply

For example a 5V regulated power supply system as shown below:

IR transmitter:
IR LED:

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Here the IR transmitter is nothing but the IR LED. It just looks like a normal LED but transmits the IR signals. Since the IR rays are out of the visible range we cannot observe the rays from the transmitter.

These are infrared LEDs; the light output is not visible by our eyes. They can be used as replacement LEDs for remote controls, night vision for camcorders, invisible beam sensors, etc.

Fig 30: IR LED Advantages:

Infrared LEDs are ideal light sources for use with night vision goggles, surveillance cameras, medical imaging, recognition and calibration systems.

Due to their resistance to ambient-light impediments and electromagnetic interference (EMI), Infrared LEDs enhance the performance of wireless computer-to-PDA equipment, equipment. links, collision avoidance and systems, automation biomedical instrumentation, telecommunications

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Solid-state design renders Infrared LEDs impervious to electrical and mechanical shock, vibration, frequent switching and environmental extremes. With an average life span of 100,000-plus hours (11 years), Infrared LEDs operate reliably year-after-year.

Photo diode:
A photodiode is a type of photodetector capable of converting light into either current or voltage, depending upon the mode of operation. Photodiodes are similar to regular semiconductor diodes except that they may be either exposed (to detect vacuum UV or X-rays) or packaged with a window or optical fibre connection to allow light to reach the sensitive part of the device. Many diodes designed for use specifically as a photodiode will also use a PIN junction rather than the typical PN junction.

Principle of operation
A photodiode is a PN junction or PIN structure. When a photon of sufficient energy strikes the diode, it excites an electron thereby creating a mobile electron and a positively charged electron hole. If the absorption occurs in the junction's depletion region, or one diffusion length away from it, these carriers are swept from the junction by the built-in field of the depletion region. Thus holes move toward the anode, and electrons toward the cathode, and a photocurrent is produced.

Photovoltaic mode
When used in zero bias or photovoltaic mode, the flow of photocurrent out of the device is restricted and a voltage builds up. The diode becomes forward biased and "dark current" begins to flow across the junction in the direction opposite to the photocurrent. This mode is responsible for the photovoltaic effect, which is the basis for solar cellsin fact, a solar cell is just an array of large photodiodes.

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Photoconductive mode
In this mode the diode is often (but not always) reverse biased. This increases the width of the depletion layer, which decreases the junction's capacitance resulting in faster response times. The reverse bias induces only a small amount of current (known as saturation or back current) along its direction while the photocurrent remains virtually the same. Although this mode is faster, the photovoltaic mode tends to exhibit less electronic noise. (The leakage current of a good PIN diode is so low < 1nA that the JohnsonNyquist noise of the load resistance in a typical circuit often dominates.)

Other modes of operation


Avalanche photodiodes have a similar structure to regular photodiodes, but they are operated with much higher reverse bias. This allows each photo-generated carrier to be multiplied by avalanche breakdown, resulting in internal gain within the photodiode, which increases the effective responsivity of the device. Phototransistors also consist of a photodiode with internal gain. A phototransistor is in essence nothing more than a bipolar transistor that is encased in a transparent case so that light can reach the base-collector junction. The electrons that are generated by photons in the base-collector junction are injected into the base, and this current is amplified by the transistor operation. Note that although phototransistors have a higher responsivity for light they are unable to detect low levels of light any better than photodiodes. Phototransistors also have slower response times.

Materials
The material used to make a photodiode is critical to defining its properties, because only photons with sufficient energy to excite electrons across the material's bandgap will produce significant photocurrents. Materials commonly used to produce photodiodes include:

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Material Silicon Germanium Indium gallium arsenide Lead sulfide

Wavelength range (nm) 1901100 4001700 8002600 <1000-3500

Because of their greater bandgap, silicon-based photodiodes generate less noise than germanium-based photodiodes, but germanium photodiodes must be used for wavelengths longer than approximately 1 m. Since transistors and ICs are made of semiconductors, and contain P-N junctions, almost every active component is potentially a photodiode. Many components, especially those sensitive to small currents, will not work correctly if illuminated, due to the induced photocurrents. In most components this is not desired, so they are placed in an opaque housing. Since housings are not completely opaque to X-rays or other high energy radiation, these can still cause many ICs to malfunction due to induced photo-currents.

Features
Critical performance parameters of a photodiode include: Responsivity: The ratio of generated photocurrent to incident light power, typically expressed in A/W when used in photoconductive mode. The responsivity may also be expressed as a quantum efficiency, or the ratio of the number of photogenerated carriers to incident photons and thus a unitless quantity. Dark current:

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

The current through the photodiode in the absence of light, when it is operated in photoconductive mode. The dark current includes photocurrent generated by background radiation and the saturation current of the semiconductor junction. Dark current must be accounted for by calibration if a photodiode is used to make an accurate optical power measurement, and it is also a source of noise when a photodiode is used in an optical communication system. Noise-equivalent power: (NEP) The minimum input optical power to generate photocurrent, equal to the rms noise current in a 1 hertz bandwidth. The related characteristic detectivity (D) is the inverse of NEP, 1/NEP; and the specific detectivity () is the detectivity normalized to the area (A) of the photodetector,. The NEP is roughly the minimum detectable input power of a photodiode. When a photodiode is used in an optical communication system, these parameters contribute to the sensitivity of the optical receiver, which is the minimum input power required for the receiver to achieve a specified bit error ratio.

Applications
Photodiode schematic symbol. P-N photodiodes are used in similar applications to other photodetectors, such as photoconductors, charge-coupled devices, and photomultiplier tubes.

Fig 31: Photo Diode

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

Photodiodes are used in consumer electronics devices such as compact disc players, smoke detectors, and the receivers for remote controls in VCRs and televisions. In other consumer items such as camera light meters, clock radios (the ones that dim the display when it's dark) and street lights, photoconductors are often used rather than photodiodes, although in principle either could be used. Photodiodes are often used for accurate measurement of light intensity in science and industry. They generally have a better, more linear response than photoconductors. They are also widely used in various medical applications, such as detectors for computed tomography (coupled with scintillates) or instruments to analyze samples (immunoassay). They are also used in blood gas monitors. PIN diodes are much faster and more sensitive than ordinary p-n junction diodes, and hence are often used for optical communications and in lighting regulation. P-N photodiodes are not used to measure extremely low light intensities. Instead, if high sensitivity is needed, avalanche photodiodes, intensified charge-coupled devices or photomultiplier tubes are used for applications such as astronomy , spectroscopy, night vision equipment and laser range finding.

Circuit description:

In this project we required operating voltage for Microcontroller 89C51 is 5V. Hence the 5V D.C. power supply is needed for the ICs. This regulated 5V is generated by stepping down the voltage from 230V to 18V now the step downed a.c voltage is being rectified by the Bridge Rectifier using 1N4007 diodes. The rectified a.c voltage is now filtered using a C filter. Now the rectified, filtered D.C. voltage is fed to the Voltage Regulator. This voltage regulator provides/allows us to have a Regulated

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

constant Voltage which is of +5V. The rectified; filtered and regulated voltage is again filtered for ripples using an electrolytic capacitor 100F. Now the output from this section is fed to 40th pin of 89C51 microcontroller to supply operating voltage. The microcontroller 89C51 with Pull up resistors at Port0 and crystal oscillator of 11.0592 MHz crystal in conjunction with couple of 30-33pf capacitors is placed at 18th & 19th pins of 89C51 to make it work (execute) properly. In our project we use IR sensors to detect the presence of a vehicle. According to this project, 2 IR sensors are placed apart with a fixed known distance. When ever IR rays are interrupted by a vehicle during first sensor the count up timer is started. When the other IR sensor senses the presence of vehicle, the count up timer is stopped. As the distance and time the IR receiver receives the IR signals is noted by microcontroller and from that we need to calculate speed. Here speed is calculated from the well known formula of speed which is distance/time.

CONCLUSION
The project SPEED CHECKER FOR HI-WAYS has been successfully designed and tested.

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

It has been developed by integrating features of all the hardware components used. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit.

Secondly, using highly advanced ICs and with the help of growing technology the project has been successfully implemented.

Finally we conclude that SPEED CHECKER FOR HI-WAYS is an

emerging field and there is a huge scope for research and development.

FUTURE ENHANCEMENT
We can enhance this project by using the technology like RF and increase the distance to measure.

Bibliography
The 8051 Micro controller and Embedded Systems

www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/

- Janice Gillispie Mazidi The 8051 Micro controller Architecture, Programming & Applications -Kenneth J.Ayala Fundamentals Of Micro processors and Micro computers -B.Ram Micro processor Architecture, Programming & Applications -Ramesh S. Gaonkar Electronic Components -D.V. Prasad Wireless Communications - Theodore S. Rappaport

References on the Web:


www.national.com www.atmel.com www.microsoftsearch.com www.geocities.com

You might also like