You are on page 1of 50

PROJECT REPORT

Microcontroller Based Intelligent Traffic Light Control System

Project Report Submitted in partial fulfillment of the requirement for the degree of
B.Tech In Electrical and Electronics Engineering

Under the supervision of Mrs. Shalini Mishra

By Sakshi Rani(39)

HOD(EEE) Prof. P. N. Avasthy

Bhagwan Parshuram Institute Of Technology Sector-17 , Rohini. Delhi-110089 May 2012


1

DECLARATION
This is to certify that project Report entitled is Microcontroller Based Intelligent Traffic Light Control System submitted by me in partial fulfillment of the requirement for the award of degree B.Tech(EEE) to BPIT,GGSIP university, Delhi comprises only my work and due acknowledgement has been made in the text to all other material used.

Date: 1 May 2012

Name of Student (Sakshi Rani)

Approved by Mrs. Shalini Mishra

Acknowledgement

I would like to take up this opportunity to express my profound sense of gratitude and respect to all those who helped me throughout this project. First of all, I express my sincere gratitude to my project guide, Mrs. Shalini Mishra, Department of Electrical and Electronics Engineering for her valuable guidance and encouragement in pursuing this project. Her inspiring suggestions and timely guidance enabled me to perceive the various aspects of the project.

I am also thankful to Prof. P. N. Avasthy , Head of the Department of Electrical and Electronics Engineering for his help and support.

I also acknowledge my gratitude to other members of faculty in the Department of Electrical and Electronics Engineering and all my friends for their whole hearted cooperation and encouragement which were critical in the development of this project. SAVITA 00420807809 VIIITH SEMESTER,EEE
3

TABLE OF CONTENTS

SYNOPSIS CIRCUIT DIAGRAM BLOCK DIAGRAM LIST OF COMPONENTS MAKING PRINTED CIRCUIT BOARD (P.C.B.) Microcontroller (AT89S52) LCD Display LED ( RED, GREEN, AMBER) IR SENSORS (RECEIVER AND TRANSMITTER)

5 6 7 8 9 10 15 17

20 23 24 25 26 27

CRYSTAL OSCILLATORS CAPACITORS VOLTAGE REGULATOR(7805) DIODE RESISTANCE 555 INTEGRATED CIRCUIT (TIMER OPERATION)

29 33 38 42 43

TRANSISTOR PROCEDURE FOR MAKING PROJECT COST OF PROJECT REFRENCES

SYNOPSIS
This project is basically a density based multicoloured LED four way traffic light control system. Its main component is the AT89S52 microcontroller. It has been programmed to drive the whole circuit. Initially AC is supplied to the 220/12V transformer which is rectified using a diode brigde rectifier and any further ripples are bypassed through a capacitor. This rectified DC is supplied to the 7805 voltage regulator which supplies adequate driving voltage to the microcontroller. The output ports of the controller are connected to the LEDs which are driven according to the program burnt in the microcontroller. an LCD display is also interfaced with AT89S52 microcontroller which displays the controlling loop of the set of traffic lights wherein the density of the traffic is being monitored. This LCD displays whether the density of the traffic is normal or is in need to be controlled. When the traffic is not much dense then the normal sequence of the loop is executed as is indicated by the LCD by N. but as soon as the traffic becomes dense, the LCD indicates by displaying a C. As far as the monitoring of the traffic density is considered, it is done using the infrared transmitter-reciever sensors. There are two pairs of IR transmitter receiver sensors which continuosly transmit and receive the infrared rays. As soon as the traffic density increases, the rays are blocked by the vehicle. If there is a blockage for 2 machine cycles, the microcontroller is interrupted as the sensing circuit sends a high signal to the INT0 pin of the microcontroller. This makes the microcontroller to jump to a loop wherein the activation of the green light increases by a factor of 10 seconds. This is how the traffic density is being monitored and controlled. As seen in the circuit diagram, there are two sets of IR sensors. This is done to make sure that the whole circuitry differentiates between the small and large vehicles in order to avoid ambiguity.

LIST OF COMPONENTS
Microcontroller (AT89S52) Transformer (220v / 12v) LCD Display LED( Red , green ,amber ) IR sensor (receiver and transmitter) Capacitor (1000uf , 10uf , 0.1uf ) Voltage regulator (7805) Oscillator (12 MHZ) Resistance Diode (1N4005) Reset switch Variable resistance Transistor Timer (555)

