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

When the other IR sensor senses the presence of vehicle.cc | www.www.troubleshoot4free. When ever IR rays are interrupted by a vehicle during first sensor the count up timer is started. . This idealized control law achieves perfect direction & speed however. 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. In our project we use IR sensors to detect the presence of a vehicle.final-yearprojects. 2 IR sensors are placed apart with a fixed known distance. 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. 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. In this methodology we are using a micro controller. As the distance and time the IR receiver receives the IR signals is noted by microcontroller and from that we need to calculate speed.com/fyp/ ABSTRACT A system designed to record and report on discrete activities within a process is called as Tracking System. the count up timer is stopped.co. resulting in the state trajectory 'sliding' along path-varying slides on the surface. The method is applied to the control of a two-link manipulator handling variable loads in a flexible manufacturing system environment. 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.co. According to this project.final-yearprojects. In this project we use IR sensors to detect the presence of a vehicle.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. the count up timer is stopped. As the distance and time the IR receiver receives the IR signals is noted by microcontroller and .troubleshoot4free.cc | www.www. When the other IR sensor senses the presence of vehicle.

The LCD is used to display the speed of the vehicle. . a bridge rectifier.troubleshoot4free.co. 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.com/fyp/ from that we need to calculate speed. The microcontroller is used to monitor the all control operations needed for the project. a smoothing circuit and the RPS. Here speed is calculated from the well known formula of speed which is distance/time.final-yearprojects.www.cc | www.

com/fyp/ At the primary of the transformer we are giving the 230V AC supply. which is connected by using the resistor logic as shown in the schematic.final-yearprojects. The control pins are connected to the port 2.www. Lcd: The data pins of the LCD(i.e. From other set of opposite terminals we are taking the output to the rectifier. The RPS regulates the voltage as per our requirement. The secondary is connected to the opposite terminals of the Bridge rectifier as the input. Hardware Components • • • • • Power supply Microcontroller LCD IR TRANSMITTER IR RECEIVER .co.cc | www.7 to p2. The output of this rectifier is further given to the smoother circuit which is capacitor in our project. The IR receiver is connected by using the transistor logic whose collector is connected to the base of the transistor. IR section: The IR LED is used as the IR transmitter.5 respectively. pin mo 7 to 14 are connected to the port 0 of the microcontroller. 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 bridge rectifier converts the AC coming from the secondary of the transformer into pulsating DC. The base of the transistor is connected to the photo diode through the resistor.troubleshoot4free.

the designer has to go for external memory such as RAM. EPROM and peripherals. data acquisition interfaces-Analog to Digital converter.www.cc | www. integrated on to a single silicon chip. 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. Figure: micro controller .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.co. If a system is developed with a microprocessor. parallel port timer or counter. Development of a Micro controller reduces PCB size and cost of design. But controller is provided all these facilities on a single chip.final-yearprojects. ROM. Intel has introduced a family of Micro controllers called the MCS-51.troubleshoot4free. interrupt controller. Digital to Analog converter.

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 .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.cc | www.0V to 5.co.final-yearprojects.www.troubleshoot4free.

www. high-performance CMOS 8-bit microcontroller with 4K bytes of in-system programmable Flash memory. the Atmel AT89S51 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.com/fyp/ • Six Interrupt Sources • Full Duplex UART Serial Channel • Low-power Idle and Power-down Modes Description The AT89S51 is a low-power.co. By combining a versatile 8bit CPU with in-system programmable Flash on a monolithic chip. The device is manufactured using Atmel’s highdensity nonvolatile memory technology and is compatible with the industry. Pin diagram: .troubleshoot4free.final-yearprojects. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.standard 80C51 instruction set and pinout.cc | www.

Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory.co.com/fyp/ Figure: pin diagram of micro controller Pin Description: VCC . P0 has internal pull-ups.Ground. GND . Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. When 1s are written to port 0 pins. Port 1: .Supply voltage.troubleshoot4free. In this mode. External pull-ups are required during program verification. each pin can sink eight TTL inputs.final-yearprojects. the pins can be used as high-impedance inputs.www. As an output port. Port 0: Port 0 is an 8-bit open drain bidirectional I/O port.cc | www.

Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. As inputs. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. When 1s are written to Port 2 pins. 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. Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups.troubleshoot4free.cc | www. As inputs. The Port 3 output buffers can sink/source four TTL inputs.www. The Port 2 output buffers can sink/source four TTL inputs.final-yearprojects. they are pulled high by the internal pull-ups and can be used as inputs. When 1s are written to Port 3 pins.co. Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. they are pulled high by the internal pull-ups and can be used as inputs. Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 1 also receives the low-order address bytes during Flash programming and verification. as shown in the following table.com/fyp/ Port 1 is an 8-bit bidirectional I/O port with internal 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. Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. As inputs.

Note. the RESET HIGH out feature is enabled.com/fyp/ RST: Reset input.www. With the bit set. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. When the AT89S51 is executing code from external program memory. In the default state of bit DISRTO. the pin is weakly pulled high. ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. This pin is also the program pulse input (PROG) during Flash programming. ALE is active only during a MOVX or MOVC instruction.co.final-yearprojects. PSEN is activated twice each . however.cc | www. ALE operation can be disabled by setting bit 0 of SFR location 8EH. that one ALE pulse is skipped during each access to external data memory. A high on this pin for two machine cycles while the oscillator is running resets the device.troubleshoot4free. In normal operation. PSEN: Program Store Enable (PSEN) is the read strobe to external program memory. Otherwise. This pin drives High for 98 oscillator periods after the Watchdog times out. If desired. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.

EA will be internally latched on reset. 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. Oscillator Characteristics: XTAL1 and XTAL2 are the input and output.troubleshoot4free. 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. Note.cc | www. XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2: Output from the inverting oscillator amplifier. XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6. EA/VPP: External Access Enable.3. EA should be strapped to VCC for internal program executions. except that two PSEN activations are skipped during each access to external data memory. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. that if lock bit 1 is programmed.com/fyp/ machine cycle.4. however. To drive the device from an external clock source.2. Either a quartz crystal or ceramic resonator may be used.final-yearprojects. respectively. as shown in Figs 6.2.co. of an inverting amplifier which can be configured for use as an on-chip oscillator.There are no requirements on the duty cycle of the external clock signal.

2. calculators and measuring instruments is the simple seven-segment displays. The declining prices of LCD s. which are limited to numbers and a few characters.troubleshoot4free. more information displaying capability and a wider temperature range. The recent advances in technology have resulted in better legibility.3 Oscillator Connections Fig 6.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).final-yearprojects. This is in contract to LED s. This is due to the following reasons: 1. The ability to display numbers. the LED must be refreshed by the CPU to keep displaying the data. In the contrast. 3. These have resulted in the LCD s being extensively used in telecommunications and entertainment electronics. 4.cc | www.www. Ease of programming for characters and graphics. there by relieving the CPU of the task of refreshing the LCD. having a limited amount of numeric data. 2. characters and graphics.2. USES: The LCD s used exclusively in watches. Incorporation of a refreshing controller into the LCD.com/fyp/ Fig 6. The LCD s has .co.

