Sie sind auf Seite 1von 37

Dissertation submitted in partial fulfillment of the Btech. course.

Chopper

Under the Guidence of


Arun Bansal
Innovative Project solutions
www.ludhianaprojects.com
ludhiana
Submitted By
Abhishek Kaushik
SG-119836.

Table of Contents

1.

Acknowledgements.

2.

Certificate.

3.

Introduction to the Project.

4.

Circuit Diagram.

5.

Component List.

6.

Hardware
a.

Power Supply for the circuit.

b.

Integrated Circuits.

c.

Transistors.

d.

Diode.

e.

Relays.

f.

Transformer.

g.

Resistors.

h.

Capacitors.

7.

Project Working.

8.

Project Synopsis.

9.

Bibliography.

Introduction:
This is the project based on chopper logic to control the dc motor speed as well as its
direction of rotation using a high frequency transmitter and receiver circuit employing a
microcontroller chip for the purpose and we will project on class E chopper. In class E
chopper we used tsop 1738 for remote ir controll tsop 1728 work on 38 khz frequeny. We
will get data from tsop and will give to controller. Controller reads data.
The block diagram f chopper logic is shown below:
Block diagram:

Power
supply

Tsop
1738

Microntroll
er
89s52

Optocouplers

H- Bride circuit with


DC motor
Fig.1. Block Diagram of chopper circuit

DC motors
These are the motors that are commonly found in the toys and the tape recorders. These
motors change the direction of rotation by changing the polarity. Most chips can't pass
enough current or voltage to spin a motor. Also, motors tend to be electrically noisy (spikes)
and can slam power back into the control lines when the motor direction or speed is
changed.
Specialized circuits (motor drivers) have been developed to supply motors with power and
to isolate the other ICs from electrical problems. These circuits can be designed such that
they can be completely separate boards, reusable from project to project.
A very popular circuit for driving DC motors (ordinary or gearhead) is called an H-bridge.
It's called that because it looks like the capital letter 'H' on classic schematics. The great
ability of an H-bridge circuit is that the motor can be driven forward or backward at any
speed, optionally using a completely independent power source.

The H-Bridge Circuit

Figure 2 H Bridge circuit

This circuit known as the H-bridge (named for its topological similarity to the letter "H") is
commonly used to drive motors. In this circuit two of four transistors are selectively
enabled to control current flow through a motor and opposite pair of transistors (Transistor
One and Transistor Three) is enabled, allowing current to flow through the motor. The other
pair is disabled, and can be thought of as out of the circuit.

Figure 3 H bridge ckt

By determining which pair of transistors is enabled, current can be made to flow in either of
the two directions through the motor. Because permanent-magnet motors reverse their
direction of turn when the current flow is reversed, this circuit allows bidirectional control
of the motor.

The H-Bridge with Enable Circuitry

Fig.4. The H-Bridge with Enable Circuitry

It should be clear that one would never want to enable Transistors One and Two or
Transistors Three and Four simultaneously. This would cause current to flow from Power +
to Power - through the transistors, and not the motors, at the maximum current-handling
capacity of either the power supply or the transistors. This usually results in failure of the HBridge. To prevent the possibility of this failure, enable circuitry as depicted in Figure is
typically used. In this circuit, the internal inverters ensure that the vertical pairs of
transistors are never enabled simultaneously. The Enable input determines whether or not
the whole circuit is operational. If this input is false, then none of the transistors are
enabled, and the motor is free to coast to a stop. By turning on the Enable input and
controlling the two Direction inputs, the motor can be made to turn in either direction.
Note that if both direction inputs are the same state (either true or false) and the circuit is
enabled, both terminals will be brought to the same voltage (Power + or Power - ,
respectively). This operation will actively brake the motor, due to a property of motors
known as back emf, in which a motor that is turning generates a voltage counter to its
rotation. When both terminals of the motor are brought to the same electrical potential, the
back emf causes resistance to the motor's rotation.

Object Detection
Detecting objects without whiskers doesnt require anything as sophisticated as machine
vision. Some robots use RADAR or SONAR (sometimes called SODAR when used in air
instead of water). An even simpler system is to use infrared light to illuminate the robots
path and determine when the light reflects off an object.The IR illuminators and detectors
are readily available and inexpensive.

Infrared As Headlights
The infrared object detection system well build on the Bot is like a cars headlights in
several respects. When the light from a cars headlights reflects off obstacles, your eyes
detect the obstacles and your brain processes them and makes your body guide the car
accordingly. We will be using infrared LEDs for headlights. They emit infrared, and in some
cases, the infrared reflects off objects and bounces back in the direction of the detecter. The
eyes of the Bot( mobile) are the infrared detectors. The infrared detectors send signals to the
Microcontroller indicating whether or not they detect infrared reflected off an object. The
brain of the Bot, the microcontroller makes decisions and operates the motors based on this
sensor input.

Components used in circuits are.


1.
2.
3.
4.

Power supply
Microcontroller
H bridge circuit
Relay circuit