MAKING PRINTED CIRCUIT BOARD (P.C.B.)


INTRODUCTION-Making a Printed Circuit Board is the first step towards building electronic equipment by any electronic industry. A number of methods are available for making P.C.B., the simplest method is of drawing pattern on a copper clad board with acid resistant (etchants) ink or paint or simple nail polish on a copper clad board and do the etching process for dissolving the rest of copper pattern in acid liquid.

Making of the P.C.B. drawing involves some preliminary consideration such as thickness of lines/ holes according to the components. Now draw the sketch of P.C.B. design (tracks, rows, square) as per circuit diagram with the help of nail polish or enamel paint or any other acid resistant liquid. Dry the point surface in open air, when it is completely dried, the marked holes in P.C.B. may be drilled using 1Mm drill bits. In case there is any shorting of lines due to spilling of paint, these may be removed by scraping with a blade or a knife, after the paint has dried.

After drying, 22-30 grams of ferric chloride in 75 ml of water may be heated to about 60 degree and poured over the P.C.B. , placed with its copper side upwards in a plastic tray of about 15*20 cm. Stirring the solution helps speedy etching. The dissolution of unwanted copper would take about 45 minutes. If etching takes longer, the solution may be heated again and the process repeated. The paint on the pattern can be removed P.C.B. may then be washed and dried. Put a coat of varnish to retain the shine. Your P.C.B. is ready.

Microcontroller (AT89S52)
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. Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.The AT89S52 provides the following standard features: 8K Bytes of In-System Programmable (ISP) Flash Memory 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial Channel Watchdog Timer

10

In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware rese

Pin Configurations
AT89s52 pin diagram is as shown below. o Pins 1-8 are port 1 o Pin 9 is RST. o Pins 10-17 are Port 3 o Pins 18 &19 Crystal (XTAL) o Pin 20 GND o Pins 21-28 are Port 2 o Pins 32- 39 are port 0 o Pin 29 PSEN o Pin 30 ALE o Pin 31 VPP

11

Introduction to 89S52 Peripherals

12

The above fig. shows a simplified diagram of main peripherals present in 89s52 and their If all the peripherals described above can generate interrupt signals in the CPU according to some specific events, it can be useful to generate an interrupt signal from an external device, that may be a sensor or a Digital to Analog converter. For that purpose there are two External Interrupt sources (INT0 and INT1).

Timer 0 & 1
Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer 1 in the AT89C51 and AT89C52. Timer 0 and Timer 1, and can be independentlyconfigured to operate in a variety of modes as a timer or as an event counter. When operating as a timer, the timer/counter runs for a programmed length of time, then issues an interrupt request. When operating as a counter, the timer/counter counts negative transitions on an external pin. After a preset number of counts, the counter issues an interrupt request.

13

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 (shown in Table 5-2). 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 10-1. 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. 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. 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. 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

14

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. The values are then polled by the circuitry in the next cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer overflow.

LCD Display
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations . A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data. The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

15

Advantages & disadvantages of LCD Display

Advantages

Very compact and light. Low power consumption. No geometric distortion. Little or no flicker depending on backlight technology. Not affected by screen burn-in. Can be made in almost any size or shape. No theoretical resolution limit.

16

Disadvantages

Limited viewing angle, causing color, saturation, contrast and brightness to Only one native resolution. Displaying resolutions either requires a video

vary, even within the intended viewing angle, by variations in posture..

scaler, lowering perceptual quality, or display at 1:1 pixel mapping, in which images will be physically too large or won't fill the whole screen.

Fixed bit depth, many cheaper LCDs are only able to display 262,000

colors. 8-bit S-IPS panels can display 16 million colors and have significantly better black level, but are expensive and have slower response time.

Low bit depth results in images with unnatural or excessive contrast. Input lag Dead or stuck pixels may occur during manufacturing or through use. In a constant-on situation, thermalization may occur, which is when only

part of the screen has overheated and looks discolored compared to the rest of the screen.

Not all LCDs are designed to allow easy replacement of the backlight.

LED ( RED, GREEN, AMBER)


A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices and are increasingly used for other lighting. Early LEDs emitted low-intensity red light, but modern versions are available across the visible,ultraviolet, and infrared wavelengths. When a light-emitting diode is forward-biased (switched on), electrons are able to recombine with electron holes within the device, releasing energy in the form ofphotons. This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. LEDs are often small in area (less than 1 mm2), and integrated optical components may be used to shape its radiation pattern. LEDs present many advantages over incandescent light sources including lower energy consumption, longer lifetime,
17