Yellow/Green Duty: 1/16 View direction: Wide viewing angle Backlight Type: yellow/green LED RoHS Compliant: lead free Operating Temperature: -20°C to + 70°C .www. Transflective.troubleshoot4free.0 x 16.0 mm Active area: 56.cc | www.2mm(MAX) View area: 66.70 mm Character size: 2.60 x 0. Specifications • • • • • • • • • • • • • • • Number of Characters: 16 characters x 2 Lines Character Table: English-European (RS in Datasheet) Module dimension: 80.66 mm Dot pitch: 0.final-yearprojects.com/fyp/ even started replacing the cathode ray tubes (CRTs) used for the display of text and graphics.co.56 x 0.2 x 11.0mm x 36.46 mm Character pitch: 3.96 x 5. and also in small TV applications.0mm x 13.55 x 5. Positive.5 mm Dot size: 0.94 mm LCD type: STN.

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 .co.final-yearprojects.www.com/fyp/ LCD PIN DIAGRAM: LCD pin description The LCD discussed in this section has 14 pins.cc | www.troubleshoot4free.

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.www.c power supply which maintains the output voltage constant irrespective of a.co. each of which performs a particular function. A d. A power supply can by broken down into a series of blocks.final-yearprojects.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: .cc | www.

night vision for camcorders. It just looks like a normal LED but transmits the IR signals.com/fyp/ Here the IR transmitter is nothing but the IR LED. collision avoidance and systems. links. automation biomedical instrumentation. surveillance cameras.www.troubleshoot4free. These are infrared LEDs. recognition and calibration systems. invisible beam sensors. Since the IR rays are out of the visible range we cannot observe the rays from the transmitter. telecommunications . the light output is not visible by our eyes.co. • Due to their resistance to ambient-light impediments and electromagnetic interference (EMI). Fig 30: IR LED Advantages: • Infrared LEDs are ideal light sources for use with night vision goggles. equipment. medical imaging.final-yearprojects. etc. Infrared LEDs enhance the performance of wireless computer-to-PDA equipment.cc | www. They can be used as replacement LEDs for remote controls.