We are using two h bridges circuits for motor. We are using +12v DC motors for movement.
We are using two types of transistors:
1) Pnp
2) Npn
By using these transistors we made H bridge circuit. We will use resistances for voltage
drop. The microcontroller have four ports which are following;
1) Port P1
2) Port P2
3) Port P3
4) Port P4
We are using port P2 for motors as a output port and we giving inputs to port
P1.
POWER SUPPLY FOR DIGITAL CIRCUITS
Brief description of operation: Gives out well regulated +5V output, output current
capability of 700 mA.
Circuit protection: Built-in overheating protection shuts down output when regulator IC
gets too hot
Circuit complexity: Simple and easy to build.
Circuit performance: Stable +9V output voltage, reliable operation.
Availability of components: Easy to get, uses only common basic components.
Design testing: Based on datasheet example circuit, I have used this circuit successfully as
part of other electronics projects.
Applications: Part of electronics devices, small laboratory power supply.
Power supply voltage: Unregulated DC 5-18V power supply.
Power supply current: Needed output current 1A.
Components cost: Few rupees for the electronic components plus the cost of input
transformer.
DESCRIPTION OF POWER SUPPLY
This circuit is a small +05 volts power supply, which is useful when experimenting with
digital electronics. Small inexpensive wall transformers with variable output voltage are
available from any electronics shop. Those transformers are easily available, but usually
their voltage regulation is very poor, which makes them not very usable for digital circuit
experimenter unless a better regulation can be achieved in some way. The following circuit
is the answer to the problem.
This circuit can give +05V output at about 1A current. The circuit has overload and terminal
protection.

5
6

U 1

D 1

V IN

D IO D E

8
TR A N SF O R M ER C T

L M 7 8 0 5 /T O
VO U T

2
R 14
470E

T1

G N D

IN4007

D 2

C 1
1 0 0 0 u f /1 6 v

C 2
470uf
D 3
LED

D IO D E

Fig.5. circuit diagram of power supply

The above circuit utilizes the voltage regulator IC 7805 for the constant power supply. The
capacitors must have enough high voltage rating to safely handle the input voltage feed to
circuit. The circuit is very easy to build for example into a piece of Vero board.

Fig.6. Pin diagram of 7805regulator IC

PIN 1 : Unregulated voltage input


PIN 2 : Ground
PIN 3 : Regulated voltage output
Component list
1. 7805 regulator IC.
2. 1000 uf electrolytic capacitor, at least 25V voltage rating.
3. 470 uf electrolytic capacitor, at least 25V voltage rating.
We are using center taped full wave rectifier and Pi- filter for filtering.
About Rectifiers
A rectifier is an electrical device that converts alternating current (AC) to direct current
(DC), a process known as rectification. Rectifiers have many uses including as components

of power supplies and as detectors of radio signals. Rectifiers may be made of solid state
diodes, vacuum tube diodes, mercury arc valves, and other components.
Full-wave rectification
A full-wave rectifier converts the whole of the input waveform to one of constant polarity
(positive or negative) at its output. Full-wave rectification converts both polarities of the
input waveform to DC (direct current), and is more efficient. However, in a circuit with a
non-center tapped transformer, four diodes are required instead of the one needed for halfwave rectification. (See semiconductors, diode). Four diodes arranged this way are called a
diode bridge or bridge rectifier:

Graetz bridge rectifier: a full-wave rectifier using 4 diodes.


For single-phase AC, if the transformer is center-tapped, then two diodes back-to-back (i.e.
anodes-to-anode or cathode-to-cathode) can form a full-wave rectifier. Twice as many
windings are required on the transformer secondary to obtain the same output voltage
compared to the bridge rectifier above.

Full-wave rectifier using a transformer and 2 diodes.

Full-wave rectifier, with vacuum tube having two anodes.


A very common vacuum tube rectifier configuration contained one cathode and twin anodes
inside a single envelope; in this way, the two diodes required only one vacuum tube. The
5U4 and 5Y3 were popular examples of this configuration.

A three-phase bridge rectifier.

3-phase AC input, half & full wave rectified DC output waveforms


For three-phase AC, six diodes are used. Typically there are three pairs of diodes, each pair,
though, is not the same kind of double diode that would be used for a full wave singlephase rectifier. Instead the pairs are in series (anode to cathode). Typically, commercially
available double diodes have four terminals so the user can configure them as single-phase
split supply use, for half a bridge, or for three-phase use. Most devices that generate
alternating current (such devices are called alternators) generate three-phase AC. For
example, an automobile alternator has six diodes inside it to function as a full-wave rectifier
for battery charging applications.

Fig.7.Disassembled automobile alternator, showing the six diodes that comprise a full-wave three-phase
bridge rectifier.

About filters
Electronic filters are electronic circuits which perform signal processing functions,
specifically intended to remove unwanted signal components and/or enhance wanted ones.
Electronic filters can be:
1.
2.
3.
4.
5.

passive or active
analog or digital
discrete-time (sampled) or continuous-time
linear or non-linear
infinite impulse response (IIR type) or finite impulse response (FIR type)

The most common types of electronic filters are linear filters, regardless of other aspects of
their design. See the article on linear filters for details on their design and analysis.

The transfer function


The transfer function of a filter is the ratio of the output signal to that of the input signal as a
function of the complex frequency :
with .
The transfer function of all linear time-invariant filters generally share certain
characteristics:
1. Since the filters are constructed of discrete components, their transfer function will
be the ratio of two polynomials in , i.e. a rational function of . The order of the
transfer function will be the highest power of encountered in either the numerator or
the denominator.

2. The polynomials of the transfer function will all have real coefficients. Therefore,
the poles and zeroes of the transfer function will either be real or occur in complex
conjugate pairs.
3. Since the filters are assumed to be stable, the real part of all poles (i.e. zeroes of the
denominator) will be negative, i.e. they will lie in the left half-plane in complex
frequency space.
The proper construction of a transfer function involves the Laplace transform, and therefore
it is needed to assume null initial conditions, because
And when f(0)=0 we can get rid of the constants and use the usual expression
An alternative to transfer functions is to give the behavior of the filter as a convolution. The
convolution theorem, which holds for Laplace transforms, guarantees equivalence with
transfer functions.

Classification by transfer function