improved robustness, smaller size, and faster switching. LEDs powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output.

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.

18

Advantages & disadvantages of LEDs

Advantages

Efficiency: LEDs emit more light per watt than incandescent light bulbs.
[93]

Their efficiency is not affected by shape and size, unlike fluorescent

light bulbs or tubes.

Color: LEDs can emit light of an intended color without using any color filters as traditional lighting methods need. This is more efficient and can lower initial costs.

Size: LEDs can be very small and are easily populated onto printed circuit boards. On/Off time: LEDs light up very quickly. A typical red indicator LED will achieve full brightness in under a microsecond. LEDs used in communications devices can have even faster response times.

Cool light: In contrast to most light sources, LEDs radiate very little heat in the form of IR that can cause damage to sensitive objects or fabrics. Wasted energy is dispersed as heat through the base of the LED.

Slow failure: LEDs mostly fail by dimming over time, rather than the abrupt failure of incandescent bulbs. Lifetime: LEDs can have a relatively long useful life. One report estimates 35,000 to 50,000 hours of useful life, though time to complete failure may be longer

Disadvantages
19

Temperature dependence: LED performance largely depends on the

ambient temperature of the operating environment. Over-driving an LED in high ambient temperatures may result in overheating the LED package, eventually leading to device failureVoltage sensitivity: LEDs must be supplied with the voltage above the threshold and a current below the rating. This can involve series resistors or current-regulated power supplies.

Light quality: Most cool-white LEDs have spectra that differ significantly

from a black body radiator like the sun or an incandescent light. The spike at 460 nm and dip at 500 nm can cause the color of objects to be perceived differently under cool-white LED illumination than sunlight or incandescent sources.

Area light source: Single LEDs do not approximate a point source of light

giving a spherical light distribution, but rather a lambertian distribution. So LEDs are difficult to apply to uses needing a spherical light field. LEDs cannot provide divergence below a few degrees.

Electrical Polarity: Unlike incandescent light bulbs, which illuminate

regardless of the electrical polarity, LEDs will only light with correct electrical polarity.

Applications
In general, all the LED products can be divided into two major parts, the public lighting and indoor lighting. LED uses fall into four major categories:

20

Visual signals where light goes more or less directly from the source to the Illumination where light is reflected from objects to give visual response of Measuring and interacting with processes involving no human vision.

human eye, to convey a message or meaning.

these objects.

Narrow band light sensors where LEDs operate in a reverse-bias mode and respond to incident light, instead of emitting light.

IR SENSORS (RECEIVER AND TRANSMITTER)

21

An infrared sensor is an electronic device that emits and/or detects infrared radiation in order to sense some aspect of its surroundings. Infrared sensors can measure the heat of an object, as well as detect motion. Many of these types of sensors only measure infrared radiation, rather than emitting it, and thus are known as passive infrared (PIR) sensors. All objects emit some form of thermal radiation, usually in the infrared spectrum. This radiation is invisible to our eyes, but can be detected by an infrared sensor that accepts and interprets it. In a typical infrared sensor like a motion detector, radiation enters the front and reaches the sensor itself at the center of the device. This part may be composed of more than one individual sensor, each of them being made from pyroelectric materials, whether natural or artificial. These are materials that generate an electrical voltage when heated or cooled. These pyroelectric materials are integrated into a small circuit board. They are wired in such a way so that when the sensor detects an increase in the heat of a small part of its field of view, it will trigger the motion detector's alarm. It is very common for an infrared sensor to be integrated into motion detectors like those used as part of a residential or commercial security

The infrared transmitter & receiver are designed to sense the presence or absence of partitions such that lighting functions change to accommodate the appropriate size space.

INFRARED LED'S:22

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 p-type 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.

INFRARED SENSOR::

23

WORKING OF THE INFRARED SENSOR

In this IR detector and transmitter circuit the IC 555 is working under MONOSTABLE mode. The pin 2 i.e. trigger pin and when grounded via IR receiver, the pin 3 output is low. As soon as the IR light beam transmitted is obstructed, a momentary pulse actuates the relay output (or LED). The IR transmitter is simple series connected resistor network from battery. The timing capacitor connected to pin 6 and 7 to ground. The time can varied as per requirement by changing the R value.