troubleshoot4free. If the absorption occurs in the junction's depletion region. vibration. the flow of photocurrent out of the device is restricted and a voltage builds up. With an average life span of 100. which is the basis for solar cells—in fact. The diode becomes forward biased and "dark current" begins to flow across the junction in the direction opposite to the photocurrent. a solar cell is just an array of large photodiodes. When a photon of sufficient energy strikes the diode.000-plus hours (11 years). Infrared LEDs operate reliably year-after-year.cc | www. Many diodes designed for use specifically as a photodiode will also use a PIN junction rather than the typical PN junction. Photo diode: A photodiode is a type of photodetector capable of converting light into either current or voltage. This mode is responsible for the photovoltaic effect. Thus holes move toward the anode. . and a photocurrent is produced. Photovoltaic mode When used in zero bias or photovoltaic mode.co.com/fyp/ • Solid-state design renders Infrared LEDs impervious to electrical and mechanical shock. and electrons toward the cathode. depending upon the mode of operation.www. frequent switching and environmental extremes.final-yearprojects. Principle of operation A photodiode is a PN junction or PIN structure. or one diffusion length away from it. these carriers are swept from the junction by the built-in field of the depletion region. 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. it excites an electron thereby creating a mobile electron and a positively charged electron hole.

This allows each photo-generated carrier to be multiplied by avalanche breakdown. Phototransistors also have slower response times. 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.co. because only photons with sufficient energy to excite electrons across the material's bandgap will produce significant photocurrents. Phototransistors also consist of a photodiode with internal gain.) Other modes of operation Avalanche photodiodes have a similar structure to regular photodiodes.com/fyp/ Photoconductive mode In this mode the diode is often (but not always) reverse biased.www.troubleshoot4free.cc | www. and this current is amplified by the transistor operation. This increases the width of the depletion layer. The electrons that are generated by photons in the base-collector junction are injected into the base. the photovoltaic mode tends to exhibit less electronic noise. Although this mode is faster. Materials The material used to make a photodiode is critical to defining its properties. which decreases the junction's capacitance resulting in faster response times. Note that although phototransistors have a higher responsivity for light they are unable to detect low levels of light any better than photodiodes. Materials commonly used to produce photodiodes include: . resulting in internal gain within the photodiode. which increases the effective responsivity of the device. but they are operated with much higher reverse bias.final-yearprojects. (The leakage current of a good PIN diode is so low – < 1nA – that the Johnson–Nyquist noise of the load resistance in a typical circuit often dominates. 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.

www. due to the induced photocurrents. Since housings are not completely opaque to X-rays or other high energy radiation. Features Critical performance parameters of a photodiode include: Responsivity: The ratio of generated photocurrent to incident light power. silicon-based photodiodes generate less noise than germanium-based photodiodes. typically expressed in A/W when used in photoconductive mode.final-yearprojects. The responsivity may also be expressed as a quantum efficiency. especially those sensitive to small currents. but germanium photodiodes must be used for wavelengths longer than approximately 1 µm. or the ratio of the number of photogenerated carriers to incident photons and thus a unitless quantity. and contain P-N junctions. almost every active component is potentially a photodiode. Since transistors and ICs are made of semiconductors. will not work correctly if illuminated. so they are placed in an opaque housing. these can still cause many ICs to malfunction due to induced photo-currents. Many components.com/fyp/ Material Silicon Germanium Indium gallium arsenide Lead sulfide Wavelength range (nm) 190–1100 400–1700 800–2600 <1000-3500 Because of their greater bandgap. Dark current: .troubleshoot4free.cc | www. In most components this is not desired.co.

such as photoconductors.co. and the specific detectivity () is the detectivity normalized to the area (A) of the photodetector.www.com/fyp/ The current through the photodiode in the absence of light. The dark current includes photocurrent generated by background radiation and the saturation current of the semiconductor junction. The NEP is roughly the minimum detectable input power of a photodiode. Fig 31: Photo Diode . equal to the rms noise current in a 1 hertz bandwidth. Noise-equivalent power: (NEP) The minimum input optical power to generate photocurrent. when it is operated in photoconductive mode.troubleshoot4free. and photomultiplier tubes. When a photodiode is used in an optical communication system. Applications Photodiode schematic symbol. Dark current must be accounted for by calibration if a photodiode is used to make an accurate optical power measurement.. which is the minimum input power required for the receiver to achieve a specified bit error ratio. and it is also a source of noise when a photodiode is used in an optical communication system. The related characteristic detectivity (D) is the inverse of NEP. 1/NEP.final-yearprojects.cc | www. these parameters contribute to the sensitivity of the optical receiver. charge-coupled devices. P-N photodiodes are used in similar applications to other photodetectors.

although in principle either could be used. if high sensitivity is needed.c voltage is being rectified by the Bridge Rectifier using 1N4007 diodes. such as detectors for computed tomography (coupled with scintillates) or instruments to analyze samples (immunoassay). voltage is fed to the Voltage Regulator. clock radios (the ones that dim the display when it's dark) and street lights.com/fyp/ Photodiodes are used in consumer electronics devices such as compact disc players. night vision equipment and laser range finding. avalanche photodiodes. and hence are often used for optical communications and in lighting regulation. P-N photodiodes are not used to measure extremely low light intensities. smoke detectors. photoconductors are often used rather than photodiodes. Hence the 5V D. This regulated 5V is generated by stepping down the voltage from 230V to 18V now the step downed a. intensified charge-coupled devices or photomultiplier tubes are used for applications such as astronomy . power supply is needed for the IC’s.c voltage is now filtered using a ‘C’ filter.www. Photodiodes are often used for accurate measurement of light intensity in science and industry.C. This voltage regulator provides/allows us to have a Regulated . and the receivers for remote controls in VCRs and televisions. They are also used in blood gas monitors. spectroscopy. Now the rectified.troubleshoot4free.C. They are also widely used in various medical applications.final-yearprojects. PIN diodes are much faster and more sensitive than ordinary p-n junction diodes.cc | www. Circuit description: In this project we required operating voltage for Microcontroller 89C51 is 5V. filtered D. more linear response than photoconductors.co. In other consumer items such as camera light meters. They generally have a better. Instead. The rectified a.

The microcontroller 89C51 with Pull up resistors at Port0 and crystal oscillator of 11. When ever IR rays are interrupted by a vehicle during first sensor the count up timer is started. Here speed is calculated from the well known formula of speed which is distance/time.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. According to this project. When the other IR sensor senses the presence of vehicle. the count up timer is stopped.com/fyp/ constant Voltage which is of +5V. Now the output from this section is fed to 40th pin of 89C51 microcontroller to supply operating voltage.final-yearprojects.troubleshoot4free.cc | www. filtered and regulated voltage is again filtered for ripples using an electrolytic capacitor 100μF. In our project we use IR sensors to detect the presence of a vehicle. CONCLUSION The project “SPEED CHECKER FOR HI-WAYS” has been successfully designed and tested. 2 IR sensors are placed apart with a fixed known distance. As the distance and time the IR receiver receives the IR signals is noted by microcontroller and from that we need to calculate speed. The rectified.www. .co.

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. Secondly.cc | www.com/fyp/ It has been developed by integrating features of all the hardware components used.co. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit.troubleshoot4free. Bibliography The 8051 Micro controller and Embedded Systems .final-yearprojects.www. using highly advanced IC’s and with the help of growing technology the project has been successfully implemented.

co.microsoftsearch.atmel.cc | www. Gaonkar Electronic Components -D.Theodore S. Rappaport References on the Web: www.Janice Gillispie Mazidi The 8051 Micro controller Architecture.troubleshoot4free.com www. Prasad Wireless Communications .www.V.com www.final-yearprojects.Ram Micro processor Architecture. Programming & Applications -Ramesh S.Ayala Fundamentals Of Micro processors and Micro computers -B.national.com www.com .geocities.com/fyp/ . Programming & Applications -Kenneth J.