Filters may be specified by family and passband. A filter's family is specified by certain
design criteria which give general rules for specifying the transfer function of the filter.
Some common filter families and their particular design criteria are:
1.
2.
3.
4.
5.
6.
7.
8.
9.

Butterworth filter - no gain ripple in pass band and stop band, slow cutoff
Chebyshev filter(Type I) - no gain ripple in stop band, moderate cutoff
Chebyshev filter(Type II) - no gain ripple in pass band, moderate cutoff
Bessel filter - no group delay ripple, no gain ripple in both bands, slow gain cutoff
Elliptic filter - gain ripple in pass and stop band, fast cutoff
Optimum "L" filter
Gaussian filter - no ripple in response to step function
Hourglass filter
Raised-cosine filter

Generally, each family of filters can be specified to a particular order. The higher the order,
the more the filter will approach the "ideal" filter. The ideal filter has full transmission in the
pass band, and complete attenuation in the stop band, and the transition between the two
bands is abrupt (often called brick-wall). Here is an image comparing Butterworth,
Chebyshev, and elliptic filters. The filters in this illustration are all fifth-order low-pass
filters. The particular implementation -- analog or digital, passive or active -- makes no
difference; their output would be the same.
As is clear from the image, elliptic filters are sharper than all the others, but they show
ripples on the whole bandwidth.
Each family can be used to specify a particular pass band in which frequencies are
transmitted, while frequencies in the stop band (i.e. outside the pass band) are more or less
attenuated.
1) Low-pass filter - Low frequencies are passed, high frequencies are attenuated.

2)
3)
4)
5)

High-pass filter - High frequencies are passed, Low frequencies are attenuated.
Band-pass filter - Only frequencies in a frequency band are passed.
Band-stop filter - Only frequencies in a frequency band are attenuated.
All-pass filter - All frequencies are passed, but the phase of the output is modified.

About Voltage regulators


Features
Output Current up to 1A
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
Thermal Overload Protection
Short Circuit Protection
Output Transistor Safe Operating Area Protection
Description
The MC78XX/LM78XX/MC78XXA series of three terminal positive regulators are
available in the TO-220/D-PAK package and with several fixed output voltages, making
them useful in a wide range of applications. Each type employs internal current limiting,
thermal shut down and safe operating area protection, making it essentially indestructible. If
adequate heat sinking is provided, they can deliver over 1A output current.
Although designed primarily as fixed voltage regulators, these devices can be used with
external components to obtain adjustable voltages and currents.

Fig.8. voltage regulator

Fig.9. internal block diagram

COMPONENT DESCRIPTION
TRANSISTOR (BC558)
A transistor is semi conductor device consisting of three regions separated by two P-N
junctions. The three regions are Base, Emitter & Collector.
The base may be of N- type or P- type. The emitter and collector have same impurities but
different from that of base. Thus if base is of N- type then emitter and collector are of Ptype then transistor is called P-N-P transistor and vice versa transistor is called N-P-N
transistor. The base is made thin and number density of majority carriers is always less than
emitter and collector. The base provides junction for proper interaction between emitter and
collector.
Electrons are majority charge carriers in N- region and in P-region, holes are the majority
charge carriers. Thus two types of charge carriers are involved in current flow through N-PN or P-N-P transistor.
SYMBOLS FOR TRANSISTORS :
In schematic symbols, the emitter is always represented by an arrow indicating the direction
of conventional current in the device.
In case of N-P-N transistor arrow points away from base and in case of P-N-P transistor it
points towards base.
When transistor is used in circuit, emitter - base junction is always forward biased while
base - collector junction is always reverse biased.

Fig.10. Structure and symbol of P-N-P transistor


DIODE
It is a P-type region and N-type region formed in the same crystal structure, and hence a PN junction is produced. Some of the conduction electrons near the junction diffuse in to Ptype semiconductor from the N-type semiconductor across the junction combing with the
holes. The loss of electrons makes the N-type semiconductor positively charged and hence
the neutralization of the holes on the other hand makes P-type semiconductor negatively
charged. This region where positive and negative charges develop is called depletion region.

Fig.11 Diode
If a P-region is made positive with respect to the N-region by an external circuit then
junction is forward biased and junction has a very low resistance to the flow of current.
Holes in the positive P-type material are attracted across the junction to the negative side
and the free electrons in the N-type material are like wise attracted to the opposite side. If a
positive voltage is applied to N-zone with respect to the P-zone terminal, the P-N junction is
reverse biased.

Fig. 12.
Volt-Ampere Characteristics of a P-N Diode

Temperature Dependence of V-I Characteristics


The cut-in voltage decreases at the rate of 2.5 mV/C. Also above 25C, the reverse
saturation current I0 doubles for every 6C (10C) for Si (Ge) diodes. However, the shape of
overall characteristic does not alter with temperature.

LIGHT EMITTING DIODE


LED falls within the family of P-N junction devices. The light emitting diode (LED) is a
diode that will give off visible light when it is energized. In any forward biased P-N
junction there is, within the structure and primarily close to the junction, a recombination of
holes and electrons. This recombination requires that the energy possessed by the unbound
free electron be transferred to another state.
The process of giving off light by applying an electrical source of energy is called
electroluminescence. As shown in fig., with its graphic symbol, the conducting surface
connected to the P-material is much smaller, to permit the emergence of the maximum
number of photons of light energy. Note in the figure that the recombination of the injected
carriers due to the forward-biased junction results in emitted light at the site of
recombination. There may, of course, be some absorption of the packages of photon energy
in the structure itself, but a very large percentage are able to leave, as shown in the fig.

Fig.13. Process of electroluminescence in the LED