CRYSTAL OSCILLATOR
Crystal oscillators are oscillators where the primary frequency determining element is a quartz crystal. Because of the inherent characteristics of the quartz crystal the
24

crystal oscillator may be held to extreme accuracy of frequency stability. Temperature compensation may be applied to crystal oscillators to improve thermal stability of the crystal oscillator. Crystal oscillators are usually, fixed frequency oscillators where stability and accuracy are the primary considerations. For example it is almost impossible to design a stable and accurate LC oscillator for the upper HF and higher frequencies without resorting to some sort of crystal control. Hence the reason for crystal oscillators. The frequency of older FT-243 crystals can be moved upward by crystal grinding. I won't be discussing frequency sythesisers and direct digital synthesis (DDS) here. They are particularly interesting topics to be covered later.

A practical example of a Crystal Oscillator This is a typical example of the type of crystal oscillators which may be used for say converters. Some points of interest on crystal oscillators in relation to figure 1.

Figure 1 - schematic of a crystal oscillator The transistor could be a general purpose type with an Ft of at least 150 Mhz for HF use. A typical example would be a 2N2222A. The turns ratio on the tuned circuit depicts an anticipated nominal load of 50 ohms. This allows a theoretical 2K5 ohms on the collector. If it is followed by a buffer amplifier (highly recommended) I would simply maintain the typical 7:1 turns ratio. I have included a formula for determining L and C in the tuned circuits of crystal oscillators in case you have forgotten earlier tutorials. Personally I would make L a reactance of around 250 ohms. In this case I'd make C a smaller trimmer in parallel with a standard fixed value.

25

CAPACITORS
It is an electronic component whose function is to accumulate charges and then release it. To understand the concept of capacitance, consider a pair of metal plates which all are placed near to each other without touching. If a battery is connected to these plates the positive pole to one and the negative pole to the other, electrons from the battery will be attracted from the plate connected to the positive terminal of the battery. If the battery is then disconnected, one plate will be left with an excess of electrons, the other with a shortage, and a potential or voltage difference will exists between them. These plates will be acting as capacitors. Capacitors are of two types: (1) fixed type like ceramic, polyester, electrolytic capacitors-these names refer to the material they are made of aluminium foil. (2) Variable type like gang condenser in radio or trimmer. In fixed type capacitors, it has two leads and its value is written over its body and variable type has three leads. Unit of measurement of a capacitor is farad denoted by the symbol F. It is a very big unit of capacitance. Small unit capacitor are pico-farad denoted by pf (Ipf=1/1000,000,000,000 f) Above all, in case of electrolytic capacitors, it's two terminal are marked as (-) and (+) so check it while using capacitors in the circuit in right direction. Mistake can destroy the capacitor or entire circuit in operational.

26

CAPACITORS

VOLTAGE REGULATOR(7805)
A constant high voltage power supply can be obtained using the adaptive 3 pin voltage regulator. Depending upon the current requirement, a reasonable load regulation can be achieved. Line regulation in all cases is equal to that of the voltage regulator used.

27

Though high voltage can be obtained with suitable voltage boost circuitry using ICs like LM 723, some advantages of the circuits presented below are: simplicity, low cost, and practically reasonable regulation characteristics. For currents of the order of 1A or less, only one zener and some resistors and capacitors are needed. For higher currents, one pass transistor such as ECP055 is needed.

Before developing the final circuits, let us first understand the 3-terminal type constant voltage regulators. Let us see the schematic in Fig. where 78XX is a 3terminal voltage regulator.

28

Schematic for obtaining low-voltage regulated output using 3-terminal voltage regulators. Rectified and filtered unregulated voltage is applied at VIN and a constant voltage appears between pins 2 and 2 of the voltage regulator. It is highly recommended to use the two capacitors as shown. Electrically regulator will be at a distance from the rectifier supply. Thus, a tantalum grade capacitor of 5mf and rated voltage is good. Electrolytic capacitor is not suitable for it is poor in response to load transients, which have high frequency components. At the output side a 0.22mf disc ceramic capacitor is useful to eliminate spurious oscillations, which the regulator might break into because of its internal high gain circuitry.

These voltage regulators have a typical bias current of 5 mA, which is reasonably constant. By inserting a small resistor Rx between pin 2 and ground, the output voltage in many cases. By this method voltage increment of 5 to 10 per cent is practically feasible. However, if a high-value resistance is used to obtain a higher output voltage, a slight variation in bias current will result in wide variation of the output voltage.

