Sie sind auf Seite 1von 12

MICROCONTROLLER BASED AUTOMATIC TRAFFIC LIGHT CONTROLER WITH DENSITY CONTROL

Submitted By:

INTRODUCTION: Traffic lights have become an integral part of humans day-to-day life. With the advancement in semiconductor technology and a parallel rise in innovation in embedded technology a sea change in the lighting engineering has resulted. With this motivation in the mind, this project aims at designing and implementing, a running model of traffic light controller which is controlled according to the density of vehicle on road. We will use AT89s52 microcontroller and Infra red sensor for performing all the computation and control related task.

COMPONENTS REQUIRED: AT89S52 Microcontroller LEDs Crystal Oscillator 12 Mhz LM7805 12 V transformer IR Tx-Rx Pair 555 Timer CL 100 Discrete components: Resistors, Capacitors

A BRIEF INTRODUCTION TO 8051 MICROCONTROLLER: When we have to learn about a new computer we have to familiarize about the machine capability we are using, and we can do it by studying the internal hardware design (devices architecture), and also to know about the size, number and the size of the registers. A microcontroller is a single chip that contains the processor (the CPU), non-volatile memory for the program (ROM or flash), volatile memory for input and output (RAM), a clock and an I/O control unit. Also called a "computer on a chip," billions of microcontroller units (MCUs) are embedded each year in a myriad of products from toys to appliances to automobiles. For example, a single vehicle can use 70 or more microcontrollers. The following picture describes a general block diagram of microcontroller. 89s52: The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density 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 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel's AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt

system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt

The hardware is driven by a set of program instructions, or software. Once familiar with hardware and software, the user can then apply the microcontroller to the problems easily. The pin diagram of the 8051 shows all of the input/output pins unique to microcontrollers:

The following are some of the capabilities of 8051 microcontroller. Internal ROM and RAM I/O ports with programmable pins Timers and counters

Serial data communication

The 8051 architecture consists of these specific features: 16 bit PC &data pointer (DPTR) 8 bit program status word (PSW) 8 bit stack pointer (SP) Internal ROM 4k Internal RAM of 128 bytes. 4 register banks, each containing 8 registers 80 bits of general purpose data memory 32 input/output pins arranged as four 8 bit ports:P0-P3 Two 16 bit timer/counters: T0-T1 Two external and three internal interrupt sources Oscillator and clock circuits

For any electronics project the power supply plays a very important role in its proper functioning. In this project we are using external A.C supply (220 v) as input , this high voltage is converted into 12 Volts A.C by step down transformer , then we use voltage regulators and filters with bridge rectifier to convert the A.C into D.C voltage .

For voltage regulation we are using LM 7805 and 7812 to produce ripple free 5 and 12 volts D.C constant supply.

IR SENSOR INFRARED LED'S:-

Gallium arsenide is a direct-gap semiconductor with an energy gap of 1.4eV at room temperature. A typical GaPs LED is made by solid-state impurity diffusion with zinc as the ptype impurity diffused into an n-type substate doped with tin, tellurium or silicon. The external efficiency at room temperature is typically 5 percent.

A GaAs diode can also be fabricated by liquid-phase epitaxy with silicon as both its n and p dopants. If a silicon atom replaces a Ga atom, it provides one additional electron, thus the resulting GaAs in as n-type. If a silicon atom replaces arsenic atoms, an electron is missing and the resulting GaAs is a p-type. In Si doped GaAs diode, the emission peak shifts down to 1.32eV. Since the emission is in infrared region, GaAs light sources are suitable for application such as the optical isolator. The high switching speed, with a recovery time between 2 and 10ns, makes them ideal for data transmission.

The disadvantages of the GaAs emitter are emitted wavelength and the associated attenuation an dispersion. A critical issue of using an LED for the fibre optics is the coupling of

light from the semiconductor to the fibre. Because of the larger refractive index of GaAs relative to air, the internal efficiency of LED can be quite low.

PHOTO SEMICONDUCTOR A Germanium or silicon diode or transistor, which has a transparent encasing, can serve as a photodiode or transistor because the light photons can initiate conduction in the p-njunction region. Early devices such as the OCP 71 were Ge-devices. Later, silicon types became available with lower leakage current and better light sensitivity. In a phototransistor, the base lead is not used; but, if a resistor is connected form base to emitter it reduced the light sensitivity. Darlington connected photo transistors (two transistors together in one case) such as the 2N5777 are very sensitive with a hFE of 2.5K, a dark current of 100nA and a light current of 0.5-2.0mA for light flux density H=2mW/cm2. The device is rated 200mW and voltage of 25V maximum.

SCRs with a light window are also available, called as LASCR, which are very sensitive and can turn mains power ON and OFF, with light.