RESISTANCE
Resistance is the electronic component used to control the current passing through the
circuit. They are calibrated in ohms. In the other words resistance are circuit elements
having the function introducing electrical resistance into the circuit. There are three basic
types :
1. Fixed Resistance
2. Rheostat

Potentiometer
A fixed Resistance is a two terminal resistance whose electrical resistance is
constant. A rheostat is a resistance that can be changed in resistance value without opening
the circuit to make adjustment. Potentiometer is an adjustable resistance with three
terminals one each end of the resistance element and third movable along its length.

CAPACITOR
A capacitor is a device capable of storing an electric charge (static electricity). It consists of
two metal plates separated by dielectric material. Capacitors are available in values ranging
from less than one picofarad to thousands of microfarad. While using a capacitor its ratings
must be carefully observed to make certain that the potential to be applied across the
capacitor is not greater than the rated value.

TYPES OF CAPACITORS :
Depends upon the basis of dielectric used:

Air insulated & vaccum capacitors

Paper insulated capacitors

Mica capacitors

Plastic film capacitors

Ceramic capacitors

Electrolytic & tantalum capacitors


CERAMIC CAPACITOR :
In this project, 0.01 microfarad capacitor is a ceramic capacitor.
The basis of the ceramic material is mainly barium titanate or a similar material, but other
ceramic substance including hydrous silicate of magnesia or talc are also used. The
electrodes are applied in the form of silver which is either spread or plated on to the
opposite faces of a thin tube, wafer or disc made from the ceramic material. Connecting
wires are then soldered to this deposit and the whole capacitor dipped in for a suitable
coating.

Fig.14 Tabular and disc type ceramic capacitors

ELECTROLYTIC CAPACITOR :
In this project, 10f capacitor is an electrolytic capacitor. In this type of capacitors, the
dielectric consists of an extremely thin film of aluminum oxide formed on one of its
aluminum foil plates. Intimate contact with the other plate is achieved by impregnating the
paper between the foils with an electrolyte in the form of viscous substance, such as
ammonium borate. The sandwich is then rolled into a cylindrical element and housed in
either metallic cardboard, plastic or ceramic protective tube.

Fig.15. Electrolytic and Tantalum capacitor

SOLDERING
Soldering is the process of joining two metallic conductors the joint where two metal
conductors are to be joined or fused is heated with a device called soldering iron and then as
allow of tin and lead called solder is applied which melts and converse the joint. The solder
cools and solidifies quickly to ensure is good and durable connection between the jointed
metal converting the joint solder also present oxidation.
SOLDERING & DESOLDERING TECHNIQUES :
There are basically two soldering techniques:
1. Manual soldering with iron.
2. Mass soldering.
The iron consist of an insulated handle connected via a metal shank to the bit the function of
bit is to
1. Stare host & convey it to the component
2. To store and deliver molten solder 7 flux.
3. To remove surplus solder from joints.
Soldering bit are made of copper because it has good heat capacity & thermal conductivity.
It may erode after long term use to avoid it coating of nickel or tin is used.
SOLDERING WITH IRON :
The surface to be soldered must be cleaned & fluxed. The soldering iron switched on &
bellowed to attain soldering temperature. The solder in form of wire is allied hear the
component to be soldered &b heated with iron. The surface to be soldered is filled, iron is
removed & the joint is cold without disturbing.
Solder joint are supposed to
Provide permanent low resistance path
Make a robust mechanical link between PCB & leads of components.
Allow heat flow between component, joining elements & PCB.
Retain adequate strength with temperature variation.

The following precaution should be taken while soldering.


1. Use always an iron plated copper core tip for soldering iron.
2. Slightly fore the tip with a cut file when it is cold.
3. Use a wet sponge to wipe out dirt from the tip before soldering instead of asking the
iron.
4. Tighten the tip screw if necessary before iron is connected to power supply.
5. Clean component lead & copper pad before soldering.
6. Use proper tool for component handling instead of direct handling.
7. Apply solder between component leads, PCB pattern & tip of soldering iron.
8. Iron should be kept in contact with the joint s for 2-3 second s only instead of keeping
for very long or very small time.
9. Use optimum quantity of solder.
10. Use multistoried wire instead of single strands solvent like isopropyl alcohol.
11. Every time soldering is over, put a little clean solder on the tip.

IC 7805 :

Fig.16.Three Terminal Positive Fixed Voltage Regulators

These voltage regulators are monolithic integrated circuits designed as fixed


voltage. These regulators employ internal current limiting, thermal shutdown, and
safe-area compensation. With adequate heat sinking they can deliver output
currents in excess of 1.0A. Although designed primarily as a fixed voltage
regulator, these devices can be used with external components to obtain
adjustable voltages and currents.
Output Current in Excess of 1.0A
No external components required
Internal thermal overload protection
Internal short circuit current limiting

Output transistor safe area compensation


Output voltage offered in 2% and 4% tolerance
Available in surface mount D2pAK and standard 3-lead transistor packages
Previous commercial temperature range has been extended to a junction temperature
range of 40C to +125C

DESCRIPTION
The 7805 series of three terminal positive regulators are available in the TO-220/DPAK package and with several fixed output voltages, making them useful in a wide range of
applications. Each type employs internal current limiting, thermal shut down and safe
operating area protection, making it essentially indestructible. If adequate heat sinking is
provided, they can deliver over 1A output current. Although designed primarily as fixed
voltage regulators, these devices can be used with external components to obtain adjustable
voltages and currents.

Fig.17. Block Diagram of IC7805

IC AT89C2051 8-BIT MICROCONTROLLER WITH 2 KBYTES


FLASH
Features

Compatible with MCS-51 Products

2 Kbytes of Reprogrammable Flash Memory Endurance: 1,000 Write/Erase Cycles