DIODE
The simplest semiconductor device is made up of a sandwich of P-type semiconducting material, with contacts provided to connect the p-and n-type layers to an external circuit. This is a junction Diode. If the positive terminal of the battery is
29

connected to the p-type material (cathode) and the negative terminal to the N-type material (Anode), a large current will flow. This is called forward current or forward biased. If the connections are reversed, a very little current will flow. This is because under this condition, the p-type material will accept the electrons from the negative terminal of the battery and the N-type material will give up its free electrons to the battery, resulting in the state of electrical equilibrium since the Ntype material has no more electrons. Thus there will be a small current to flow and the diode is called Reverse biased. Thus the Diode allows direct current to pass only in one direction while blocking it in the other direction. Power diodes are used in concerting AC into DC. In this, current will flow freely during the first half cycle (forward biased) and practically not at all during the other half cycle (reverse biased). This makes the diode an effective rectifier, which convert ac into pulsating dc. Signal diodes are used in radio circuits for detection. Zener diodes are used in the circuit to control the voltage.

30

RESISTANCE
Resistance is the opposition of a material to the current. It is measured in Ohms ( All conductors represent a certain amount of resistance, since no ). conductor is 100% efficient. To control the electron flow (current) in a predictable manner, we use resistors. Electronic circuits use calibrated lumped resistance to control the flow of current. Broadly speaking, resistor can be divided into two groups viz. fixed & adjustable (variable) resistors. In fixed resistors, the value is fixed & cannot be varied. In variable resistors, the resistance value can be varied by an adjuster knob. It can be divided into (a) Carbon composition (b) Wire wound (c) Special type. The most common type of resistors used in our projects is carbon type. The resistance value is normally indicated by colour bands. Each resistance has four colours, one of the band on either side will be gold or silver, this is called fourth band and indicates the tolerance, others three band will give the value of resistance (see table). For example if a resistor has the following marking on it say red, violet, gold. Comparing these coloured rings with the colour code, its value is 27000 ohms or 27 kilo ohms and its tolerance is 5%. Resistor comes in various sizes (Power rating). The bigger, the size, the more power rating of 1/4 watts. The four colour rings on its body tells us the value of resistor value.

COLOURS CODE Black-----------------------------------------------------0


31

Brown----------------------------------------------------1 Red--------------------------------------------------------2 Orange----------------------------------------------------3 Yellow----------------------------------------------------4 Green-----------------------------------------------------5 Blue-------------------------------------------------------6 Violet-----------------------------------------------------7 Grey------------------------------------------------------8 White-----------------------------------------------------9

32

The first rings give the first digit. The second ring gives the second digit. The third ring indicates the number of zeroes to be placed after the digits. The fourth ring gives tolerance (gold 5%, silver 10%, No colour 20%). In variable resistors, we have the dial type of resistance boxes. There is a knob with a metal pointer. This presses over brass pieces placed along a circle with some space b/w each of them.

33

Resistance coils of different values are connected b/w the gaps. When the knob is rotated, the pointer also moves over the brass pieces. If a gap is skipped over, its resistance is included in the circuit. If two gaps are skipped over, the resistances of both together are included in the circuit and so on.

555 INTEGRATED CIRCUIT (TIMER OPERATION)

The 555 integrated circuit is an extremely versatile timer that can be used in many different applications. This IC is a monolithic timing circuit that is a highly stable controller capable of producing accurate time delays or oscillations. Additional terminals are producing are provided for triggering or resetting if desires. In the time delay mode of resistance and a capacitor. For a stable operation as an oscillator, the free running frequency and the duty cycle are both accurately controlled with two external resistors and one capacitor. The circuit may be triggered and reset on falling waveforms, and the output structure can source or sink up to 200ma or drive TTL Circuits. This integrated circuit contains nearly 25 transistor, a diode or two, and more than 10 resistors. Obviously, if you built this IC from separate components, it would be many, many times larger than on a monolithic chip.

The 555 timer offers timing from microseconds through hours and operates in both astable and monostable modes. It has an adjustable duty cycle, and the output can drive TTL devices. Its output can operate in normally on and normally off modes and the IC offers a frequency stability of 0.005% per degrees centigrade.

34

Applications for the 555 chip include precision timing, pulse generation, pulse width modulation, pulse position modulation, sequential timing, and missing pulse detection.