The switching speed of phototransistors far exceeds those of LDRs, made of CdS. The rise time for the 2N5777 is 75s and fall time is 50s. Maximum switching speed is 1KHz. Photo devices are useful in optical encoding, intrusion alarms, tape readers, level control, character recognition etc.

Nowadays packing containing an LED and a photodiode, called opto-coupler is used for switching on power or control circuits. Because the light source (LED) and photodiode are physically kept separated (with 2mm) in the package, isolation upto 2500V can be had. 555 timer

The buffer circuit's input has a very high impedance (about 1M ) so it requires only a few A, but the output can sink or source up to 200mA. This enables a high impedance signal source (such as an LDR) to switch a low impedance output transducer (such as a lamp). It is an inverting buffer or NOT gate because the output logic state (low/high) is the inverse of the input state:

Input low (< 1/3 Vs) makes output high, +Vs Input high (> 2/3 Vs) makes output low, 0V When the input voltage is between 1/3 and 2/3 Vs the output remains in its present state. This intermediate input region is a deadspace where there is no response, a property called hysteresis, it is like backlash in a mechanical linkage. This type of circuit is called a Schmitt trigger. If high sensitivity is required the hysteresis is a problem, but in many circuits it is a helpful property. It gives the input a high immunity to noise because once the circuit output has switched high or low the input must change back by at least 1/3 Vs to make the output switch back.

LIGHT EMITTING DIODE

Light emitting diode (LED) is basically a P-N junction semiconductor diode particularly designed to emit visible light. There are infrared emitting LEDs which emit invisible light. The LEDs are now available in many colours red, green and yellow. A normal LED emits at 2.4V and consumes MA of current. The LEDs are made in the form of flat tiny P-N junction enclosed in a semi-spherical dome made up of clear coloured epoxy resin. The dome of a LED acts as a lens and diffuser of light. The diameter of the base is less than a quarter of an inch. The actual diameter varies somewhat with different makes. The common circuit symbols for the LED are shown in Fig. It is similar to the conventional rectifier diode symbol with two arrows pointing out. There are two leads- one for anode and the other for cathode.

LEDs often have leads of dissimilar length and the shorter one is the cathode. All manufacturers do not strictly adhere this to. Sometimes the cathode side has a flat base. If there is doubt, the polarity of the diode should be identified. A simple bench method is to use the ohmmeter incorporating 3-volt cells for ohmmeter function. When connected with the ohmmeter: one way there will be no deflection and when connected the other way round there will be a large deflection of a pointer. When this occurs the anode lead is connected to the negative of test lead and cathode to the positive test lead of the ohmmeter.

If low range (Rxl) of the ohmmeter is used the LED would light up in most cases because the low range of ohmmeter can pass sufficient current to light up the LED.

Another safe method is to connect the test circuit shown in Fig. 2. Use any two dry cells in series with a current limiting resistor of 68 to 100 ohms. The resistor limits the forward diode current of the LED under test to a safe value. When the LED under test is connected to the test terminals in any way: if it does not light up, reverse the test leads. The LED will now light up. The anode of the LED is that which is connected to the A terminal (positive pole of the battery). This method is safe, as reverse voltage can never exceed 3 volts in this test.

ELECTRICAL CHARACTERISTICS OF LEDS: -

Electrically, a LED is similar to the conventional diode in that it has relatively low forward voltage threshold. Once this is exceeded the junction has a low slope resistance and conducts current readily. An external resistor must limit this current. Forward voltage drew across red LED is nominally 1.6 V but spread with commercial diodes, it may be as high as 2 volts or so, while the Green LED drops 2.4V. This difference accounts for use of lower limiting resistor used with the Green LED.

Another important parameter of the LED is its maximum reverse voltage rating. For typical Red device it is of the order of 3 volts. But for Green LED it is somewhat higher- 5 to 10 volts.

The LED produces light only when a d.c. current is passed in the forward direction and the amount of light emitted by a LED is proportional to the forward current over a broad range. It means that light intensity increases in an approximately linear manner with increasing current.

CIRCUIT DIGRAM:

TRAFFIC DENSITY SENSOR

Port 2

8051

PORT 1

PORT 3

8051 take cares of the timer for the signal according to the density of the traffic sensed by multiple sensors on road.

As shown in the circuit a microcontroller is programmed to automatically ON and OFF the LEDs (traffic light). The crystal oscillator is provides the necessary clocking for the

mocrocontroller to work properly. The four traffic lights, shown as 4 groups of 3 LEDs (Red, Green, Yellow), is actually installed at each of the four roads. The necessary stabilized power source is designed by the use of LM7805, as shown above (in the lower figure). The whole circuit will be implemented on a zero PCB. The programming of the Microcontroller can be done either in C or in Assembly, using a programmer.

Das könnte Ihnen auch gefallen