2.7 V to 6 V Operating Range

Fully Static Operation: 0 Hz to 24 MHz

Two-Level Program Memory Lock

128 x 8-Bit Internal RAM

15 Programmable I/O Lines

Two 16-Bit Timer/Counters

Six Interrupt Sources

Programmable Serial UART Channel

Direct LED Drive Outputs


On-Chip Analog Comparator

Low Power Idle and Power Down Modes


Description
The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2
Kbytes 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 MCS-51 instruction set and pinout.
By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051
is a powerful microcomputer which provides a highly flexible and cost effective solution to
many embedded control applications.
The AT89C2051 provides the following standard features: 2 Kbytes of Flash, 128 bytes of
RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture,
a full duplex serial port, a precision analog comparator, on-chip oscillator and clock
circuitry. In addition, the AT89C2051 is designed with static logic for operation down to
zero frequency and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to
continue functioning. The Power Down Mode saves the RAM contents but freezes the
oscillator disabling all other chip functions until the next hardware reset.

Fig.18Pin Description

Pin description
VCC
Supply voltage.
GND
Ground.
Port 1
Port 1 is an 8-bit bidirectional I/O port. Port pins P1.2 to P1.7 provide internal pullups. P1.0
and P1.1 require external pullups. P1.0 and P1.1 also serve as the positive input (AIN0) and
the negative input (AIN1), respectively, of the on-chip precision analog comparator. The
Port 1 output buffers can sink 20 mA and can drive LED displays directly.
When 1s are written to Port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are
used as inputs and are externally pulled low, they will source current (IIL) because of the
internal pullups.
Port 1 also receives code data during Flash programming and program verification.

BLOCK DIAGRAM

Fig.19. block diagram

Port 3
Port 3 pins P3.0 to P3.5, P3.7 are seven bidirectional I/O pins with internal pullups. P3.6 is
hard-wired as an input to the output of the on-chip comparator and is not accessible as a
general purpose I/O pin. The Port 3 output buffers can sink 20 mA. When 1s are written to
Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,
Port 3 pins that are externally being pulled low will source current (IIL) because of the
pullups.
Port 3 also serves the functions of various special features of the AT89C2051 as listed
below:

Port Pin
Alternate Functions
P3.0
RXD (serial input port)
P3.1
TXD (serial output port)
P3.2
INT0 (external interrupt 0)
P3.3
INT1 (external interrupt 1)
P3.4
T0 (timer 0 external input)
P3.5
T1 (timer 1 external input)
Port 3 also receives some control signals for Flash programming and programming
verification.
RST
Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high
for two machine cycles while the oscillator is running resets the device. Each machine cycle
takes 12 oscillator or clock cycles.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which
can be configured for use as an on-chip oscillator, as shown in Fig. Either a quartz crystal or
ceramic resonator may be used. To drive the device from an external clock source, XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2. There are no
requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage
high and low time specifications must be observed.

Fig.20. Oscillator Connections

Notes: C1, C2 = 30 pF 10 pF for Crystals


= 40 pF 10 pF for Ceramic Resonators

Fig.21. oscillator

Special Function Registers


A map of the on-chip memory area called the Special Function Register (SFR) space is
shown in the table below. That not all of the addresses are occupied, and unoccupied
addresses may not be implemented on the chip.
Read accesses to these addresses will in general return random data, and write accesses will
have an indeterminate effect. User software should not write 1s to these unlisted locations,
since they may be used in future products to invoke new features. In that case, the reset or
inactive values of the new bits will always be 0.

Idle Mode
In idle mode, the CPU puts itself to sleep while all the onchip peripherals remain active.
The mode is invoked by software. The content of the on-chip RAM and all the special
functions registers remain unchanged during this mode. The idle mode can be terminated by
any enabled interrupt or by a hardware reset.
P1.0 and P1.1 should be set to 0 if no external pullups are used, or set to 1 if external
pullups are used. It should be noted that when idle is terminated by a hardware reset, the
device normally resumes program execution, from where it left off, up to two machine
cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to
internal RAM in this event, but access to the port pins is not inhibited. To eliminate the
possibility of an unexpected write to a port pin when Idle is terminated by reset, the
instruction following the one that invokes Idle should not be one that writes to a port pin or
to external memory.
Power Down Mode
In the power down mode the oscillator is stopped, and the instruction that invokes power
down is the last instruction executed. The on-chip RAM and Special Function Registers
retain their values until the power down mode is terminated. The only exit from power
down is a hardware reset. Reset redefines the SFRs but does not change the onchip RAM.
The reset should not be activated before VCC is restored to its normal operating level and
must be held active long enough to allow the oscillator to restart and stabilize. P1.0 and
P1.1 should be set to 0 if no external pullups are used, if pullups are used.
Programming The Flash
The AT89C2051 is shipped with the 2 Kbytes of on-chip PEROM code memory array in the
erased state (i.e., contents = FFH) and ready to be programmed. The code memory array is
programmed one byte at a time. Once the array is programmed, to re-program any nonblank byte, the entire memory array needs to be erased electrically.
Internal Address Counter:
The AT89C2051 contains an internal PEROM address counter, which is always reset to
000H on the rising edge of RST and is advanced by applying a positive going pulse to pin
XTAL1.
Programming Algorithm:
To program the AT89C2051, the following sequence is recommended.
1.
Power-up sequence:
Apply power between VCC and GND pins Set RST and XTAL1 to GND. With all
other pins floating, wait for greater than 10 milliseconds
2.
Set pin RST to H
Set pin P3.2 to H

3.

4.
5.
6.
7.
8.
9.
10.