555-INTEGRATED CIRCUIT

35

IC 555-ASTABLE OPERATIONS
If the circuit is connected as shown in figure (pins 2 and 6 connected). It will trigger itself and free run as a multivibrator. The external capacitor charges through Ra and Rb and discharges through Rb only. Thus, the duty cycle may be precisely set by the ratio of these two resistors. In this mode of operation the capacitor charges and discharges between 1/3 Vcc and 2/3 Vcc. As in the triggered mode, the charge and discharges times, and therefore, the frequency are independent of the supply voltage. Figure shows the actual waveforms generated in this mode of operation. The charge time (output high) is given by: t1 = 0.685 (Ra + Rb) C

And the discharge time (output low) by: t2 = 0.685 (Rb) C

Thus, the total period is given by: T = t1 + t2 = 0.685 (Ra + 2Rb) C

The frequency of oscillation is then: f= 1.46

(Ra + 2Rb) C

36

IC 555 MONOSTABLE OPERATIONS


In the monostable mode of operation, the timer functions as a one shot. Referring to figure the external capacitor is initially held discharged by a transistor inside the timer. Upon applications of a negative trigger pulse to pin 2, the flip-flop is set, which releases the short circuit across the external capacitor and drives the output high. The voltage across the capacitor increases exponentially with the time constant. t = Ra C When the voltage across the capacitor equals 2/3 Vcc. The comparator resets the flip-flop, which, in turn, discharges the capacitor rapidly and drives the output to its low state. Figure shows the actual waveforms generated in this mode of operation. The circuit triggers on a negative going input signal when the level reaches 1/3 Vcc. Once triggered, the circuit will remain in this state until the set time is elapsed, even if it is triggered again during this interval. The time that the output is in the high state is given by: t= 1.1 Ra C Applying a negative pulse to the reset terminal (pin 4) during the timing cycle discharges the external capacitor and causes the cycle to start over again. The timing cycle will now commence on the positive edge of the reset pulse. During the time the reset pulse is applied, the output is driven to its low state.

37

TRANSISTOR
The name is transistor derived from transfer resistors indicating a solid state Semiconductor device. In addition to conductor and insulators, there is a third class of material that exhibits proportion of both. Under some conditions, it acts as an insulator, and under other conditions its a conductor. This phenomenon is called Semi-conducting and allows a variable control over electron flow. So, the transistor is semi conductor device used in electronics for amplitude. Transistor has three terminals, one is the collector, one is the base and other is the emitter, (each lead must be connected in the circuit correctly and only then the transistor will function). Electrons are emitted via one terminal and collected on another terminal, while the third terminal acts as a control element. Each transistor has a number marked on its body. Every number has its own specifications.

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

NPN Transistors:
38

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

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

Transistor is a combination of semi-conductor elements allowing a controlled current flow. Germanium and Silicon is the two semi-conductor elements used for making it. There are two types of transistors such as POINT CONTACT and JUNCTION TRANSISTORS. Point contact construction is defective so is now out of use. Junction triode transistors are in many respects analogous to triode electron tube.

A junction transistor can function as an amplifier or oscillator as can a triode tube, but has the additional advantage of long life, small size, ruggedness and absence of cathode heating power.
39

1) PNP TYPE: This is formed by joining a layer of P type of germanium to an N-P Junction

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

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

OPERATION OF PNP TRANSISTOR:-

40

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

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

1)

A substantial current flows through it when the emitter junction is biased in a forward direction.

41

2) The current flowing across the collector is slightly less than that of the emitter, and

3)

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

the change

The facts can be explained as follows:-

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

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

3. When the emitter current increases, most holes are injected into

the

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

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

42

PROCEDURE FOR MAKING PROJECT


Building project in the proper manner is really an art, something which must be prectised and learned through trial and error, it is not all that difficult. The main thing is to remember to take each step slowly and carefully

43

according to the instructions giving making since that everything at it should be before proceeding further.

TOOLS:

The electronics workbench is an actual place of work with comfortably & conveniently & should be supplied with compliment of those tools must often use in project building. Probably the most important device is a soldering tool. Other tool which should be at the electronic work bench includes a pair of needle nose pliers, diagonal wire cutter, a small knife, an assortment of screw driver, nut driver, few nuts & bolts, electrical tape, puckers etc. Diagonal wire cutter will be used to cut away any excess lead length from copper side of P.C.B. 7 to cut section of the board after the circuit is complete. The needle nose pliers are most often using to bend wire leads & wrap them in order to form a strong mechanical connection.

