rahul shrivas & group

Upload: rahul-shrivas

Post on 07-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Rahul Shrivas & Group

    1/43

    S.NO.

    SUBJECT PAGENO.

    1 INTRODUCTION

    2 CIRCUIT DIAGRAM

    3 FLOW CHART

    4 LIST OF COMPONENTS

    5 DTA SHEET OFCONTROLLER & LM293D

    6 OPERATION ANDWORKING

    7 APPLICATION

    8 REFERENCE

    INTRODUCTION

  • 8/6/2019 Rahul Shrivas & Group

    2/43

  • 8/6/2019 Rahul Shrivas & Group

    3/43

  • 8/6/2019 Rahul Shrivas & Group

    4/43

    CIRCUIT COMPONENTS

    RESISTOR

    A Resistor is a two-terminal passive electronic component which implements

    electrical resistance as a circuit element. When a voltage V is applied across the terminals of a

    resistor, a current I will flow through the resistor in direct proportion to that voltage. The

    reciprocal of the constant of proportionality is known as the resistance R, since, with a given

    voltage V, a larger value of R further "resists" the flow of current I as given by Ohm's law:

    I=V/R

    Resistors are common elements of electrical networks and electronic circuits and

    are ubiquitous in most electronic equipment. Practical resistors can be made of various

    compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as

    nickel-chrome). Resistors are also implemented within integrated circuits, particularly analog

    devices, and can also be integrated into hybrid and printed circuits.

    The electrical functionality of a resistor is specified by its resistance: common

    commercial resistors are manufactured over a range of more than 9 orders of magnitude. Whenspecifying that resistance in an electronic design, the required precision of the resistance may

    require attention to the manufacturing tolerance of the chosen resistor, according to its specific

    application. The temperature coefficient of the resistance may also be of concern in some

    precision applications.

  • 8/6/2019 Rahul Shrivas & Group

    5/43

    Practical resistors are also specified as having a maximum power rating which

    must exceed the anticipated power dissipation of that resistor in a particular circuit: this is

    mainly of concern in power electronics applications. Resistors with higher power ratings are

    physically larger and may require heat sinking. In a high voltage circuit, attention must

    sometimes be paid to the rated maximum working voltage of the resistor.

    They are not normally specified individually for a particular family of resistors

    manufactured using a particular technology. A family of discrete resistors is also characterized

    according to its form factor, that is, the size of the device and position of its leads (or terminals)

    which is relevant in the practical manufacturing of circuits using them.

    COLOUR CODING FOR RESISTOR:

  • 8/6/2019 Rahul Shrivas & Group

    6/43

    CAPACITOR

  • 8/6/2019 Rahul Shrivas & Group

    7/43

  • 8/6/2019 Rahul Shrivas & Group

    8/43

  • 8/6/2019 Rahul Shrivas & Group

    9/43

    Electrolytic capacitors are the most popular type for values greater than about 1

    microfarad. Electrolytic capacitors are constructed using a thin film of oxide on an aluminium

    foil. An electrolyte is used to make contact with the other plate. The two plates are wound

    around on one another and then placed into a can that is often aluminium. Electrolytic capacitors

    have a wide tolerance. Typically the value of the component may be stated with a tolerance of

    -50% +100%.

    Tantalum capacitor

    Ordinary aluminium electrolytic capacitors are rather large for many uses. In

    applications where size is of importance tantalum capacitors may be used. These are much

    smaller than the aluminium electrolytic capacitors and instead of using a film of oxide on

    aluminium they us a film of oxide on tantalum. Tantalum capacitors do not normally have high

    working voltages, 35V is normally the maximum, and some even have values of only a volt or

    so.

    Silver Mica Capacitor

    Silver mica capacitorSilver mica capacitors are not as widely used these days as

    they used to be. In view of this one of their major uses is within the tuned elements of circuits

    like oscillators, or within filters. Values are normally in the range between a few picofarads up

    to two or possibly three thousand picofarads. For this type of capacitor the silver electrodes are

    plated directly on to the mica dielectric.

    Polystyrene Film Capacitor

    Polystyrene capacitors are a relatively cheap form of capacitor. They are tubular in

    shape resulting from the fact that the plate / dielectric sandwich is rolled together. This adds

    some inductance and means that they are only suitable for relatively low frequency circuits,

    typically up to a few hundred kHz. In view of their relatively good tolerance levels they can be

    used in filter circuits, etc where values are of importance. They are generally only available as

    leaded electronics components.

    Polyester Film Capacitor

  • 8/6/2019 Rahul Shrivas & Group

    10/43

    Polyester capacitorPolyester film capacitors are used where cost is a consideration

    as they do not offer a high tolerance. Many polyester film capacitors have a tolerance of 5% or

    10%, which is adequate for many applications. They are generally only available as leaded

    electronics components.

    Metallised Polyester Film Capacitor

    This type of capacitor is a essentially a form of polyester film capacitor where the

    polyester films themselves are metallised. The advantage of using this process is that because

    their electrodes are thin, the overall capacitor can be contained within a relatively small package.

    The metallised polyester film capacitors are generally only available as leaded electronics

    components.

    Polycarbonate capacitor

    Polycarbonate capacitors have earned a place as a reliable form of capacitor for

    use in a number of applications where performance is critical. The polycarbonate film is very

    stable and this enables high tolerance capacitors to be made which will hold their capacitance

    value over time. In addition they have a low dissipation factor, and they remain stable over awide temperature range, many being specified from -55C to +125C.

    In 2000 the Bauer Corporation announced they would be ceasing manufacture of

    the raw dielectric. As a result many of the manufacturers of polycarbonate ceased production.

    Fortunately there are a few smaller manufacturers of these capacitors, so they can still be

    obtained. Read more about the polycarbonate capacitor

    Polypropylene Capacitor

    The polypropylene is sometimes used when a higher tolerance is necessary than

    polyester capacitors offer. As the name implies, this capacitor uses a polypropylene film for thedielectric. One of the advantages of the capacitor is that there is very little change of capacitance

    with time and voltage applied. They are also used for low frequencies, with 100 kHz or so being

    the upper limit. They are generally only available as leaded electronics component.

    Summary of Capacitor Types:

  • 8/6/2019 Rahul Shrivas & Group

    11/43

    Capacitortypes

    Capacitancerange

    AccuracyTemperaturestability

    Leakage Comments & details

    Electrolytic 0.1 F - ~1 F V poor V poor Poor

    Polarised capacitor - widelyused in power supplies for

    smoothing, and bypasswhere accuracy, etc is notrequired.

    Ceramic 10 pF - 1 F Variable Variable AverageExact performance ofcapacitor depends to a largeextent on the ceramic used.

    Tantalum0.1 F - 500F

    Poor Poor PoorPolarised capacitor - veryhigh capacitance density.

    Silver mica1 pF - 3000pF

    Good Good Good

    Rather expensive and large -not widely used these daysexcept when small value

    accurate capacitors areneeded.

    Polyester(Mylar)

    0.001 F - 50F

    Good Poor GoodInexpensive, and popular fornon-demanding applications.

    Polystyrene 10 pF - 1 F V good Good V goodHigh quality, often used infilters and the like whereaccuracy is needed.

    Polycarbonate100 pF - 20F

    V good V good Good

    Used in many high toleranceand hash environmentalconditions. Supply nowrestricted.

    Polypropylene 100pF - 50 F V good Good V good High performance and lowdielectric absorption.

    Teflon 100 pF - 1 F V good V v good V v goodHigh performance - lowestdielectric absorption.

    Glass10 pF - 1000pF

    Good Good V good

    Excellent for very harshenvironments while offeringgood stability. Veryexpensive.

    Porcelain100 pF - 0.1F

    Good Good Good Good long term stability

    BUZZER

    WORKING:

    Buzzer is an electromagnetic type audio signaling device, which has a coilinside which oscillates a metal plate against another, which when given voltage difference

  • 8/6/2019 Rahul Shrivas & Group

    12/43

    produces sound of a predefined frequency. You must be aware of such sounds of buzzer like

    BEEP sound in many appliances.

    A piezoelectric element may be driven by an oscillating electronic circuit orother audio signal source, driven with a piezoelectric audio amplifier. Sounds commonly used to

    indicate that a button has been pressed are a click, a ring or a beep.

    FEATURES:

    These high reliability electromagnetic buzzers are applicable to general electronics

    equipment.

    Compact, pin terminal type electromagnetic buzzer with 2048 Hz output.

    Pin type terminal construction enables direct mounting onto printed circuit boards.

    APPLICATIONS:

    Security Alerts, Clocks, travel watches, keyboards, toys, various alarms of

    equipments.

    SPECIFICATION:

  • 8/6/2019 Rahul Shrivas & Group

    13/43

    OPERATING CIRCUIT:

    As the buzzer uses a coil, it has an inductive load. Protect the drive circuit by

    putting the diodes in parallel into the buzzer.

    Piezo Buzzer mainly consists of a multi-vibrator circuit,piezoelectric buzzer films, and the resonance box, shell etc. Multivibrator constits oftransistors or integrated circuits. When switched on, after (1.5 ~ 15V DC workingvoltage), multi-harmonic oscillator start-up, output 1.5 ~ 2.5kHZ of audio signals,which results in audible sound.

    Piezoelectric Buzzer contains zirconate titanate films from lead or

    lead magnesium niobate piezoelectric ceramic materials. On both sides of theceramic coating on the silver electrode by polarization and aging treatment, andthen with the brass plates or stainless steel sheets stick together.

    DIMENSION:

  • 8/6/2019 Rahul Shrivas & Group

    14/43

    Electromagnetic Buzzer works from the oscillator, theelectromagnetic coil, magnet, diaphragm and shell so on. After power on, the audiooscillator signal current through the electromagnetic coil, so that the

    electromagnetic coil produces a magnetic field. Diaphragm in the electromagneticcoil and magnet interaction, periodically vibrating voice and thus the audible note.There are too Electromagnetic Buzzers which works without any oscillator. Thesework by the frequency produced by the make and break contacts to the coil inrelation to the moving diaphragm.

    FREQUENCY CHARACTERISTICS:

  • 8/6/2019 Rahul Shrivas & Group

    15/43

    IC 555 TIMER

    The 555 timer IC was first introduced around 1971 by the Signetics Corporation as

    the SE555/NE555 and was called "The IC Time Machine" and was also the very first and only

    commercial timer ic available. It provided circuit designers and hobby tinkerers with a relatively

    cheap, stable and user-friendly integrated circuit for both monostable and astable applications.

    The 555, come in two packages, either the round metal-can called the 'T' package

    or the more familiar 8-pin DIP 'V' package. About 20-years ago the metal-can type was pretty

    much the standard (SE/NE types). The 556 timer is a dual 555 version and comes in a 14-pin

    DIP package, the 558 is a quad version with four 555's also in a 14 pin DIP case.

    Inside the 555 timer, are the equivalent of over 20 transistors, 15 resistors, and 2

    diodes, depending of the manufacturer. The equivalent circuit, in block diagram, providing the

    functions of control, triggering, level sensing or comparison, discharge, and power output. Some

    of the more attractive features of the 555 timer are: Supply voltage between 4.5 and 18 volt,

    supply current 3 to 6 mA, and a Rise/Fall time of 100 nSec.

    General Description:

    The LM555 is a highly stable device for generating accurate time delays or

    oscillation. Additional terminals are provided for triggering or resetting if desired. In the time

    delay mode of operation, the time is precisely controlled by one external resistor and capacitor.

    For astable operation as an oscillator, the free running frequency and duty cycle are accurately

    controlled with two external resistors and one capacitor. The circuit may be triggered and reset

    on falling waveforms, and the output circuit can source or sink up to 200mA or drive TTL

    circuits.

    Features:

    Direct replacement for SE555/NE555

    Timing from microseconds through hours

    Operates in both astable and monostable modes

    Adjustable duty cycle

    Output can source or sink 200 mA

    Output and supply TTL compatible

    Temperature stability better than 0.005% per C

    Pin Diagram:

  • 8/6/2019 Rahul Shrivas & Group

    16/43

    Pin 1 (Ground):The ground (or common) pin is the most-negative supply potential of the

    device, which is normally connected to circuit common (ground) when operated from positive

    supply voltages.

    Pin 2 (Trigger):This pin is the input to the lower comparator and is used to set the latch, which

    in turn causes the output to go high. This is the beginning of the timing sequence in monostable

    operation. Triggering is accomplished by taking the pin from above to below a voltage level of

    1/3V+(or,in general,one-half the voltage appearing at pin 5).

    Pin 3 (Output):The output of the 555 comes from a high-current totem-pole stage made up of

    transistors Q20 - Q24. Transistors Q21 and Q22 provide drive for source-type loads, and their

    Darlington connection provides a high-state output voltage about 1.7 volts less than the V+

    supply level used.

    Pin 4 (Reset): This pin is also used to reset the latch and return the output to a low state. The

    reset voltage threshold level is 0.7 volt, and a sink current of 0.1mA from this pin is required to

    reset the device. These levels are relatively independent of operating V+ level;Thus the reset

    input is TTL compatible for any supply voltage. The reset input is an overriding function; that is,

    it will force the output to a low state regardless of the state of either of the other inputs.

    Pin 5 (Control Voltage):This pin allows direct access to the 2/3 V+ voltage-divider point, the

    reference level for the upper comparator. It also allows indirect access to the lower comparator,

  • 8/6/2019 Rahul Shrivas & Group

    17/43

    as there is a 2:1 divider (R8 - R9) from this point to the lower-comparator reference input, Q13.

    Use of this terminal is the option of the user, but it does allow extreme flexibility by permitting

    modification of the timing period, resetting of the comparator, etc.

    Pin 6 (Threshold):Pin 6 is one input to the upper comparator (the other being pin 5) and is used

    to reset the latch, which causes the output to go low. Resetting via this terminal is accomplishedby taking the terminal from below to above a voltage level of 2/3 V+ (the normal voltage on pin

    5). The action of the threshold pin is level sensitive, allowing slow rate-of-change waveforms.

    The voltage range that can safely be applied to the threshold pin is between V+ and ground.

    Pin 7 (Discharge):This pin is connected to the open collector of a npn transistor (Q14), the

    emitter of which goes to ground, so that when the transistor is turned "on", pin 7 is effectively

    shorted to ground. Usually the timing capacitor is connected between pin 7 and ground and is

    discharged when the transistor turns "on". The conduction state of this transistor is identical in

    timing to that of the output stage

    Pin 8 (V +):The V+ pin (also referred to as Vcc) is the positive supply voltage terminal of the555 timer IC. Supply-voltage operating range for the 555 is +4.5 volts (minimum) to +16 volts

    (maximum), and it is specified for operation between +5 volts and +15 volts. The device will

    operate essentially the same over this range of voltages without change in timing period.

    WORKING OF ASTABLE MULTIVIBRATOR:

    The circuit diagram for the astable multivibrator using IC 555 is shown here. The

    astable multivibrator generates a square wave, the period of which is determined by the circuit

    external to IC 555. The astable multivibrator does not require any external trigger to change the

    state of the output. Hence the name free running oscillator.

    The time during which the output is either high or low is determined by the two

    resistors and a capacitor which are externally connected to the 555 timer. The above figure

    shows the 555 timer connected as an astable multivibrator. Initially when the output is high

    capacitor C starts charging towards Vcc through RA and RB.

    However as soon as the voltage across the capacitor equals 2/3 Vcc , comparator1

    triggers the flip-flop and the output switches to low state. Now capacitor C discharges through

    RB and the transistor Q1. When voltage across C equals 1/3 Vcc, comparator 2s outputtriggers the flip- flop and the output goes high. Then the cycle repeats.

  • 8/6/2019 Rahul Shrivas & Group

    18/43

    The capacitor is periodically charged and discharged between 2/3 Vcc and 1/3Vcc respectively. The time during which the capacitor charges from 1/3 Vcc to 2/3 Vcc is equalto the time the output remains high and is given by where RA and RB are in ohms and C is inFarads. Similarly the time during which the capacitor discharges from 2/3 Vcc to 1/3 Vcc isequal to the time the output is low.

  • 8/6/2019 Rahul Shrivas & Group

    19/43

    MONOSTABLE MULTIVIBRATOR:

    In the monostable multivibrator, the one resistive-capacitive network (C 2-R3 in

    figure 1) is replaced by a resistive network (just a resistor). The circuit can be thought as a 1/2

    Q2 collector voltage is the output of the circuit (in contrast it has a perfect square waveform

    since the output is not loaded by the capacitor).

    In this figure Basic bistable multivibrator (suggested values:R1, R2= 1 kR3, R4 = 10 K

    When triggered by an input pulse, a monostable multivibrator will switch to its

    unstable position for a period of time, and then return to its stable state. The time period

    monostable multivibrator remains in unstable state is given by t= ln(2)R2C1. If repeated

    application of the input pulse maintains the circuit in the unstable state, it is called

    http://en.wikipedia.org/wiki/File:Transistor_Bistable.svg
  • 8/6/2019 Rahul Shrivas & Group

    20/43

    a retriggerable monostable. If further trigger pulses do not affect the period, the circuit is a non-

    retriggerable multivibrator.

    For the circuit in Figure in the stable state Q1 is turned off and Q2 is turned on. It

    is triggered by zero or negative input signal applied to Q2 base (with the same success it can be

    triggered by applying a positive input signal through a resistor to Q1 base). As a result, the

    circuit goes in described above. After elapsing the time, it returns to its stable initial state.

    BISTABLE MULTIVIBRATOR:

    As the name implies, the bistable multivibrator has two stable states. If a

    trigger of the correct polarity and amplitude is applied to the circuit, it will change states andremain there until triggered again. The trigger need not have a fixed prf; in fact, triggers from

    different sources, occurring at different times, can be used to switch this circuit.

  • 8/6/2019 Rahul Shrivas & Group

    21/43

    The bistable multi vibrator circuit and the associated waveforms are shown in

    figure 3-17, views (A) and (B), respectively. In this circuit, R1 and R7 are the collector load

    resistors. Voltage dividers R1, R2,and R5 provide forward bias for Q2; R7, R6, and R3 provide

    forward bias for Q1. These resistors also couple the collector signal from one transistor to the1base of the other.

    Observe that this is direct coupling of feedback. This type of coupling is requiredbecause the circuit depends on input triggers for operation , not on RC time constants inside the

    circuit. Both transistors use common emitter resistor R4 which provides emitter coupling. C1

    and C2 couple the input triggers to the transistor bases

    In the bistable multi vibrator, both the resistive-capacitive network are replaced by

    resistive networks (just resistors or direct coupling).This circuit is similar to an astable multi

    vibrator, except that there is no charge or discharge time, due to the absence of capacitors.

    Hence, when the circuit is switched on, if Q1 is on, its collector is at 0 V. As a result, Q2 gets

    switched off.

    The results in more than half +Vvolts being applied to R4 causing current into the

    base of Q1, thus keeping it on. Thus, the circuit remains stable in a single state continuously.

    Similarly, Q2 remains on continuously, if it happens to get switched on first. Switching of state

    can be done via Set and Reset terminals connected to the bases. For example, if Q2 is on and Set

  • 8/6/2019 Rahul Shrivas & Group

    22/43

    is grounded momentarily, this switches Q2 off, and makes Q1 on. Thus, Set is used to "set" Q1

    on, and Reset is used to "reset" it to off state.

    DATA SHEET OF CONTROLLER

    1.0 DEVICE OVERVIEWThis document contains device specific information for the following devices:This family offers the advantages of all PIC18 microcontrollers

  • 8/6/2019 Rahul Shrivas & Group

    23/43

    namely, high computational performance at an economical price with the addition of highendurance, Enhanced Flash program memory. On top of these features, thePIC18F2525/2620/4525/4620 family introduces design enhancements that make thesemicrocontrollers a logical choice for many high-performance, power sensitive applications.

    1.1 New Core Features

    1.1.1 nanoWatt TECHNOLOGY All of the devices in the PIC18F2525/2620/4525/4620family incorporate a range of features that can significantly reduce power consumption duringoperation.

    Key items include: Alternate Run Modes: By clocking the controller from the Timer1 source or the internaloscillator block, power consumption during code execution can be reduced by as much as 90%. Multiple Idle Modes: The controller can also runwith its CPU core disabled but theperipherals still active. In these states, power consumption can be reduced even further, to aslittle as 4% of normal operation requirements.

    On-the-fly Mode Switching: The power managed modes are invoked by user code duringoperation, allowing the user to incorporate power-saving ideas into their applicationssoftware design. Low Consumption in Key Modules: The power requirements for both Timer1 and theWatchdog Timer are minimized. SeeSection 26.0 Electrical Characteristics fortime-out periods

    1.1.2 MULTIPLE OSCILLATOR OPTIONSAND FEATURES

    All of the devices in the PIC18F2525/2620/4525/4620 family offer ten different oscillatoroptions, allowing users a wide range of choices in developing application hardware. These

    include: Four Crystal modes, using crystals or ceramic resonators Two External Clock modes, offering the option ofusing two pins (oscillator input and a divide-by-4clock output) or one pin (oscillator input, with the second pin reassigned as general I/O) Two External RC Oscillator modes with the same pin options as the External Clock modes An internal oscillator block which provides an 8 MHz clock and an INTRC source(approximately 31 kHz), as well as a range of 6 user selectable clock frequencies, between125 kHz to 4 MHz, for a total of 8 clock frequencie. This option frees the two oscillator pins foruse asadditional general purpose I/O. A Phase Lock Loop (PLL) frequency multiplier, available to both the high-speed crystal andinternal oscillator modes, which allows clock speeds of up to 40 MHz. Used with the internaloscillator, the PLL gives users a complete selection of clock speeds, from 31 kHz to 32 MHz all without using an external crystal or clock circuit. Besides its availability as a clock source,the internal oscillator block provides a stable reference source thatgives the family additionalfeatures for robustoperation:

    Fail-Safe Clock Monitor: This option constantly monitors the main clock source against areference signal provided by the internal oscillator. If a clock failure occurs, the controller is

  • 8/6/2019 Rahul Shrivas & Group

    24/43

    switched to the internal oscillator block, allowing for continued low-speed operation or a safeapplication shutdown. Two-Speed Start-up: This option allows the internal oscillator to serve as the clock sourcefrom Power-on Reset, or wake-up from Sleep mode, until the primary clock source is available.1.2 Other Special Features

    Memory Endurance: The Enhanced Flash cells for both program memory and data EEPROMare rated to last for many thousands of erase/write cycles up to 100,000 for program memoryand 1,000,000 for EEPROM. Data retention without refresh is conservatively estimated to begreater than 40 years. Self-programmability: These devices can write to their own program memory spaces underinternal software control. By using a bootloader routine located in the protected Boot Block atthe top of program memory, it becomes possible to createan application that can update itself inthe field. Extended Instruction Set: The PIC18F2525/ 2620/4525/4620 family introduces an optionalextension to the PIC18 instruction set, which adds 8 new instructions and an Indexed Addressing

    mode. This extension, enabled as a device configuration option, has been specifically designedto optimize re-entrant application code originally developed in high-level languages, such as C. Enhanced CCP module: In PWM mode, this module provides 1, 2 or 4 modulated outputs forcontrolling half-bridge and full-bridge drivers. Other features include auto-shutdown, fordisabling PWM outputs on interrupt or other select conditions and auto-restart, to reactivateoutputs once the condition has cleared. Enhanced Addressable USART: This serial communication module is capable of standardRS-232 operation and provides support for the LIN bus protocol. Other enhancements includeautomatic baud rate detection and a 16-bit Baud Rate Generator for improved resolution. Whenthe microcontroller is using the internal oscillator block, the USART provides stable operationfor applications that talk to the outside world without using an external crystal (or itsaccompanying power requirement). 10-bit A/D Converter: This module incorporates programmable acquisition time, allowing fora channel to be selected and a conversion to be initiated without waiting for a sampling periodand thus, reduce code overhead. Extended Watchdog Timer (WDT): This Enhanced version incorporates a 16-bit prescaler,allowing an extended time-out range that is stable across operating voltage and temperature. SeeSection 26.0 Electrical Characteristics for time-out periods.

    1.3 Details on Individual FamilyMembers

    Devices in the PIC18F2525/2620/4525/4620 family areavailable in 28-pin and 40/44-pinpackages. Block diagrams for the two groups are shown in Figure 1-1 and Figure 1-2.

    The devices are differentiated from each other in five Ways

    1. Flash program memory (48 Kbytes for PIC18FX525 devices, 64 Kbytes for PIC18FX620).2. A/D channels (10 for 28-pin devices, 13 for40/44-pin devices).3. I/O ports (3 bidirectional ports on 28-pin devices, 5 bidirectional ports on 40/44-pin devices).4. CCP and Enhanced CCP implementation (28-pin devices have 2 standard CCP modules,40/44-pin devices have one standard CCP module and one ECCP module).

  • 8/6/2019 Rahul Shrivas & Group

    25/43

    5. Parallel Slave Port (present only on 40/44-pin devices). All other features for devices in thisfamily are identical.These are summarized in Table 1-1.The pinouts for all devices are listed in Table 1-2 and Table 1-3.Like all Microchip PIC18 devices, members of the PIC18F2525/2620/4525/4620 family are

    available as both standard and low-voltage devices. Standard devices with Enhanced Flashmemory, designated with an F in the part number (such as PIC18F2620), accommodate anoperating VDD range of 4.2V to 5.5V.Low-voltage parts, designated by LF (such as PIC18LF2620), function over an extendedVDD range of 2.0V to 5.5V.

    PIC microcontroller

    PIC is a family of Harvard architecture microcontrollers made by MicrochipTechnology,

    derived from the PIC1640 originally developed by General Instrument'sMicroelectronicsDivision. The name PIC initially referred to "Peripheral Interface Controller".PICs are popular with both industrial developers and hobbyists alike due to theirlow cost,wide availability, large user base, extensive collection of application notes,availability of lowcost or free development tools, and serial programming (and re-programmingwith flashmemory) capability.Microchip announced on February 2008 the shipment of its six billionth PICprocessor.Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static Operation Up to 16 MIPS Throughput at 16 MHz On-chip 2-cycle Multiplier Nonvolatile Program and Data Memories 16K Bytes of In-System Self-Programmable FlashEndurance: 10,000 Write/Erase Cycles

    Optional Boot Code Section with Independent Lock BitsIn-System Programming by On-chip Boot ProgramTrue Read-While-Write Operation 512 Bytes EEPROMEndurance: 100,000 Write/Erase Cycles 1K Byte Internal SRAM Programming Lock for Software Security JTAG (IEEE std. 1149.1 Compliant) Interface

  • 8/6/2019 Rahul Shrivas & Group

    26/43

    Boundary-scan Capabilities According to the JTAG Standard Extensive On-chip Debug Support Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAGInterface Peripheral Features

    Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, andCaptureMode Real Time Counter with Separate Oscillator Four PWM Channels 8-channel, 10-bit ADC8 Single-ended Channels7 Differential Channels in TQFP Package Only2 Differential Channels with Programmable Gain at 1x, 10x, or 200x26R & D MR. DEEPAK KUMAR DWIVEDI

    Byte-oriented Two-wire Serial Interface Programmable Serial USART Master/Slave SPI Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated RC Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,Standby

    and Extended Standby I/O and Packages 32 Programmable I/O Lines 40-pin PDIP, 44-lead TQFP, and 44-pad MLF Operating Voltages 2.7 - 5.5V for ATmega16L 4.5 - 5.5V for ATmega16 Speed Grades 0 - 8 MHz for ATmega16L 0 - 16 MHz for ATmega16 Power Consumption @ 1 MHz, 3V, and 25C for ATmega16L Active: 1.1 mA

    Idle Mode: 0.35 mAPower-down Mode: < 1 A

  • 8/6/2019 Rahul Shrivas & Group

    27/43

    Pin DescriptionsVCC Digital supply voltage.GND Ground.Port A (PA7..PA0) Port A serves as the analog inputs to the A/D Converter.

    Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used.Port pins can provide internal pull-up resistors (selected for each bit). The Port A outputbuffers have symmetrical drive characteristics with both high sink and source capability.When pins PA0 to PA7 are used as inputs and are externally pulled low, they will sourcecurrent if the internal pull-up resistors are activated. The Port A pins are tri-stated when

    a reset condition becomes active, even if the clock is not running. Port B (PB7..PB0) Port B is an 8-bitbi-directional I/O port with internal pull-up resistors (selected foreachbit). The Port B output buffers have symmetrical drive characteristics with both high sinkand source capability. As inputs, Port B pins that are externally pulled low will sourcecurrent if the pull-up resistors are activated. The Port B pins are tri-stated when a resetcondition becomes active, even if the clock is not running.Port B also serves the functions of various special features of the ATmega16 as listedon page 56.

    Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected foreachbit). The Port C output buffers have symmetrical drive characteristics with both high sinkand source capability. As inputs, Port C pins that are externally pulled low will sourcecurrent if the pull-up resistors are activated. The Port C pins are tri-stated when a resetcondition becomes active, even if the clock is not running. If the JTAG interface isenabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activatedeven if a reset occurs.Port C also serves the functions of the JTAG interface and other special features of theATmega16 as listed on page 59.

  • 8/6/2019 Rahul Shrivas & Group

    28/43

    Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected foreachbit). The Port D output buffers have symmetrical drive characteristics with both high sinkand source capability. As inputs, Port D pins that are externally pulled low will sourcecurrent if the pull-up resistors are activated. The Port D pins are tri-stated when a resetcondition becomes active, even if the clock is not running.Port D also serves the functions of various special features of the ATmega16 as listed

    on page 61.RESET Reset Input. A low level on this pin for longer than the minimum pulse length will generatea reset, even if the clock is not running. The minimum pulse length is given in Table15 on page 36. Shorter pulses are not guaranteed to generate a reset.XTAL1 Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.XTAL2 Output from the inverting Oscillator amplifier.AVCC AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externallyconnected to VCC, even if the ADC is not used. If the ADC is used, it should be connectedto VCC through a low-pass filter.AREF AREF is the analog reference pin for the A/D Converter.

    WORKING OPERATION

  • 8/6/2019 Rahul Shrivas & Group

    29/43

    WORKING OPERATION

    When an object come in front of train then light and sound is generated as an indication andthe speed of the train is reduced automatically to avoid accidents. When train passes throughtcross over gate, the gate will shut down and LED glow. Further we can add smoke and firealarmin the train as a future implementation of our project. FM is placed at the station as anentertainment device for passengers

    Transmitter sectionBasically automotive locomotive consist of three parts. Power supply, transmitter, receiversection, and sensor and microcontroller section relay and power supply acts as a switchingdevice. We can use bridge rectifier since its efficiency is very good. Capacitor is used after relayto remove jerk/spark which is produced by relay.

    In transmitter section transistor BC177 is used for switching as well as amplification. 555 timerisused for pulse generation as well as for oscillation. In this as we know that 555 timer works inthree mode Astable mode, Multivibrator mode, monostable mode. But in our project 555 timerworks in monostable mode

  • 8/6/2019 Rahul Shrivas & Group

    30/43

    Receiver SectionIn receiver section NPN transistor is used whose rating is BC 548. IR eye which actsas a sensor inreceiver unit has a cabablity to sense upto 12 feet, so that major accidents can beprevented.Actually there are two sensors are used , GATE sensor as well as GATE sensor.When IR LEDstarts glowing oscillator starts generating frequency. Capacitor is grounded so thatit can act as alow pass filter, which can pass low frequency signal through it and blocks highfrequency signal.

    TSOP is used in place of REED switch, When photon energy falls on TSOP which actsas amineaturised receiver for IR remote control system . Resistance is low and highfrequency isgenerated. When input is present in 555 timer (oscillator circut) the output stage islow , butwhen there is no input, output become high. Demodulated output signal can bedecoded by a

  • 8/6/2019 Rahul Shrivas & Group

    31/43

    microcontroller unit. 4027 IC in receiver section acts as a flip flop. It acts as acontroller of gate .Actually it is combination of hardware and software. In software we are using Clanguage. Thusit is concluded that it is a minor part of C language. In transmitter sectiondarlington amplifirercircuit is used . It consist of IR LED as well as resistances of trating 1k, 470 ohm,and 100 ohm.Red LED become active in day time and white LED become active in dark light as intunnel..

    CONTROL SECTION

    Model Railway Level Crossing Lights

    The Automatic Railroad Crossing Controller (ARCC) is designed to operatesignalsand/or barriers as a train approaches a crossing, and then switch the signals off

    (andraise any barriers) once the end of the train is clear of the crossing.The system works by having four infra-red light beams across the track, asshown inFigure 1. The source of each infra-red beam is a suitable LED, positioned on onesideof the track, and its light is detected on the opposite side of the track by amatching

  • 8/6/2019 Rahul Shrivas & Group

    32/43

    phototransistor. Each of the four beams will be broken in sequence by the trainas ittravels along the track and over the crossing. If a train is approaching from theleft, forexample, the crossing signals, etc., are activated as the front of the train

    (locomotive) breaksbeam A. The signals stay activated until the last car in the train has passedthrough beamC, and the beam is intact again. Similarly, for a train approaching from theright, thecrossing signals area ctivated as beam D is broken, and continue until thecomplete train haspassed through beam B. It is important to appreciate that all four beams arebroken as thetrain moves through. When travelling from left to right, breaking beam Bbefore beam Deffectively tells the ARCC to ignore the breaking of beam D until the train has

    passedcompletely through the set of sensors, ie. until the last car has travelled beyondbeam D.The ARCC is then returned to its "Ready" state, where the breaking of eitherbeam A or Dwill trigger the crossing signals. A similar sequence applies for trains travellingfrom right toleft, where the breaking of beam C stops the ARCC from re-triggering thecrossing signalsas soon as beam A is broken. One consequence of this mode of operation isthat it is

    possible to confuse the ARCC by stopping and reversing the train while it iswithin the sensorarea, ie. Positioned anywhere between beams A and D. The usual result isthat the ARCC"sticks" in the state it was in when the train stopped. Normal operation canusually berestored by running the train forward again until it is completely beyond thesensor area,then reversing it back through all of the beams - at which point the ARCC shouldresume its "Ready" state with the crossing signals inactive. If this fails, thenthere is aReset pushbutton fitted to the ARCC which, when operated, will sort out themess.DUAL TRACK WORKING

    The ARCC is designed to handle only a single track, but it is possible to handle arailroad crossing with dual tracks, by fitting a second ARCC module, with its ownset of four infra-red beam sensors. The two ARCCs are coupled together so thatatrain running in either direction, on either track, will operate the crossingsignals. If

  • 8/6/2019 Rahul Shrivas & Group

    33/43

    you have trains running across the crossing on both tracks simultaneously, thenthefirst train to reach an outer sensor (its own A or D) will activate the crossingsignals/barriers. These will stay active until BOTH trains are clear of their owninner

    sensors (the relevant B or C)Again, you can confuse the ARCCs by stoppingandreversing a train on either trackwhile within the sensor area - the best course of action is not to do it!

    SENSOR MOUNTING & ALIGNMENT

    Both the LED infra-red source and phototransistor detector are in standard T1packages, 3mm in diameter. They are each mounted at one end of a shortlength ofaluminium tubing (1/8in internal diameter by 3/4in long) to exclude interferencefrom external lighting. The sensor pair are then carefully aligned, facing each

    other,on opposite sides of the track. If space is limited, the tubing could be cut downto,say, 1/2in long.In all cases, each sensor pair should be positioned in accordance with NMRAstandard track clearances (S-7 Clearances). For HO scale this means that nopart ofthe sensor assemblies should be closer than 26.2mm to the track centre line(althoughthis could be reduced to 20.6mm on straight lengths of track).Each sensor pair is supplied ready wired to a 48in length of 4-core cable fitted

    with aplug to connect to the ARCC unit (see section 4 below), and with a pair ofsupporting plastic blocks. These blocks are made by NETLON, and are actuallyintended for some purpose in the garden or greenhouse but, for initial trials atleast,they are a convenient means of supporting the sensors on either side of thetrack.There is probably no way the blocks could be disguised as scale tracksideobjects, butit is assumed that, ultimately, the sensors will be built into the layoutlandscaping or

    buildings. Details of the blocks are shown in Figure 2 below.

  • 8/6/2019 Rahul Shrivas & Group

    34/43

    The end of the horizontal section holding the sensor shielding tube is drilled outto5mm diameter, and the other end, where the LED or phototransistor isconnected tothe cable, is drilled out to 7mm diameter. The vertical hole below the sensorassembly is also made 7mm in diameter so that the LED or photransistorassembly

    can be passed through the block from below (via a suitable hole in thebaseboard)before being positioned in the blocks horizontal section. This keeps the ARCCwiring reasonably tidy. The smaller, 3mm diameter, vertical hole in the block isusedto secure it to the baseboard using a suitable screw or bolt.The sensor pair should be angled across the track, as shown in Figure 1, so thattheARCC does not .see. the inter-car gaps, ie. the beam stays broken for thecompletelength of the train. The angle is not critical (and does not have to be the samefor

    each sensor pair) but should be at least 60 degrees for normal HO scale. Thesensorswill operate reliably over separations between LED and detector of at least125mm(90mm between the ends of the shielding tubes) so that an angle of 45 degreescan beaccommodated (as required for UK 00 scale, for example).

  • 8/6/2019 Rahul Shrivas & Group

    35/43

    The really critical mounting dimension is the height of the beams. Each sensorpairmust be positioned so that the beam is completely broken by each locomotiveandcar in the train for the total length of the train. If a beam can pass through some

    gapin the car structure, then the ARCC is liable to get a false indication that the endofthe train has been detected, and the crossing signals will be switched offprematurely. The crossing signals can also be re-activated as the traincontinuesthrough, leading to erratic, non-realistic operation.The optimum height setting is as shown in Figure 3, with the beams positioned13mm (1mm) above top-of-rail, just below the floor level of each car. This isnotabsolutely foolproof as empty flat cars with a depressed loading platform , orsome

    hopper cars with an open end-structure, can allow the beams to becomereestablishedmomentarily. If you wish to run trains through the crossing with thesetypes of cars, then it may be necessary to angle the sensor pairs downwards, aswellas across the track, for example, to ensure 100% interruption of the beams bytheavailable structure of the cars. A simpler alternative might be to modify theproblemcars in some fashion to block the offending gaps - if this can be done withoutmajor

    departures from prototype scale.The plastic supporting blocks, as supplied, raise the sensor height to 20mmabovethe baseboard. Hence, if top-of-rail is less than 7mm above the baseboard, theblocksshould be cut down to the appropriate height. Guide lines 3mm and 6mm fromthebase of each block have been scribed on to assist in cutting the blocks square.12R & D MR. DEEPAK KUMAR DWIVEDIOnce the two parts of the sensor pair are mounted on opposite sides of thetrack they

    should be carefully aligned. This can be done well enough by eye, but you canuse astraight rod or bar laid in the grooves on top of the plastic blocks as an aid.A final check on sensor alignment can be done with the ARCC powered on, andusing a high-impedance voltmeter to measure the voltage at the collector ofeachdetector (at the base of Q2, Q4, Q6, or Q8 - see the attached circuit and boardlayout

  • 8/6/2019 Rahul Shrivas & Group

    36/43

    diagrams). The voltage level should be around 0.2 volts - and definitely lessthan 0.5volts. Adjust the sensor alignment for a minimum value.

    Sensor Cable ConnectionsThe sensors are supplied ready-wired to their connecting cables and plugs but,if itis necessary to make up replacements (to accommodate landscapingrequirements,for example), then details are given in Figure 5.The leads of the emitter and detector should not be trimmed to less than 7mmfromthe body of the device, and soldering to the wires of the connecting cableshould bedone in the shortest time possible (consistent with making a reliable joint.Ensure

    that you observe the polarity of the devices as shown. Insulating sleeving overthejoints is recommended to avoid short circuits as the sensors are manoeuvredinto

    position

  • 8/6/2019 Rahul Shrivas & Group

    37/43

    POWER SUPPLY

  • 8/6/2019 Rahul Shrivas & Group

    38/43

    BLOCK DAIGRAM OF POWER SUPPLY

    BRIDGE RECTIFIER

    Bridge rectifier circuit consists of four diodes arranged in the form of a bridge asshown in

    ure.

    O

  • 8/6/2019 Rahul Shrivas & Group

    39/43

    PIC microcontroller

    PIC is a family of Harvard architecture microcontrollers made by MicrochipTechnology,derived from the PIC1640 originally developed by General Instrument'sMicroelectronicsDivision. The name PIC initially referred to "Peripheral Interface Controller".PICs are popular with both industrial developers and hobbyists alike due to theirlow cost,

    wide availability, large user base, extensive collection of application notes,availability of lowcost or free development tools, and serial programming (and re-programmingwith flashmemory) capability.Microchip announced on February 2008 the shipment of its six billionth PICprocessor.Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static Operation Up to 16 MIPS Throughput at 16 MHz On-chip 2-cycle Multiplier Nonvolatile Program and Data Memories 16K Bytes of In-System Self-Programmable FlashEndurance: 10,000 Write/Erase Cycles Optional Boot Code Section with Independent Lock BitsIn-System Programming by On-chip Boot ProgramTrue Read-While-Write Operation 512 Bytes EEPROMEndurance: 100,000 Write/Erase Cycles

    1K Byte Internal SRAM Programming Lock for Software Security JTAG (IEEE std. 1149.1 Compliant) Interface Boundary-scan Capabilities According to the JTAG Standard Extensive On-chip Debug Support Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAGInterface Peripheral Features

  • 8/6/2019 Rahul Shrivas & Group

    40/43

    Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, andCaptureMode Real Time Counter with Separate Oscillator

    Four PWM Channels 8-channel, 10-bit ADC8 Single-ended Channels7 Differential Channels in TQFP Package Only2 Differential Channels with Programmable Gain at 1x, 10x, or 200x26R & D MR. DEEPAK KUMAR DWIVEDI Byte-oriented Two-wire Serial Interface Programmable Serial USART Master/Slave SPI Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator

    Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated RC Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,Standbyand Extended Standby I/O and Packages 32 Programmable I/O Lines 40-pin PDIP, 44-lead TQFP, and 44-pad MLF Operating Voltages

    2.7 - 5.5V for ATmega16L 4.5 - 5.5V for ATmega16 Speed Grades 0 - 8 MHz for ATmega16L 0 - 16 MHz for ATmega16 Power Consumption @ 1 MHz, 3V, and 25C for ATmega16L Active: 1.1 mA Idle Mode: 0.35 mAPower-down Mode: < 1 A

  • 8/6/2019 Rahul Shrivas & Group

    41/43

    Pin DescriptionsVCC Digital supply voltage.GND Ground.Port A (PA7..PA0) Port A serves as the analog inputs to the A/D Converter.

    Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used.Port pins can provide internal pull-up resistors (selected for each bit). The Port A outputbuffers have symmetrical drive characteristics with both high sink and source capability.When pins PA0 to PA7 are used as inputs and are externally pulled low, they will sourcecurrent if the internal pull-up resistors are activated. The Port A pins are tri-stated when

    a reset condition becomes active, even if the clock is not running. Port B (PB7..PB0) Port B is an 8-bitbi-directional I/O port with internal pull-up resistors (selected foreachbit). The Port B output buffers have symmetrical drive characteristics with both high sinkand source capability. As inputs, Port B pins that are externally pulled low will sourcecurrent if the pull-up resistors are activated. The Port B pins are tri-stated when a resetcondition becomes active, even if the clock is not running.Port B also serves the functions of various special features of the ATmega16 as listedon page 56.

    Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected foreachbit). The Port C output buffers have symmetrical drive characteristics with both high sinkand source capability. As inputs, Port C pins that are externally pulled low will sourcecurrent if the pull-up resistors are activated. The Port C pins are tri-stated when a resetcondition becomes active, even if the clock is not running. If the JTAG interface isenabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activatedeven if a reset occurs.Port C also serves the functions of the JTAG interface and other special features of theATmega16 as listed on page 59.

  • 8/6/2019 Rahul Shrivas & Group

    42/43

  • 8/6/2019 Rahul Shrivas & Group

    43/43

    1