Apply the appropriate combination of H or L logic levels to pins P3.3, P3.4, P3.5,
P3.7 to select one of the programming operations shown in the PEROM
Programming Modes table.
To Program and Verify the Array:
Apply data for Code byte at location 000H to P1.0 to P1.7.
Raise RST to 12V to enable programming.
Pulse P3.2 once to program a byte in the PEROM array or the lock bits. The bytewrite cycle is self-timed and typically takes 1.2 ms.
To verify the programmed data, lower RST from 12V to logic H level and set pins
P3.3 to P3.7 to the appropriate levels. Output data can be read at the port P1 pins.
To program a byte at the next address location, pulse XTAL1 pin once to advance
the internal address counter. Apply new data to the port P1 pins.
Repeat steps 5 through 8, changing data and advancing the address counter for the
entire 2 Kbytes array or until the end of the object file is reached.
Power-off sequence: set XTAL1 to L, set RST to L, Float all other I/O pins, Turn
Vcc power off

Flash Programming Modes

Fig.22 Programming the Flash Memory

Fig.23. Verifying the Flash Memory

COMPONENT LIST
RESISTORS

S.No.
1

3
4
5
6
7
8
9
10
11
12
13
14
15

16
17
18
19
20

Component List
Item
MCU 89C051
RF module
HT12E
HT12D
IC91214
IC4049
IC8870
IC555
IC817
IC3021
Push to On Sw
SOLDERING WIRE
SOLDERING IRON
FLUX
CONNECTING
WIRE
TR548
TR558
RESISTENCES
CAPACITORS
1000f
100f
470f
DIODES
LED
Crystal 12MHz
IC BASE
IF set
IC 7805 Volt. Reg
TRANSFORMER 9
V

Quantity
0
1

Rate/Unit
80
600
35

1
0
1
0
1
0
3
1
1
1

25
25
40
10
15
15
12
25
120
10

1
2
0
20

50
2
2
0.5

2
1
4
8
8
2
3
120
2

10
5
5
1
1
25
5
1
15

30

8051 micro controller