MOUNTING & SOLDERING: Soldering is process of


joining together two metallic parts. It is actually a process of function in which an alloy, the solder, with a comparatively low melting point penetrates the surface of the metal being joined & makes a firm joint between them on cooling & solidifying.

THE SOLDERING KIT


1. SOLDERING IRON:

As soldering is a process of joining together two metallic parts, the instrument, which is used, for doing this job is known as soldering Iron.

44

Thus it is meant for melting the solder and to setup the metal parts being joined. Soldering Iron is rated according to their wattage, which varies from 10- 200 watts.

2.

SOLDER:

The raw material used for soldering is solder. It is composition of lead & tin. The good quality solder (a type of flexible naked wire) is 60% Tin +40% Lead which will melt between 180 degree to 200 degree C temperature.

3.

FLUXES OR SOLDERING PASTE:

When the points to solder are heated, an oxide film forms. This must be removed at once so that solder may get to the surface of the metal parts. This is done by applying chemical substance called Flux, which boils under the heat of the iron remove the oxide formation and enable the metal to receive the solder. 4. BLADES OR KNIFE:

To clean the surface & leads of components to be soldered is done by this common instrument.

5.

SAND PAPER:

The oxide formation may attack at the tip of your soldering iron & create the problem. To prevent this, clean the tip with the help of sand paper time to time or you may use blade for doing this job. Apart from all these tools, the working bench for soldering also includes desoldering pump, wink wire (used for desoldering purpose), file etc.

HOW TO SOLDER?

Mount components at their appropriate place; bend the leads slightly outwards to prevent them from falling out when the board is turned over for soldering. No cut the leads so that you may solder them easily. Apply a small amount of flux at these components leads with the help of a screwdriver. Now fix the bit or iron with a small amount of solder and flow freely at the point and the
45

P.C.B copper track at the same time. A good solder joint will appear smooth & shiny. If all appear well, you may continue to the next solder connections.

TIPS FOR GOOD SOLDERING

1. Use right type of soldering iron. A small efficient soldering iron (about 10-25 watts with 1/8 or 1/4 inch tip) is ideal for this work.

2. Keep the hot tip of the soldering iron on a piece of metal so that excess heat is dissipated.

3. Make sure that connection to the soldered is clean. Wax frayed insulation and other substances cause poor soldering connection. Clean the leads, wires, tags etc. before soldering.

4. Use just enough solder to cover the lead to be soldered. Excess solder can cause a short circuit.

5. Use sufficient heat. This is the essence of good soldering. Apply enough heat to the component lead. You are not using enough heat, if the solder barely melts and forms a round ball of rough flaky solder. A good solder joint will look smooth, shining and spread type. The difference between good & bad soldering is just a few seconds extra with a hot iron applied firmly.

46

PRECAUTIONS
1. Mount the components at the appropriate places before soldering. Follow the circuit description and components details, leads identification etc. Do not start soldering before making it confirm that all the components are mounted at the right place.

2.

Do not use a spread solder on the board, it may cause short circuit.

47

3.

Do not sit under the fan while soldering.

4.

Position the board so that gravity tends to keep the solder where you want it.

5.

Do not over heat the components at the board. Excess heat may damage the components or board.

6.

The board should not vibrate while soldering otherwise you have a dry or a cold joint.

7.

Do not put the kit under or over voltage source. Be sure about the voltage either dc or ac while operating the gadget.

COST OF PROJECT
Microcontroller (AT89S52) Cost of microcontroller chip burning Transformer (220v / 12v) LCD Display LED( Red , green ,amber ) Rs 220 Rs 100 Rs 60 Rs 170 Rs 30

48

IR sensor (receiver and transmitter) Capacitor (1000uf , 10uf , 0.1uf ) Voltage regulator (7805) Oscillator (12 MHZ) Resistance Diode (1N4005) Reset switch Variable resistance Transistor Timer (555) PCB Soldering iron & wire cost Others

Rs 50 Rs 35 Rs 50 Rs 55 Rs 20 Rs 20 Rs 15 Rs 35 Rs 20 Rs 30 Rs 120 Rs 220 Rs 200

Total cost

RS 1450

REFERENCES

Elektor magazine Electronics for You magazines


49

www.atmel.com www.wikipedia.com

50

You might also like