+ All Categories
Home > Documents > Pc Based Home

Pc Based Home

Date post: 05-Apr-2018
Category:
Upload: eshruthiatk
View: 216 times
Download: 0 times
Share this document with a friend

of 35

Transcript
  • 8/2/2019 Pc Based Home

    1/35

    CONTENTS

    Page No

    CHAPTER-1 MICROCONTROLLER 1

    1.1 Architecture of Microcontroller 1

    1.2 PIN description Of AT89C51 4

    1.3 Memory Organization 13

    CHAPTER-2 POWER SUPPLY 17

    2.1 Step down transformer 172.2 Bridge Rectifier 19

    2.3 Voltage Regulators 23

    CHAPTER-3 RS232 25

    CHAPTER-4 MAX232 28

    CHAPTER-5 PROJECT DESCRIPTION 31

    5.1. Block diagram 31

    5.2. Description 31

    5.3. Working 32

    CONCLUSION 33

    BIBLIOGRAPHY 34

    1

  • 8/2/2019 Pc Based Home

    2/35

    CHAPTER-1

    MICROCONTROLLER

    1.1 Architecture of Microcontroller:

    Most microcontrollers today are based on the Harvard architecture, which clearly defined

    the four basic components required for an embedded system. These include a CPU core, memory

    for the program (ROM or Flash memory), memory for data (RAM), one or more timers

    (customizable ones and watchdog timers), as well as I/O lines to communicate with external

    peripherals and complementary resources all this in a single integrated circuit. Figure shows the

    block diagram of a general microcontroller. A microcontroller differs from a general-purpose CPUchip in that the former generally is quite easy to make into a working computer, with a minimum

    of external support chips. The idea is that the microcontroller is placed in the device to be

    controlled, hooked up to power and any information it needs, and that's that.

    A traditional microprocessor does not allow you to do this. It requires all of these additional

    tasks to be handled by other chips. For example, a number of RAM or Flash memory chips must be

    added. The amount of memory provided is more flexible in the traditional approach, but at least a

    few external memory chips must be provided, which requires numerous connections to pass the

    data back and forth to them.

    For instance, a typical microcontroller will have a built in clock generator and a small

    amount of RAM and ROM (or EPROM, EEPROM or Flash memory), meaning that to make it

    work, all that is needed is the control software and a timing crystal (though some even have

    internal RC clocks). Microcontrollers also usually have a variety of input/output devices, such as

    analog-to-digital converters, timers, UARTs or specialized serial communications interfaces like

    IC, Serial Peripheral Interface and Controller Area Network. Often these integrated devices can be

    controlled by specialized processor instructions.

    Originally, microcontrollers were only programmed in assembly language, or later in C code.

    Recent microcontrollers integrated with on-chip debug circuitry accessed by In-circuit emulator via

    JTAG enables a programmer to debug the software of an embedded system with a debugger.

    2

  • 8/2/2019 Pc Based Home

    3/35

    More recently, however, some microcontrollers have begun to include a built-in high-level

    programming language interpreter for greater ease of use. BASIC is a common choice, and is used

    in the popular BASIC Stamp MCUs.

    Microcontrollers trade away speed and flexibility to gain ease of equipment design and low cost.

    There is only so much room on the chip to include functionality, so for every I/O device or

    memory increase the microcontroller includes, some other circuitry has to be removed.

    Figure: The architecture of the microcontroller

    3

  • 8/2/2019 Pc Based Home

    4/35

    Finally, it must be mentioned that microcontroller architectures are available from many

    different vendors in so many varieties that they could rightly belong to a category of their own.

    Chief among these, are the 8051, Z80 and ARM derivatives.

    The microcontroller used in this application is 8051. The 8051 has the widest range of

    variants of any embedded controller on the market and there are many manufacturers like Intel,

    Siemens, Atmel, Marta etc manufacturing it. some of the 8051 variants are

    89C51,89C1051,89C2051 etc from Atmel, MCS251,87C51GB etc from Intel, 80C517A,80515

    from Siemens etc. 89c51 from Atmel Company is used for this application. 89c51 has 40 pins, it

    has 256Kbytes of RAM, and it is fast.

    AT89C51 Microcontroller Features:

    Compatible with MCS-51 Products

    8K Bytes of In-System Reprogram able Flash Memory

    Endurance: 1,000 Write/Erase Cycles

    Fully Static Operation: 0 Hz to 24 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

    Programmable Serial Channel

    Low-power Idle and Power-down Modes

    AT89C51 General Description:

    The AT89c51 is a low-power, high-performance CMOS 8-bit microcomputer with 8K

    bytes of Flash programmable and erasable read only memory (PEROM). The device is

    manufactured using Atmels high-density nonvolatile memory technology and is Compatible with

    the industry-standard 80C51 and 80C52 instruction set and pin out. The on-chip Flash allows the

    4

  • 8/2/2019 Pc Based Home

    5/35

    program memory to be reprogrammed in-system or by a conventional nonvolatile memory

    programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel

    AT89c51 is a powerful microcomputer that provides a highly flexible and cost-effective solution to

    many embedded control applications.

    1.2 Pin Diagram of AT89C51:

    Fig: Pin Diagram of ATMEL89c51 Microcontroller

    5

  • 8/2/2019 Pc Based Home

    6/35

    Pin Description

    Port 0: -

    Port 0 is an 8-bit open drain bi-directional I/O port. As an output port each pin can sink

    eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance

    inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during

    accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also

    receives the code bytes during Flash programming, and outputs the code bytes during program

    verification. External pull-ups are required during program verification. Below table 4.1 indicates

    pin connections of port 0 in the PLC Motherboard circuit.

    Port0 Pin Connection Dtails

    Port 1: -

    6

    Port Pin Connected to

    P0.0 Toggle switch 1

    P0.1 Toggle switch 2

    P0.2 Toggle switch 3

    P0.3 Toggle switch 4

    P0.4 Toggle switch 5

    P0.5 Toggle switch 6

    P0.6 Toggle switch 7

    P0.7 Toggle switch 8

  • 8/2/2019 Pc Based Home

    7/35

    Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers

    can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the

    internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled

    low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order

    address bytes during Flash programming and verification. Below table 4.2 indicates pin

    connections of port 1 in the PLC Motherboard circuit.

    Port Pin Connected to

    P1.0 D0 of LCD

    P1.1 D1 of LCD

    P1.2 D2 of LCD

    P1.3 D3 of LCD

    P1.4 D4 of LCD

    P1.5 D5 of LCD

    P1.6 D6 of LCD

    P1.7 D7 of LCD

    Port 1Pin Connection details

    Port 2: -

    Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers

    can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the

    internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled

    low will source current (IIL) because of the internal pull-ups. Below table 4.3 indicates pin

    connections of port 2 in the PLC Motherboard circuit.

    7

  • 8/2/2019 Pc Based Home

    8/35

    Port Pin Connected to

    P2.0 IN1 pin of ULN 2803.

    P2.1 IN2 pin of ULN 2803.

    P2.2 IN3 pin of ULN 2803.

    P2.3 IN4 pin of ULN 2803.

    P2.4 IN5 pin of ULN 2803.

    P2.5 IN6 pin of ULN 2803.

    P2.6 IN7 pin of ULN 2803.

    P2.7 IN8 pin of ULN 2803.

    Port 2 Pin Connection Details

    Port 3: -

    Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers

    can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the

    internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled

    low will source Current (IIL) because of the pull-ups. Below table 4.4 indicates pin connections of

    port 3 in the PLC Motherboard circuit.

    Port Pin Connected to

    P3.0 No Connection

    P3.1 No Connection

    P3.2 E pin of LCD

    P3.3 R/W pin of LCD

    P3.4 RS pin of LCD

    P3.5 INCR key

    P3.6 DECR key

    P3.7 ENTER key

    Port 3 Pin Connection Details

    8

  • 8/2/2019 Pc Based Home

    9/35

    VCC - Supply voltage (+5V).

    RST: -

    Reset input. A high on this pin for two machine cycles while the oscillator is running resets

    the device.

    ALE/PROG: -

    Address Latch Enable is an output pulse for latching the low byte of the address during

    accesses to external memory. This pin is also the program pulse input (PROG) during Flash

    programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency

    and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is

    skipped during each access to external data memory. If desired, ALE operation can be disabled by

    setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC

    instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if

    the Microcontroller is in external execution mode.

    PSEN: -

    Program Store Enable is the read strobe to external program memory. When the AT89c51

    is executing code from external program memory, PSEN is activated twice each machine cycle,

    except that two PSEN activations are skipped during each access to external data memory.

    EA/VPP: -

    External Access Enable EA must be strapped to GND in order to enable the device to fetch

    code from external program memory locations starting at 0000H up to FFFFH. Note, however, that

    if lock bit 1 is programmed, EA will be internally latched on reset. A should be strapped to VCC

    for internal program executions. This pin also receives the 12-volt programming enable voltage

    (VPP) during Flash programming when 12-volt programming is selected.

    9

  • 8/2/2019 Pc Based Home

    10/35

    XTAL1: - Input to the inverting oscillator amplifier and input to the internal clock operating

    circuit.

    XTAL2: -Output from the inverting oscillator amplifier.

    Crystals for timing purposes:

    A crystal is a solid in which the constituent atoms, molecules, or ions are packed in a

    regularly ordered, repeating pattern extending in all three spatial dimensions.

    Almost any object made of an elastic material could be used like a crystal, with

    appropriate transducers, since all objects have natural resonant frequencies of vibration. For

    example, steel is very elastic and has a high speed of sound. It was often used in mechanical filters

    before quartz. The resonant frequency depends on size, shape, elasticity and the speed of sound in

    the material. High-frequency crystals are typically cut in the shape of a simple, rectangular plate.

    10

    http://en.wikipedia.org/wiki/Image:Crystal_oscillator_4MHz.jpg
  • 8/2/2019 Pc Based Home

    11/35

    Low-frequency crystals, such as those used in digital watches, are typically cut in the shape of a

    tuning fork. For applications not needing very precise timing, a low-cost ceramic resonator is often

    used in place of a quartz crystal.

    When a crystal of quartz is properly cut and mounted, it can be made to bend in an electric

    field, by applying a voltage to an electrode near or on the crystal. This property is known as

    piezoelectricity. When the field is removed, the quartz will generate an electric field as it returns to

    its previous shape, and this can generate a voltage. The result is that a quartz crystal behaves like a

    circuit composed of an inductor, capacitor and resistor, with a precise resonant frequency.

    Quartz has the further advantage that its size changes very little with temperature.

    Therefore, the resonant frequency of the plate, which depends on its size, will not change much,

    either. This means that a quartz clock, filter or oscillator will remain accurate. For critical

    applications the quartz oscillator is mounted in a temperature-controlled container, called a crystal

    oven, and can also be mounted on shock absorbers to prevent perturbation by external mechanical

    vibrations.

    Quartz timing crystals are manufactured for frequencies from a few tens of kilohertz to tens

    of megahertz. More than two billion (2109) crystals are manufactured annually. Most are small

    devices for consumer devices such as wristwatches, clocks, radios, computers, and cell phones.

    Quartz crystals are also found inside test and measurement equipment, such as counters, signal

    generators, and oscilloscopes.

    CRYSTALS AND FREQUENCY:

    Schematic symbol and equivalent circuit for a quartz crystal in an oscillator

    11

  • 8/2/2019 Pc Based Home

    12/35

    The crystal oscillator circuit sustains oscillation by taking a voltage signal from the quartz

    resonator, amplifying it, and feeding it back to the resonator. The rate of expansion and contraction

    of the quartz is the resonant frequency, and is determined by the cut and size of the crystal.

    A regular timing crystal contains two electrically conductive plates, with a slice or tuning

    fork of quartz crystal sandwiched between them. During startup, the circuit around the crystal

    applies a random noise AC signal to it, and purely by chance, a tiny fraction of the noise will be at

    the resonant frequency of the crystal. The crystal will therefore start oscillating in synchrony with

    that signal. As the oscillator amplifies the signals coming out of the crystal, the crystal's frequency

    will become stronger, eventually dominating the output of the oscillator. Natural resistance in the

    circuit and in the quartz crystal, filter out all the unwanted frequencies.

    One of the most important traits of quartz crystal oscillators is that they can exhibit very

    low phase noise. In other words, the signal they produce is a pure tone. This makes them

    particularly useful in telecommunications where stable signals are needed and in scientific

    equipment where very precise time references are needed.

    The output frequency of a quartz oscillator is either the fundamental resonance or a

    multiple of the resonance, called an overtone frequency.

    A typical Q for a quartz oscillator ranges from 104 to 106. The maximum Q for a high stability

    quartz oscillator can be estimated as Q = 1.6 107/f, where f is the resonance frequency in

    megahertz.

    Environmental changes of temperature, humidity, pressure, and vibration can change the

    resonant frequency of a quartz crystal, but there are several designs that reduce these

    environmental effects. These include the TCXO, MCXO, and OCXO (defined below). These

    designs (particularly the OCXO) often produce devices with excellent short-term stability. The

    limitations in short-term stability are due mainly to noise from electronic components in the

    oscillator circuits. Long term stability is limited by aging of the crystal.

    Due to aging and environmental factors such as temperature and vibration, it is hard to keep eventhe best quartz oscillators within one part in 1010 of their nominal frequency without constant

    adjustment. For this reason, atomic oscillators are used for applications that require better long-

    term stability and accuracy.

    Although crystals can be fabricated for any desired resonant frequency, within

    technological limits, in actual practice today engineers design crystal oscillator circuits around

    12

  • 8/2/2019 Pc Based Home

    13/35

    relatively few standard frequencies, such as 3.58MHz, 10 MHz, 14.318, 20 MHz, 33.33 MHz, and

    40 MHz . The vast popularity of the 3.58MHz and 14.318MHz crystals is attributed initially to low

    cost resulting from scale of economy resulting from the popularity of television and the fact that

    this frequency is involved in synchronizing to the color burst signal necessary to display color on

    an NTSC or PAL based television set. Using frequency dividers, frequency multipliers and phase

    locked loop circuits; it is possible to synthesize any desired frequency from the reference

    frequency.

    Care must be taken to use only one crystal oscillator source when designing circuits to

    avoid subtle failure modes of metastability in electronics. If this is not possible, the number of

    distinct crystal oscillators, PLLs, and their associated clock domains should be rigorously

    minimized, through techniques such as using a subdivision of an existing clock instead of a new

    crystal source. Each new distinct crystal source needs to be rigorously justified, since each one

    introduces new, difficult to debug probabilistic failure modes, due to multiple crystal interactions,

    into equipment.

    Specifications:

    Frequency range: 1.50MHz to 160MHz

    Frequency range: 1.50MHz to 160MHz

    Frequency tolerance: +/-10ppm to +/-30ppm (at 25 degree Celsius)

    Frequency stability +/-10ppm to +/-30ppm

    Operating temperature range: -20 to +70 degrees Celsius

    Load capacitance: 10pF to 32pF, series or special

    Shunt capacitance: 7pF maximum

    Drive level: 100uw to 1000uw

    Oscillation mode: fundamental, 3rd and 5th overtone

    Measure instrument: S and A 250 A system

    Equivalent series resistance

    Oscillation mode: fundamental

    13

  • 8/2/2019 Pc Based Home

    14/35

    Frequency/HC-49/U (ohms maximum):

    1.5 to 1.99/700 ohms

    2.0 to 2.99/500 ohms

    3.0 to 3.19/300 ohms

    3.2 to 3.99/150 ohms

    4.0 to 4.49/90 ohms

    4.5 to 4.99/70 ohms

    5.0 to 6.99/50 ohms

    7.0 to 9.99/35 ohms

    10.0 to 36.0/25 ohms

    Oscillation mode: 3rd overtone

    Frequency/HC49/U (ohm maximum):

    20.0 to 24.99/45 ohms

    25.0 to 90.9/40 ohms

    Oscillation mode: 5th overtone

    Frequency/HC-49/U (ohm maximum):

    70.0 to 160.0/70 ohms

    1.3 Memory Organization:

    The 8051 architecture provides the user with three physically distinct memory spaces

    which can be seen in Figure A - 1. Each memory space consists of contiguous addresses from 0 to

    the maximum size, in bytes, of the memory space. Address overlaps are resolved by utilizing

    instructions which refer specifically to a given address space. The three memory spaces function as

    described below.

    14

  • 8/2/2019 Pc Based Home

    15/35

    The CODE Space

    The first memory space is the CODE segment in which the executable program resides.

    This segment can be up to 64K (since it is addressed by 16 address lines). The processor treats this

    segment as read only and will generate signals appropriate to access a memory device such as an

    EPROM. However, this does not mean that the CODE segment must be implemented using an

    EPROM. Many embedded systems these days are using EEPROM which allows the memory to be

    overwritten either by the 8051 itself or by an external device. This makes upgrades to the product

    easy to do since new software can be downloaded into the EEPROM rather than having to

    disassemble it and install a new EPROM.

    The DATA Space

    The second memory space is the 128 bytes of internal RAM on the 8051, or the first 128

    bytes of internal RAM on the 8052. This segment is typically referred to as the DATA segment.

    The RAM locations in this segment are accessed in one or two cycles depending on the instruction.

    This access time is much quicker than access to the XDATA segment because memory is

    addressed directly rather than via a memory pointer such as DPTR which must first be initialized.

    Therefore, frequently used variables and temporary scratch variables are usually assigned to the

    15

  • 8/2/2019 Pc Based Home

    16/35

    DATA segment. Such allocation must be done with care, however, due to the limited amount of

    memory in this segment.

    Variables stored in the DATA segment can also be accessed indirectly via R0 or R1. The

    register being used as the memory pointer must contain the address of the byte to be retrieved or

    altered. These instructions can take one or two processor cycles depending on the

    source/destination data byte.

    Special Function Registers

    Control registers for the interrupt system and the peripherals on the 8051 are contained in

    internal RAM at locations 80 hex and above. These registers are referred to as special functionregisters (or SFRs for short). Many of them are bit addressable. The bits in the bit addressable

    SFRs can either be accessed by name, index or bit address. Thus, you can refer to the EA bit of the

    Interrupt Enable SFR as EA, IE.7, or 0AFH. The SFRs control things such as the function of the

    timer/counters, the UART, and the interrupt sources as well as their priorities. These registers are

    accessed by the same set of instructions as the bytes and bits in the DATA segment.

    The IDATA Space

    Certain 8051 family members such as the 8052 contain an additional 128 bytes of internal

    RAM which reside at RAM locations 80 hex and above. This segment of RAM is typically

    referred to as the IDATA segment. Because the IDATA addresses and the SFR addresses overlap,

    address conflicts between IDATA RAM and the SFRs are resolved by the type of memory access

    being performed, since the IDATA segment can only be accessed via indirect addressing modes.

    The final 8051 memory space is 64K in length and is addressed by the same 16 address

    lines as the CODE segment. This space is typically referred to as the external data memory space

    (or the XDATA segment for short). This segment usually consists of some sort of RAM (usually

    an SRAM) and the I/O devices or external peripherals to which the 8051 must interface via its bus.

    16

  • 8/2/2019 Pc Based Home

    17/35

    Read or write operations to this segment take a minimum of two processor cycles and are

    performed using either DPTR, R0, or R1. In the case of DPTR, it usually takes two processor

    cycles or more to load the desired address in addition to the two cycles required to perform the

    read or write operation. Similarly, loading R0 or R1 will take minimum of one cycle in addition to

    the two cycles imposed by the memory access itself. Therefore, it is easy to see that a typical

    operation with the XDATA segment will, in general, take a minimum of three processor cycles.

    Because of this, the DATA segment is a very attractive place to store any frequently used

    variables. It is possible to fill this segment entirely with 64K of RAM if the 8051 does not need to

    perform any I/O with devices in its bus or if the designer wishes to cycle the RAM on and off

    when I/O devices are being accessed via the bus.

    CHAPTER-2

    POWER SUPPLY

    POWER SUPPLY MODULES:

    STEP DOWN TRANSFORMER

    BRIDGE RECTIFIER WITH FILTER

    VOLTAGE REGULATORS

    2.1 STEP DOWN TRANSFORMER:

    A transformer is an electrical device that transfers energy from one circuit to another by

    magnetic coupling, without requiring relative motion between its parts. A transformer comprises

    two or more coupled windings, and, in most cases, a magnetic core to concentrate magnetic flux. A

    changing voltage applied to one winding creates a time-varying magnetic flux in the core, which

    induces a voltage in the other windings.

    17

  • 8/2/2019 Pc Based Home

    18/35

    Transformers come in a range of sizes from a thumbnail-sized coupling transformer hidden

    inside a stage microphone to huge gigawatt units used to interconnect large portions of national

    power grids. All operate with the same basic principles and with many similarities in their parts.

    A transformer transfers electrical energy from a high-current, low-voltage circuit to a lower-

    current, higher-voltage circuit.

    Coupling by mutual induction:

    The principles of the transformer are illustrated by consideration of a hypothetical ideal

    transformer. In this case, the core requires negligible magneto motive force to sustain flux, and all

    flux linking the primary winding also links the secondary winding. The hypothetical ideal

    transformer has no resistance in its coils. A simple transformer consists of two electrical

    conductors called the primary winding and the secondary winding. Energy is coupled between

    the windings by the time varying magnetic flux that passes through (links) both primary and

    secondary windings. Whenever the amount of current in a coil changes, a voltage is induced in the

    neighboring coil. The effect, called mutual inductance, is an example of electromagnetic induction.

    Fig: An ideal step-down transformer showing flux in the core

    If a time-varying voltage is applied to the primary winding of turns, a current will flow

    in it producing a magneto motive force (MMF). Just as an electromotive force (EMF) drives

    current around an electric circuit, so MMF tries to drive magnetic flux through a magnetic circuit.

    The primary MMF produces a varying magnetic flux in the core, and, with an open circuit

    secondary winding, induces a back electromotive force (EMF) in opposition to . In accordance

    18

  • 8/2/2019 Pc Based Home

    19/35

    with Faradays law of induction, the voltage induced across the primary winding is proportional to

    the rate of change of flux:

    and

    where

    vPand vS are the voltages across the primary winding and secondary winding,

    NPandNS are the numbers of turns in the primary winding and secondary winding,

    dP / dtand dS / dtare the derivatives of the flux with respect to time of the primary

    and secondary windings.

    In the hypothetical ideal transformer, the primary and secondary windings are perfectly coupled,

    or equivalently, . Substituting and solving for the voltages shows that:

    Where

    vp and vs are voltages across primary and secondary,

    Np andNs are the numbers of turns in the primary and secondary, respectively.

    Hence in an ideal transformer, the ratio of the primary and secondary voltages is equal to

    the ratio of the number of turns in their windings, or alternatively, the voltage per turn is the same

    for both windings. The ratio of the currents in the primary and secondary circuits is inversely

    proportional to the turns ratio.

    The EMF in the secondary winding will cause current to flow in a secondary circuit. The

    MMF produced by current in the secondary winding opposes the MMF of the primary winding and

    so tends to cancel the flux in the core. Since the reduced flux reduces the EMF induced in the

    primary winding, increased current flows in the primary circuit. The resulting increase in MMF

    due to the primary current offsets the effect of the opposing secondary MMF. In this way, the

    electrical energy fed into the primary winding is delivered to the secondary winding. In addition,

    the flux density will always stay the same as long as the primary voltage is steady.

    Step-down: The secondary has fewer turns than the primary i.e. it converts higher voltage at the

    input side to a lower voltage at the output.

    19

  • 8/2/2019 Pc Based Home

    20/35

    2.2 BRIDGE RECTIFIER:

    A diode bridge orbridge rectifier is an arrangement of four diodes connected in a bridge

    circuit as shown below, that provides the same polarity of output voltage for any polarity of the

    input voltage. When used in its most common application, for conversion of alternating current

    (AC) input into direct current (DC) output, it is known as a bridge rectifier. The bridge recitifier

    provides full wave rectification from a two wire AC input (saving the cost of a center tapped

    transformer) but has two diode drops rather than one reducing efficiency over a center tap based

    design for the same output voltage.

    Fig: Schematic of a diode bridgeThe essential feature of this arrangement is that for both polarities of the voltage at the bridge

    input, the polarity of the output is constant.

    Basic operation:

    When the input connected at the left corner of the diamond is positive with respect to the one

    connected at the right hand corner, current flows to the right along the upper colored path to the

    output, and returns to the input supply via the lower one.

    20

  • 8/2/2019 Pc Based Home

    21/35

    When the right hand corner is positive relative to the left hand corner, current flows along the

    upper colored path and returns to the supply via the lower colored path.

    fig: AC, half-wave and full wave rectified signals

    21

  • 8/2/2019 Pc Based Home

    22/35

    In each case, the upper right output remains positive with respect to the lower right one.

    Since this is true whether the input is AC or DC, this circuit not only produces DC power when

    supplied with AC power: it also can provide what is sometimes called "reverse polarity

    protection". That is, it permits normal functioning when batteries are installed backwards or DC

    input-power supply wiring "has its wires crossed" (and protects the circuitry it powers against

    damage that might occur without this circuit in place).

    Output smoothing:

    For many applications, especially with single phase AC where the full-wave bridge serves to

    convert an AC input into a DC output, the addition of a capacitor may be important because the

    bridge alone supplies an output voltage of fixed polarity but pulsating magnitude (see figure

    below).

    The function of this capacitor, known as a 'smoothing capacitor' is to lessen the variation in

    (or 'smooth') the raw output voltage waveform from the bridge. One explanation of 'smoothing' is

    that the capacitor provides a low impedance path to the AC component of the output, reducing the

    AC voltage across, and AC current through, the resistive load. In less technical terms, any drop in

    the output voltage and current of the bridge tends to be cancelled by loss of charge in the capacitor.

    This charge flows out as additional current through the load. Thus the change of load current and

    voltage is reduced relative to what would occur without the capacitor. Increases of voltage

    correspondingly store excess charge in the capacitor, thus moderating the change in output

    voltage / current.

    The capacitor and the load resistance have a typical time constant = RCwhere CandR

    are the capacitance and load resistance respectively. As long as the load resistor is large enough so

    22

    http://en.wikipedia.org/wiki/Image:Diodebridge4.png
  • 8/2/2019 Pc Based Home

    23/35

    that this time constant is much longer than the time of one ripple cycle, the above configuration

    will produce a well smoothed DC voltage across the load resistance. In some designs, a series

    resistor at the load side of the capacitor is added. The smoothing can then be improved by adding

    additional stages of capacitorresistor pairs, often done only for sub-supplies to critical high-gain

    circuits that tend to be sensitive to supply voltage noise.

    CHARACTERISTICS OF BRIDGE RECTIFIER:

    EFFICIENCY:

    It is defined as the ratio of output DC power to input AC power.

    Its efficiency is 81.2%, which is same as that of a full wave rectifier.

    RIPPLE FACTOR:

    It is defined as the ratio of RMS voltage of the AC component to the DC component.

    For bridge rectifier it is 0.48, which is same as full wave rectifier.

    In bridge rectifier the bulky center tapped transformer is not used which is a great

    advantage.

    The peak inverse voltage (PIV) of the diodes is half that of the PIV of the diodes in a full

    wave rectifier.

    The transformer utilization factor (T.U.F) is high i.e. 0.812, as the current flowing in the

    transformer secondary is fully utilized.

    2.3 VOLTAGE REGULATORS:

    23

  • 8/2/2019 Pc Based Home

    24/35

    A

    voltage regulator is an electrical regulator designed to automatically maintain a constant

    voltage level.

    It may use an electromechanical mechanism, or passive or active electronic components.

    Depending on the design, it may be used to regulate one or more AC or DC voltages.

    With the exception of shunt regulators, all voltage regulators operate by comparing the

    actual output voltage to some internal fixed reference voltage. Any difference is amplified and

    used to control the regulation element. This forms a negative feedback servo control loop. If the

    output voltage is too low, the regulation element is commanded to produce a higher voltage. For

    some regulators if the output voltage is too high, the regulation element is commanded to producea lower voltage; however, many just stop sourcing current and depend on the current draw of

    whatever it is driving to pull the voltage back down. In this way, the output voltage is held roughly

    constant. The control loop must be carefully designed to produce the desired tradeoff between

    stability and speed of response.

    Voltage Regulator(7805 +5v regulator, 1 Amp rated output) :

    24

  • 8/2/2019 Pc Based Home

    25/35

    In this project, we need a stable, constant 5-volt DC supply. It's the job of a voltage

    regulator IC to take the variable; unregulated DC input and turns it into a constant supply

    we can use. Two common families of fixed voltage regulator exist - the 78xx series for positive

    voltages, and the 79xx series for negative voltages. The rest of the part number consists of the

    output voltage, i.e. 7805 for +5 volts, 7812 for +12 volts. There are other regulators rated for

    different currents are available, such as 7xLxx series (e.g. 79L05) for 0.1 Amps and 7xSxx series

    (e.g. 78S12) for 2 Amps.

    CHAPTER-3

    RS-232

    RS-232 is simple, universal, well understood and supported but it has some serious

    shortcomings as a data interface. The standards to 256kbps or less and line lengths of 15M (50 ft)

    or less but today we see high speed ports on our home PC running very high speeds and with high

    quality cable maxim distance has increased greatly. The rule of thumb for the length a data cable

    depends on speed of the data, quality of the cable.

    25

  • 8/2/2019 Pc Based Home

    26/35

    Electronic data communications between elements will generally fall into two broad

    categories: single-ended and differential. RS232 (single-ended) was introduced in 1962, and

    despite rumors for its early demise, has remained widely used through the industry.

    Independent channels are established for two-way (full-duplex) communications. The

    RS232 signals are represented by voltage levels with respect to a system common (power / logic

    ground). The "idle" state (MARK) has the signal level negative with respect to common, and the

    "active" state (SPACE) has the signal level positive with respect to common. RS232 has numerous

    handshaking lines (primarily used with modems), and also specifies a communications protocol.

    The RS-232 interface presupposes a common ground between the DTE and DCE. This is a

    reasonable assumption when a short cable connects the DTE to the DCE, but with longer lines and

    connections between devices that may be on different electrical busses with different grounds, this

    may not be true.

    RS232 data is bi-polar.... +3 TO +12 volts indicates an "ON or 0-state (SPACE) condition"

    while A -3 to -12 volts indicates an "OFF" 1-state (MARK) condition.... Modern computer

    equipment ignores the negative level and accepts a zero voltage level as the "OFF" state. In fact,

    the "ON" state may be achieved with lesser positive potential. This means circuits powered by 5

    VDC are capable of driving RS232 circuits directly; however, the overall range that the RS232

    signal may be transmitted/received may be dramatically reduced.

    The output signal level usually swings between +12V and -12V. The "dead area" between

    +3v and -3v is designed to absorb line noise. In the various RS-232-like definitions this dead area

    may vary. For instance, the definition for V.10 has a dead area from +0.3v to -0.3v. Many

    receivers designed for RS-232 are sensitive to differentials of 1v or less.

    This can cause problems when using pin powered widgets - line drivers, converters,

    modems etc. These types of units need enough voltage & current to power them self's up. Typical

    URART (the RS-232 I/O chip) allows up to 50ma per output pin - so if the device needs 70ma to

    run we would need to use at least 2 pins for power. Some devices are very efficient and only

    require one pin (some times the Transmit or DTR pin) to be high - in the "SPACE" state while idle.

    An RS-232 port can supply only limited power to another device. The number of output

    lines, the type of interface driver IC, and the state of the output lines are important considerations.

    Data is transmitted and received on pins 2 and 3 respectively. Data Set Ready (DSR) is an

    indication from the Data Set (i.e., the modem or DSU/CSU) that it is on. Similarly, DTR indicates

    26

  • 8/2/2019 Pc Based Home

    27/35

    to the Data Set that the DTE is on. Data Carrier Detect (DCD) indicates that a good carrier is being

    received from the remote modem. Pins 4 RTS (Request To Send - from the transmitting computer)

    and 5 CTS (Clear To Send - from the Data set) are used to control. In most Asynchronous

    situations, RTS and CTS are constantly on throughout the communication session. However where

    the DTE is connected to a multipoint line, RTS is used to turn carrier on the modem on and off. On

    a multipoint line, it's imperative that only one station is transmitting at a time (because they share

    the return phone pair). When a station wants to transmit, it raises RTS. The modem turns on

    carrier, typically waits a few milliseconds for carrier to stabilize, and then raises CTS. The DTE

    transmits when it sees CTS up. When the station has finished its transmission, it drops RTS and the

    modem drops CTS and carrier together. Clock signals (pins 15, 17, & 24) are only used for

    synchronous communications. The modem or DSU extracts the clock from the data stream and

    provides a steady clock signal to the DTE. Note that the transmit and receive clock signals do not

    have to be the same, or even at the same baud rate. Note: Transmit and receive leads (2 or 3) can

    be reversed depending on the use of the equipment - DCE Data Communications Equipment or a

    DTE Data Terminal Equipment.

    Sub-D15 Male Sub-D15 Female

    This is a standard 9 to 25 pin cable layout for async data on a PC AT serial cable

    Description Signal 9-pin DTE 25-pin DCE Source DTE or DCE

    Carrier Detect CD 1 8 from Modem

    Receive Data RD 2 3 from Modem

    Transmit Data TD 3 2 from Terminal/Computer

    Data Terminal Ready DTR 4 20 from Terminal/Computer

    Signal Ground SG 5 7 from Modem

    Data Set Ready DSR 6 6 from ModemRequest to Send RTS 7 4 from Terminal/Computer

    Clear to Send CTS 8 5 from Modem

    Ring Indicator RI 9 22 from Modem

    27

  • 8/2/2019 Pc Based Home

    28/35

    CHAPTER-4

    28

  • 8/2/2019 Pc Based Home

    29/35

    MAX-232

    Features:

    Operates With Single 5-V Power Supply

    LinBiCMOS Process Technology

    Two Drivers and Two Receivers

    30- V Input Levels

    Low Supply Current . . . 8 mA Typical

    Meets or Exceeds TIA/EIA-232-F and ITU

    Recommendation V.28

    Designed to be Interchangeable With

    Applications:

    TIA/EIA-232-F

    Battery-Powered Systems

    Terminals

    Modems

    Computers

    ESD Protection Exceeds 2000 V Per

    MIL-STD-883, Method 3015

    Package Options Include Plastic

    Small-Outline (D, DW) Packages and

    Standard Plastic (N) DIPs

    29

  • 8/2/2019 Pc Based Home

    30/35

    Absolute maximum ratings

    Input supply voltage range, VCC : 0.3 V to 6 V

    Positive output supply voltage range:VS+ VCC 0.3 V to 15 V

    Negative output supply voltage range: VS0.3 V to 15 V

    Input voltage range, VI: Driver:0.3 V to VCC + 0.3 V

    Receiver: 30 V

    Output voltage range, VO: T1OUT, T2OUT VS 0.3 V to VS+ + 0.3 V

    R1OUT, R2OUT : 0.3 V to VCC + 0.3 V

    Short-circuit duration: T1OUT, T2OUT: Unlimited

    Package thermal impedance, D package :113C/W

    DW package : 105C/W

    N package : 78C/W

    Storage temperature range, Tstg : 65C to 150C

    Lead temperature 1,6 mm (1/16 inch) from case for 10 seconds: 260 C

    Stresses beyond those listed under absolute maximum ratings may cause permanent

    damage to the device. These are stress ratings only and functional operation of the device at these

    or any other conditions beyond those indicated under recommended operating conditions is not

    30

  • 8/2/2019 Pc Based Home

    31/35

    implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device

    reliability. NOTE 1: All voltage values are with respect to network ground terminal.2. The package

    thermal impedance is calculated in accordance with JESD 51, except for through-hole packages,

    which use a trace length of zero description

    MAX 232 Interfacing with RS232 and 89C51 microcontroller

    The MAX232 device is a dual driver/receiver that includes a capacitive voltage

    generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-

    232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a

    typical hysterics of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOS input

    levels into EIA-232 levels. The driver, receiver, and voltage-generator functions are available as

    cells in the Texas

    31

  • 8/2/2019 Pc Based Home

    32/35

    CHAPTER-5

    PROJECT DESCRIPTION

    5.1. Block diagram:

    5.2. Description:

    In this project we are controlling the appliances connected to the microcontroller. A

    command is passed to the microcontroller through pc. That command is first given to the RS-232

    and then passed to max-232 that converts the logic levels of RS-232 to microcontroller logic

    levels. According to the command received by the microcontroller the appliances connected to the

    driver ULN 2804, which drives the relay, are controlled.

    32

    Hype

    r

    termin

    PC

    Straigh

    t

    cable

    Max-

    232

    ATMEL

    ULN

    DRIVER

    RelayControlling

    device

  • 8/2/2019 Pc Based Home

    33/35

    5.3. Working:

    After the connections are made as per circuit diagram the user has to enter the

    commands in the hyper terminal of PC using keyboard to control the appliances.

    When a command is entered, the command is passed to the microcontroller throughRS-232 and max-232.

    Now the microcontroller checks the command. That is it compares the received

    command with the commands that are already stored in the controller.

    If the command is A then the controller activates device 1.

    If the command is B it deactivates the device 1.

    If the command is C it activates the device 2.

    If it is D it deactivates the device 2.

    Each device is activated and deactivated through relay that is driven by ULN 2804.

    It also shows the status of the devices for each command.

    If the controller receives other than these commands it waits till the proper

    command is received.

    33

  • 8/2/2019 Pc Based Home

    34/35

    CONCLUSION

    Industrial Automation has been taken into a new dimension. We have clearly demonstrated

    that Automation is the birth of a brand new era open to endless possibilities. Automation can be

    applied for your convenience. For example, living in a city such as London where the temperature

    can greatly vary between the morning and the evening, Automation can be very beneficial. Say you

    leave to work in the morning on a hot summery day and during the day you start to realize that the

    temperature aiming to go below freezing; you can then remotely turn on the heating at your home.

    This document presents a user-friendly approach to the available home automation

    systems. It is real-time monitor-able and remote controllable which simplifies the users indoor life

    and their interaction with home and industry. This system can easily be implemented because of its

    no necessity to wiring between the appliances. PC controls every data bit by bit, which results in

    preventing the disorder between different home appliances.

    34

  • 8/2/2019 Pc Based Home

    35/35

    BIBLIOGRAPHY

    1. THE 8051 MICRO-CONTROLLER AND EMBEDDED SYSTEMS

    a. MOHAMMAD ALI MAZIDI.

    b. JANICE GILLISPE.

    2. PROGRAMMINIG AND CUSTOMIZING WITH 8051

    a. MYKE PREDKO

    3. WWW.EMBEDDED.COM

    4. EMBEDDED SYSTEMS: ARCHITECTURE AND DESIGNING

    a. VAHID & GIVARGIS

    5. 8051 BY AYALA

    http://www.embedded.com/http://www.embedded.com/

Recommended