The 8051 developed and launched in the early 80`s, is one of the most popular micro
controller in use today. It has a reasonably large amount of built in ROM and RAM. In
addition it has the ability to access external memory.
The generic term `8x51` is used to define the device. The value of x defining the kind of
ROM, i.e. x=0, indicates none, x=3, indicates mask ROM, x=7, indicates EPROM and x=9
indicates EEPROM or Flash.
The early 8051, namely the 8031 was designed without any ROM. This device could run
only with external memory connected to it. Subsequent developments lead to the
development of the PROM or the programmable ROM. This type had the disadvantage of
being highly unreliable.
The next in line, was the EPROM or Erasable Programmable ROM. These devices used
ultraviolet light erasable memory cells. Thus a program could be loaded, tested and erased
using ultra violet rays. A new program could then be loaded again.
An improved EPROM was the EEPROM or the electrically erasable PROM. This does not
require ultra violet rays, and memory can be cleared using circuits within the chip itself.
Finally there is the FLASH, which is an improvement over the EEPROM. While the terms
EEPROM and flash are sometimes used interchangeably, the difference lies in the fact that
flash erases the complete memory at one stroke, and not act on the individual cells. This
results in reducing the time for erasure.
Intel 8051 is CISC architecture which is easy to program in assembly language and also has
a good support for High level languages.
The memory of the microcontroller can be extended up to 64k.
This microcontroller is one of the easiest microcontrollers to learn.
The 8051 microcontroller is in the field for more than 20 years. There are lots of books and
study materials are readily available for 8051.

Architecture
Architecture is must to learn because before learning new machine it is necessary to learn
the capabilities of the machine. This is some thing like before learning about the car you
cannot become a good driver. The architecture of the 8051 is given below.

The 8051 doesnt have any special feature than other microcontroller. The only feature is
that it is easy to learn. Architecture makes us to know about the hardware features of the
microcontroller. The features of the 8051 are

4K Bytes of Flash Memory


128 x 8-Bit Internal RAM
Fully Static Operation: 1 MHz to 24 MHz
32 Programmable I/O Lines
Two 16-Bit Timer/Counters
Six Interrupt Sources (5 Vectored)
Programmable Serial Channel
Low Power Idle and Power Down Modes

The 8051 has a 8-Bit CPU that means it is able to process 8 bit of data at a time. 8051 has
235 instructions. Some of the important registers and their functions are
3. 128 bytes on-chip RAM
This is the space provided for executing the program in terms of moving data, storing data
etc.
4. 32 I/O lines. (Four- 8 bit ports, labeled P0, P1, P2, P3)
In our bulb example, we used the notation p1.0. This means bit zero of port one. One bit
controls one bulb.
Thus port one would have 8 bits. There are a total of four ports named p0, p1, p2, p3, giving
a total of 32 lines. These lines can be used both as input or output.

5. Two 16 bit timers / counters.


A microcontroller normally executes one instruction at a time. However certain applications
would require that some event has to be tracked independent of the main program.
The manufacturers have provided a solution, by providing two timers. These timers execute
in the background independent of the main program. Once the required time has been
reached, (remember the time calculations described above?), they can trigger a branch in the
main program.
These timers can also be used as counters, so that they can count the number of events, and
on reaching the required count, can cause a branch in the main program.
6. Full Duplex serial data receiver / transmitter.

The 8051 microcontroller is capable of communicating with external devices like the PC
etc. Here data is sent in the form of bytes, at predefined speeds, also known as baud rates.
The transmission is serial, in the sense, one bit at a time
7. 5- interrupt sources with two priority levels (Two external and three internal)
During the discussion on the timers, we had indicated that the timers can trigger a branch in
the main program. However, what would we do in case we would like the microcontroller to
take the branch, and then return back to the main program, without having to constantly
check whether the required time / count has been reached?
This is where the interrupts come into play. These can be set to either the timers, or to some
external events. Whenever the background program has reached the required criteria in
terms of time or count or an external event, the branch is taken, and on completion of the
branch, the control returns to the main program.
Priority levels indicate which interrupt is more important, and needs to be executed first in
case two interrupts occur at the same time.
8. On-chip clock oscillator.
This represents the oscillator circuits within the microcontroller. Thus the hardware is
reduced to just simply connecting an external crystal, to achieve the required pulsing rate.

PIN FUNCTION OF IC 89C51.

1
2
3

Supply pin of this ic is pin no 40. Normally we apply a 5 volt regulated dc


power supply to this pin. For this purpose either we use step down transformer
power supply or we use 9 volt battery with 7805 regulator.
Ground pin of this ic is pin no 20. Pin no 20 is normally connected to the
ground pin ( normally negative point of the power supply.
XTAL is connected to the pin no 18 and pin no 19 of this ic. The quartz crystal
oscillator connected to XTAL1 and XTAL2 PIN. These pins also needs two
capacitors of 30 pf value. One side of each capacitor is connected to crystal and
other pis is connected to the ground point. Normally we connect a 12 MHz or
11.0592 MHz crystal with this ic.. But we use crystal upto 20 MHz to this pins
RESET PIN.. Pin no 9 is the reset pin of this ic.. It is an active high pin. On
applying a high pulse to this pin, the micro controller will reset and terminate all
activities. This is often referred to as a power on reset. The high pulse must

be high for a minimum of 2 machine cycles before it is allowed to go low.


5.

PORT0 Port 0 occupies a total of 8 pins. Pin no 32 to pin no 39. It can be used
for input or output. We connect all the pins of the port 0 with the pullup resistor
(10 k ohm) externally. This is due to fact that port 0 is an open drain mode. It is
just like a open collector transistor.

6.

PORT1. ALL the ports in micrcontroller is 8 bit wide pin no 1 to pin no 8


because it is a 8 bit controller. All the main register and sfr all is mainly 8 bit
wide. Port 1 is also occupies a 8 pins. But there is no need of pull up resistor in
this port. Upon reset port 1 act as a input port. Upon reset all the ports act as a
input port

7.

PORT2. port 2 also have a 8 pins. It can be used as a input or output. There is
no need of any pull up resistor to this pin.

PORT 3. Port3 occupies a totoal 8 pins from pin no 10 to pin no 17. It can be
used as input or output. Port 3 does not require any pull up resistor. The same as
port 1 and port2. Port 3 is configured as an output port on reset. Port 3 has the
additional function of providing some important signals such as interrupts. Port
3 also use for serial communication.

ALE ALE is an output pin and is active high. When connecting an 8031 to external
memory, port 0 provides both address and data. In other words, the 8031 multiplexes
address and data through port 0 to save pins. The ALE pin is used for demultiplexing the
address and data by connecting to the ic 74ls373 chip.
PSEN. PSEN stands for program store eneable. In an 8031 based system in which an
external rom holds the program code, this pin is connected to the OE pin of the rom.
EA. EA. In 89c51 8751 or any other family member of the ateml 89c51 series all come with
on-chip rom to store programs, in such cases the EA pin is connected to the Vcc. For family
member 8031 and 8032 is which there is no on chip rom, code is stored in external memory
and this is fetched by 8031. In that case EA pin must be connected to GND pin to indicate
that the code is stored externally.

SPECIAL FUNCTION REGISTER ( SFR) ADDRESSES.

ACC

ACCUMULATOR

0E0H

B REGISTER

0F0H

PSW

PROGRAM STATUS WORD

SP

STACK POINTER

DPTR

DATA POINTER 2 BYTES

DPL
DPH

LOW BYTE OF DPTR


HIGH BYTE OF DPTR

P0

PORT0

80H

P1

PORT1

90H

P2

PORT2

0A0H

P3

PORT3

0B0H

TMOD

TIMER/COUNTER MODE CONTROL

89H

TCON

TIMER COUNTER CONTROL

88H

TH0

TIMER 0 HIGH BYTE

8CH

TLO

TIMER 0 LOW BYTE

TH1

TIMER 1 HIGH BYTE

TL1

TIMER 1 LOW BYTE

SCON

SERIAL CONTROL

98H

SBUF

SERIAL DATA BUFFER

99H

PCON

POWER CONTROL

87H

0D0H
81H

82H
83H

8AH
8DH
8BH

COMPONENT DESCRIPTION
TRANSFORMER
Transformer works on the principle of mutual inductance. We know that if two coils or
windings are placed on the core of iron, and if we pass alternating current in one winding,
back emf or induced voltage is produced in the second winding. We know that alternating
current always changes with the time. So if we apply AC voltage across one winding, a
voltage will be induced in the other winding. Transformer works on this same principle. It is
made of two windings wound around the same core of iron. The winding to which AC
voltage is applied is called primary winding. The other winding is called as secondary
winding.
Voltage and current relationship:
Let V1 volts be input alternating voltage applied to primary winding. I 1 Amp is input
alternating current through primary winding. V2 volt is output alternating voltage produced
in the secondary. I2 amp be the current flowing through the secondary.
Then relationship between input and output voltages is given by
V1/V2 = N1/N2
Relationship between input and output currents is
I1/I2 = N2/N1
(Where N1 is no. of turns of coil in primary and N2 is number of turns in secondary )
We know that Power = Current X Voltage. It is to be noted that input power is equal to
output power. Power is not changed. If V2 is greater than V1, then I2 will be less than I1. This
type of transformer is called as step up transformer. If V 1 is greater than V2, then I1 will be
less than I2. This type of transformer is called as step down transformer.
For step up transformer, N2>N1, i.e., number of turns of secondary winding is more than
those in primary.
For step down transformer, N1>N2, i.e., numbers of turns of primary winding is more than
those in secondary.
RESISTORS
The flow of charge (or current) through any material, encounters an opposing force similar
in many respect to mechanical friction. This opposing force is called resistance of the
material. It is measured in ohms. In some electric circuits resistance is deliberately
introduced in the form of the resistor.
Resistors are of following types:
1. Wire wound resistors.
2. Carbon resistors.
3. Metal film resistors.

Wire Wound Resistors:


Wire wound resistors are made from a long (usually Ni-Chromium) wound on a ceramic
core. Longer the length of the wire, higher is the resistance. So depending on the value of
resistor required in a circuit, the wire is cut and wound on a ceramic core. This entire
assembly is coated with a ceramic metal. Such resistors are generally available in power of
2 watts to several hundred watts and resistance values from 1ohm to 100k ohms. Thus wire
wound resistors are used for high currents.
Carbon Resistors:
Carbon resistors are divided into three types:
a. Carbon composition resistors are made by mixing carbon grains with
binding material (glue) and moduled in the form of rods. Wire leads
are inserted at the two ends. After this an insulating material seals the
resistor. Resistors are available in power ratings of 1/10, 1/8, 1/4 ,
1/2 , 1.2 watts and values from 1 ohm to 20 ohms.
b. Carbon film resistors are made by deposition carbon film on a ceramic
rod. They are cheaper than carbon composition resistors.
c. Cement film resistors are made of thin carbon coating fired onto a
solid ceramic substrate. The main purpose is to have more precise
resistance values and greater stability with heat. They are made in a
small square with leads.
Metal Film Resistors:
They are also called thin film resistors. They are made of a thin metal coating deposited on
a cylindrical insulating support. The high resistance values are not precise in value;
however, such resistors are free of inductance effect that is common in wire wound resistors
at high frequency.
Variable Resistors:
Potentiometer is a resistor where values can be set depending on the requirement.
Potentiometer is widely used in electronics systems. Examples are volume control, tons
control, brightness and contrast control of radio or T.V. sets.
Fusible Resistors:
These resistors are wire wound type and are used in T.V. circuits for protection. They have
resistance of less than 15 ohms. Their function is similar to a fuse made to blow off
whenever current in the circuit exceeds the limit.

RESISTOR COLOR CODE


Example: 1k or 1000 ohms
1st

2nd

3rd

4th

Band1
Band 2
Band 3
Band 4
Fig25.colour codes

COLOUR CODES
COLOUR
Black
Brown
Red
Orange
Yellow
Green
Blue
Violet
Grey
White
Gold
Silver

NUMBER
0
1
2
3
4
5
6
7
8
9

MULTIPLIER
100
101
102
103
104
105
106
107
108
109
10-1
10-2

COLOUR
Gold
Silver
No colour

TOLERANCE
5%
10%
20%

CAPACITORS
A capacitor can store charge, and its capacity to store charge is called capacitance.
Capacitors consist of two conducting plates, separated by an insulating material (known as
dielectric). The two plates are joined with two leads. The dielectric could be air, mica,
paper, ceramic, polyester, polystyrene, etc. This dielectric gives name to the capacitor. Like
paper capacitor, mica capacitor etc.

Types of capacitors:

Capa
Fixed
Electr
Mica

Variable

NonPaper

Gang
conden

Trimme
r

Ceramic

Capacitors can be broadly classified in two categories, i.e., Electrolytic capacitors and NonElectrolytic capacitors as shown if the figure above.

Electrolytic Capacitor:
Electrolytic capacitors have an electrolyte as a dielectric. When such an electrolyte is
charged, chemical changes takes place in the electrolyte. If its one plate is charged
positively, same plate must be charged positively in future. We call such capacitors as
polarized. Normally we see electrolytic capacitor as polarized capacitors and the leads are
marked with positive or negative on the can. Non-electrolyte capacitors have dielectric

material such as paper, mica or ceramic. Therefore, depending upon the dielectric, these
capacitors are classified.
Mica Capacitor:
It is sandwich of several thin metal plates separated by thin sheets of mica. Alternate plates
are connected together and leads attached for outside connections. The total assembly is
encased in a plastic capsule or Bakelite case. Such capacitors have small capacitance value
(50 to 500pf) and high working voltage (500V and above). The mica capacitors have
excellent characteristics under stress of temperature variation and high voltage application.
These capacitors are now replaced by ceramic capacitors.
Ceramic Capacitor:
Such capacitors have disc or hollow tabular shaped dielectric made of ceramic material such
as titanium dioxide and barium titanate. Thin coating of silver compounds is deposited on
both sides of dielectric disc, which acts as capacitor plates. Leads are attached to each sides
of the dielectric disc and whole unit is encapsulated in a moisture proof coating. Disc type
capacitors have very high value up to 0.001uf. Their working voltages range from 3V to
60000V. These capacitors have very low leakage current. Breakdown voltage is very high.
Paper Capacitor:
It consists of thin foils, which are separated by thin paper or waxed paper. The sandwich of
foil and paper is then rolled into a cylindrical shape and enclosed in a paper tube or encased
in a plastic capsules. The lead at each end of the capacitor is internally attached to the metal
foil. Paper capacitors have capacitance ranging from 0.0001uf to 2.0uf and working voltage
rating as high as 2000V.

Das könnte Ihnen auch gefallen