Sunteți pe pagina 1din 42

CHAPTER 1

INTRODUCTION
1.1 INTRODUCTION

CHAPTER 2
2. Block diagram of Embedded solar system for college, industries.

POWER CIRCUIT DC 5V

LDR
L298
MICRO CONTROLLER
P89V51RD2

DC MOTOR
Oscillator &
Reset circuit

2.2 HARDWARE DETAILS:


The above figure shows the Embedded based customized wireless message
circular system block diagram.It mainly consists
1. Micro controller
2

2. Power Supply
3. LCD Display Unit

MICRO - CONTROLLER:
The P89V51RD2 is an 80C51 microcontroller with 64 kB Flash and 1024
bytes of data RAM. A key feature of the P89V51RD2 is its X2 mode option.
The design engineer canchoose to run the application with the conventional
80C51 clock rate (12 clocks per machine cycle) or select the X2 mode (6
clocks per machine cycle) to achieve twice the throughput at the same
clock frequency. Another way to benefit from this feature is to keep the
same erformance by reducing the clock frequency by half, thus
dramatically reducing the EMI.
The Flash program memory supports both parallel programming
and in serial In-System Programming (ISP). Parallel programming mode
offers gang-programming at high speed, reducing programming costs and
time to market.ISP allows a device to be reprogrammed in the end product
under software control. The capability to field/update the application
firmware makes a wide range of applications possible. The P89V51RD2 is
also In-Application Programmable (IAP), allowing the Flash program
memory to be reconfigured even while the application is running.
Features:
80C51 Central Processing Unit
5 V Operating voltage from 0 to 40 MHz
64 kB of on-chip Flash program memory with ISP (In-System Programming)
and
IAP (In-Application Programming)
Supports 12-clock (default) or 6-clock mode selection via software or ISP
SPI (Serial Peripheral Interface) and enhanced UART
PCA (Programmable Counter Array) with PWM and Capture/Compare
functions
Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each) Three 16bit timers/counters
Programmable Watchdog timer (WDT)
Eight interrupt sources with four priority levels
Second DPTR register
Low EMI mode (ALE inhibit)
TTL- and CMOS-compatible logic levels

LCD DISPLAY UNIT:


LCD is flexible controller and can be used with 8 bit or 4 bit. Micro controller
using the data and control lines Micro controller displays selected item and other
calculated results on its screen.
POWER SUPPLY:
The Power Supply unit is used to provide a constant 5 volts Regulated Supply
to different ICs this is standard circuits using external 12 VDC adapter and fixed 3pin voltage regulator. Diode is added in series to avoid Reverse Voltage Protection

3.COMPONENT LIST

P89v51rd2
40 pin ZIP SOCKET
16X2 LCD
MAX 232
RS 232 CABLE
PULL UP RESISTOR (2)
CRYSTAL 11.09MHZ
TRANSFORMER 9 0 9/1A
CONNECTORS (10)
8051 DEVELOPMENT BOARD
DIODE(1N4007),Resistor(8.2K,1K,)
,Capacitor(10uf,1000uf,33pf,0.1uf )10KPOT,LED,
IC(7805)

CHAPTER-3
HARDWARE DETAILS
3.1 POWER SUPPLY
The Power Supply unit is used to provide a constant 5 volts Regulated Supply
to different ICs this is standard circuits using external 12 VDC adapter and fixed 3pin voltage regulator. Diode is added in series to avoid Reverse Voltage Protection.

BLOCK DIAGRAM:

Fig: 3.1 Block diagram of Power Supply


3.1.1 STEP DOWN TRANSFORMER:

When AC is applied to the primary winding of the power transformer it can


either be stepped down or up depending on the value of DC needed. In our circuit the
transformer of 230v/15-0-15v is used to perform the step down operation where a
230V AC appears as 15V AC across the secondary winding. One alteration of input
causes the top of the transformer to be positive and the bottom negative. The next
alteration will temporarily cause the reverse. The current rating of the transformer
used in our project is 2A. Apart from stepping down AC voltages, it gives isolation
between the power source and power supply circuitries.
3.1.2 RECTIFIER UNIT:

In the power supply unit, rectification is normally achieved using a solid state
diode. Diode has the property that will let the electron flow easily in one direction at
proper biasing condition. As AC is applied to the diode, electrons only flow when the
node and cathode is negative. Reversing the polarity of voltage will not permit
electron flow.

A commonly used circuit for supplying large amounts of DC power is the


bridge rectifier. A bridge rectifier of four diodes (4*IN4007) are used to achieve full
wave rectification. Two diodes will conduct during the negative cycle and the other
two will conduct during the positive half cycle. The DC voltage appearing across the
output terminals of the bridge rectifier will be somewhat lass than 90% of the applied
rms value. Normally one alteration of the input voltage will reverse the polarities.
Opposite ends of the transformer will therefore always be 180 deg out of phase with
each other.
For a positive cycle, two diodes are connected to the positive voltage at the top
winding and only one diode conducts. At the same time one of the other two diodes
conducts for the negative voltage that is applied from the bottom winding due to the
forward bias for that diode. In this circuit due to positive half cycleD1 & D2 will
conduct to give 10.8v pulsating DC. The DC output has a ripple frequency of 100Hz.
Since each altercation produces a resulting output pulse, frequency = 2*50 Hz. The
output obtained is not a pure DC and therefore filtration has to be done.
3.1.3 FILTERING UNIT:

Filter circuits which are usually capacitors acting as a surge arrester always
follow the rectifier unit. This capacitor is also called as a decoupling capacitor or a
bypassing capacitor, is used not only to short the ripple with frequency of 120Hz to
ground but also to leave the frequency of the DC to appear at the output. A load
resistor R1 is connected so that a reference to the ground is maintained. C1R1 is for
bypassing ripples. C2R2 is used as a low pass filter, i.e. it passes only low frequency
signals and bypasses high frequency signals. The load resistor should be 1% to 2.5%
of the load.
1000f/25v

: for the reduction of ripples from the pulsating.

10f/25v

: for maintaining the stability of the voltage at the load side.O,

1f

: for bypassing the high frequency disturbances.

3.1.4 7805 VOLTAGE REGULATORS:

The LM78XX series of three terminal regulators is available with several


fixed output voltages making them useful in a wide range of applications. One of
these is local on card regulation, eliminating the distribution problems associated with
single point regulation. The voltages available allow these regulators to be used in
logic systems, instrumentation, HiFi, and other solid state electronic equipment.
Although designed primarily as fixed voltage regulators these devices can be used
with external components to obtain adjustable voltages and currents. The LM78XX
series is available in an aluminum TO-3 package which will allow over 1.0A load
current if adequate heat sinking is provided. Current limiting is included to limit the
peak output current to a safe value. Safe area protection for the output transistor is
provided to limit internal power dissipation.
If internal power dissipation becomes too high for the heat sinking provided,
the thermal shutdown circuit takes over preventing the IC from overheating.
Considerable effort was expanded to make the LM78XX series of regulators easy to
use and minimize the number of external components. It is not necessary to bypass
the output, although this does improve transient response. Input bypassing is needed
only if the regulator is located far from the filter capacitor of the power supply. For
output voltage other than 5V, 12V and 15V the LM117 series provides an output
voltage range from 1.2V to 57V.
Features:
Output current in excess of 1A
Internal thermal overload protection
No external components required
Output transistor safe area protection
Internal short circuit current limit
Available in the aluminum TO-3 package

Fig: 3.2 plastic Package of Voltage Regulator


3.1.5 THREE TERMINAL POSITIVE VOLTAGE REGULATOR:
These voltage regulators are monolithic integrated circuits designed as fixed
voltage regulators for a wide variety of applications including local, oncard
regulation. These regulators employ internal current limiting, thermal shutdown, and
safearea compensation. With adequate heat sinking they can deliver output currents
in excess of 1.0 A. 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.0 A

No External Components Required

Internal Thermal Overload Protection

Internal Short Circuit Current Limiting

Output Transistor SafeArea Compensation

Output Voltage Offered in 2% and 4% Tolerance

Available in Surface Mount D2PAK and Standard 3Lead Transistor

3.1.6 STANDARD APPLICATION

Fig: 3.3 MC78XX Voltage Regulator

A common ground is required between the input and the output voltages. The
input voltage must remain typically 2.0 V above the output voltage even during the
low point on the input ripple voltage.
XX- These two digits of the type number indicate nominal voltage.
Cin-

is required if regulator is located an appreciable distance from power supply

filter.
CO- is not needed for stability; however, it does improve transient response. Values
of
less than 0.1 mF could cause instability.

Resistor
Resistor is a passive component used to control current in a circuit.
Its resistance is given by the ratio of voltage applied across its
terminals to the current passing through it. Thus a particular value
of resistor, for fixed voltage, limits the current through it. They are
omnipresent in electronic circuits.
An electric resistor is a two-terminal passive component specifically used to
oppose and limit current. A resistor works on the principle of Ohms Law which
states that voltage across the terminals of a resistor is directly proportional to
the current flowing through it.
The different value of resistances are used to limit the currents or
get the desired voltage drop according to the current-voltage rating
of the device to be connected in the circuit. For example, if
an LED of rating 2.3V and 6mA is to be connected with a supply of
5V, a voltage drop of 2.7V (5V-2.3V) and limiting current of 6mA is
required. This can be achieved by providing a resistor of 450
connected in series with the LED.
10

Resistors can be either fixed or variable. The low power resistors are
comparatively smaller in size than high power resistors. The
resistance of a resistor can be estimated by their colour codes or
can be measured by a multimeter. There are some non linear
resistors also whose resistance changes with temperature or light.
Negative temperature coefficient (NTC), positive temperature
coefficient (PTC) and light dependent resistor (LDR) are some such
resistors. These special resistors are commonly used as sensors.
Read and learn about internal structure and working of a resistor.
Pin Diagram:

Capacitor
Capacitor is a passive component used to store charge. The charge
(q) stored in a capacitor is the product of its capacitance (C) value
and the voltage (V) applied to it. Capacitors offer infinite reactance
to zero frequency so they are used for blocking DC components or
bypassing the AC signals. The capacitor undergoes through a
recursive cycle of charging and discharging in AC circuits where the
voltage and current across it depends on the RC time constant. For
this reason, capacitors are used for smoothing power supply
variations. Other uses include, coupling the various stages of audio
system, tuning in radio circuits etc. These are used to store energy
like in a camera flash.
Capacitors may be non-polarized/polarized and fixed/variable. Electrolytic
capacitors are polarized while ceramic and paper capacitors are examples of
non polarized capacitors. Since capacitors store charge, they must be
carefully discharged before troubleshooting the circuits. The maximum voltage
rating of the capacitors used must always be greater than the supply
voltage. Click to learn more about working of a capacitor along with its internal
structure.

11

Diode
A Diode is the simplest two-terminal unilateral semiconductor device. It
allows current to flow only in one direction and blocks the current that flows in
the opposite direction. The two terminals of the diode are called as anode and
cathode. The symbol of diode is as shown in the figure below.

The characteristics of a diode closely match to that of a switch. An ideal


switch when open does not conduct current in either directions and in closed
state conducts in both directions. The characteristic of a diode is as shown
in
the
figure
below.

12

Ideally, in one direction that is indicated by the arrow head diode must behave
short circuited and in other one that opposite to that of the direction of arrow
head must be open circuited. By ideal characteristics, the diodes is designed
to meet these features theoretically but are not achieved practically. So the
practical diode characteristics are only close to that of the desired.

Application:
Diodes are used in various applications like rectification, clipper, clamper,
voltage multiplier, comparator, sampling gates and filters.
1. Rectification The rectification means converting AC voltage into DC
voltage. The common rectification circuits are half wave rectifier (HWR), full
wave rectifier (FWR) and bridge rectifier.

Half wave rectifier: This circuit rectifies either positive or negative


pulse of the input AC. The figure is as shown below:

Full wave rectifier: This circuit converts the entire AC signal into
DC. The figure is as shown below:
13

Bridge rectifier: This circuit converts the entire AC signal into DC.

The figure is as shown below:

2. Clipper- Diode can be used to clip off some portion of pulse without
distorting the remaining part of the waveform. The figure is as shown below:

3. Clamper A clamping circuit restricts the voltage levels to exceed a limit


by shifting the DC level. The peak to peak is not affected by clamping. Diodes
with resistors and capacitors are used to make clamping circuits. Sometimes

14

independent DC sources can be used to provide additional shift. The figure is


as shown below:

Characteristics:

15

The current that flows through a diode is given by the equation:

where ID - diode current. (Positive for forward and negative for reverse)
IS - constant reverse saturation current
V - applied voltage. (Positive for forward and negative for reverse)
- factor dependent upon the nature of semiconductor. (1 for
germanium and 2 for silicon)
VT - volt equivalent of temperature which is given by T/11600. (T is
Temperature in Kelvin)
When a forward voltage is applied at the terminals of a diode, the diode
begins to conduct. During conduction, the cut in or threshold voltage exceeds
the applied forward voltage. The threshold voltage for a germanium diode is
0.3V and for silicon diode is 0.7V. The forward current (miliampere range)
initially increases linearly and then increases exponentially for high currents.
When a a reverse voltage is applied, a reverse saturation current flows
through the diode. The diode continues to be in the non conducting state until
the reverse voltage drops below the zener voltage. As the reverse voltage
approximates the peak inverse voltage a breakdown called as the Avalanche
breakdown occurs. During the breakdown, the minority charge carriers ionize
the stable atoms which are followed by a chain ionization to generate a large
number of free charge carriers. Thus the diode becomes short circuited and
gets damaged.
Note: When diodes are connected in series their equivalent peak inverse
voltage is increased while in parallel connection the current carrying capacity
is increased.
As the temperature increases, the electron pairs generated thermally also
increases thereby increasing the conductivity in both directions. The reverse
saturation current also increases with the increase in temperature. The
change is 11% per C for a germanium diode and 8% per C for a silicon
diode. On the other hand the diode current is doubled for every 10C rise.
With increase in voltage, the firing voltage in forward characteristics is
reduced while peak reverse voltage is increased.

16

Note: The peak inverse voltage can be reduced by increasing the doping
level. The same concept is used to design zener diodes.

DPDT relay
All electrical relays have one thing in common--they control things where it is
inconvenient or impossible for a person to flip a switch. For example,
electrical relays are used to turn on the motor to open an automatic garage
door, as well as to turn on a furnace.
Many modern relays are "solid state," meaning they use transistor-like devices
to do their work. Electromechanical relays, however, are still in use, and the
working parts are easy to see and understand. They include an electromagnet,
which is turned on by a low-voltage control circuit, and a contact switch,
which in turn controls the load circuit. When the electromagnet is energized, it
behaves just like someone flipping a light switch, by pulling the switch up or
down.
Poles and Throws
A simple electrical circuit requires two wires. Break one wire leading to a
lamp, and it goes out. That is exactly what most household switches do.
Called a single pole switch, it opens one wire in the circuit. Because it only
turn the light on or off, it is also called single throw. This type of switch is
labeled SPST. For a "three-way" circuit, however, a different kind of switch
is required; it is never off, it just routes one side of the circuit over one of two
wires. If both switches are set on the same wire, the lamp goes on. I f they
are set on different wires, the lamp goes off. This kind of switch is a single
pole, double throw (because it has two "on" positions), or SPDT.
The main circuit breaker in any building is another type of switch. It
positively disconnects all of the power to the building, so it breaks both
sides of the circuit. This is a double pole switch, and because it is only on or
off, it is a single throw, so it is a DPST switch.
The DPDT relay is the fourth kind of simple switch. The "DP" means that it
is double pole, so it switches both sides of the circuit, and the "DT" means
that rather than just turning on and off, it switches from one set of wires to
another.
DPDT stands for double pole double throw relay. Relay is an electromagnetic
device used to separate two circuits electrically and connect them
magnetically. They are often used to interface an electronic circuit, which
works at a low voltage to an electrical circuit which works at a high voltage.
Relays are available in different configuration of operating voltages like 6V,
9V, 12V, 24V etc.

17

There are two sections input and output. The input section consists of a coil
with two pins which are connected to the ground and the input signal. The
output section consists of contactors which connect or disconnect
mechanically. The output section consists of six contactors with two sets.
Each set has three changeover contacts, namely, normally open (NO),
normally closed (NC) and common (COM). When no supply is given the COM
is connected to NC. When the operating voltage is applied the relay coil gets
energized and the COM changes contact to NO.
DPDT relay can be used to power wither one device/appliance or another.
While SPDT relay can only switch the output circuit between on and off
states; a DPDT relay can also be used to change the polarity at the terminals
of a device connected at output. For example, to drive a DC motor in both
clockwise and anticlockwise directions, following connections can be done.
Pins 2 & 7 can be provided with Vcc (9V for motor) and ground,
respectively. The first motor terminal can be connected to pins 3 & 4 while the
other terminal to pins 5 & 6. In case no input signal is given, the motor would
rotate in one direction (say clockwise, depending upon the connection of its
terminals). When an input signal is provided, the contactors change
their positions, resulting in the anticlockwise rotation of motor.
Pin Diagram:

555 :
555 is a very commonly used IC for generating accurate timing pulses.
It is an 8pin timer IC and has mainly two modes of operation:
18

monostable and astable. In monostable mode time delay of the pulses


can be precisely controlled by an external resistor and a capacitor
whereas in astable mode the frequency & duty cycle are controlled by
two external resistors and a capacitor. 555 is very commonly used
for generating time delays and pulses.
Pin Description:

Pin No
1
2
3
4
5
6
7
8

Function
Ground (0V)
Voltage below 1/3 Vcc to trigger the pulse
Pulsating output
Active low; interrupts the timing interval at Output
Provides access to the internal voltage divider; default 2/3 Vcc
The pulse ends when the voltage is greater than Control
Open collector output; to discharge the capacitor
Supply voltage; 5V (4.5V - 16 V)

19

Name
Ground
Trigger
Output
Reset
Control Voltage
Threshold
Discharge
Vcc

L298
The L298 is an integrated monolithic circuit in a 15- lead Multiwatt and
PowerSO20 packages. It is a high voltage, high current dual full-bridge
driver designed to accept standard TTL logic levels and drive inductive
loads such as relays, solenoids, DC and stepping motors. Two enable
inputs are provided to enable or disable the device independently of the
input signals. The emitters of the lower transistors of each bridge are
connected together and the corresponding external terminal can be
used for the connection of an external sensing resistor. An additional
supply input is provided so that the logic works at a lower voltage.

20

21

APPLICATION INFORMATION
1.1. POWER OUTPUT STAGE
The L298 integrates two power output stages (A ; B). The power output
stage is a bridge configuration and its outputs can drive an inductive
load in common or differenzial mode, depending on the state of the
inputs. The current that flows through the load comes out from the
bridge at the sense output : an external resistor (RSA ; RSB.) allows to
detect the intensity of this current.
1.2. INPUT STAGE
Each bridge is driven by means of four gates the input of which are In1 ;
In2 ; EnA and In3 ; In4 ; EnB. The In inputs set the bridge state when

22

The En input is high ; a low state of the En input inhibits the bridge. All
the inputs are TTL compatible.
2. SUGGESTIONS
A non inductive capacitor, usually of 100 nF, must be foreseen between
both Vs and Vss, to ground, as near as possible to GND pin. When the
large capacitor of the power supply is too far from the IC, a second
smaller one must be foreseen near the L298. The sense resistor, not of
a wire wound type, must be grounded near the negative pole of Vs that
must be near the GND pin of the I.C. Each input must be connected to
the source of the driving signals by means of a very short path. Turn-On
and Turn-Off : Before to Turn-ON the Supply Voltage and before to Turn
it OFF, the Enable input must be driven to the Low state.
3. APPLICATIONS
Fig 6 shows a bidirectional DC motor control Schematic Diagram for
which only one bridge is needed. The external bridge of diodes D1 to
D4 is made by four fast recovery elements (trr200 nsec) that must be
chosen of a VF as low as possible at the worst case of the load current.
The sense output voltage can be used to control the current amplitude
by chopping the inputs, or to provide overcurrent protection by switching
low the enable
input. The brake function (Fast motor stop) requires that the Absolute
Maximum Rating of 2 Amps must never be overcome. When the
repetitive peak current needed from the load is higher than 2 Amps, a
paralleled configuration can be chosen .An external bridge of diodes
are required when inductive loads are driven and when the inputs of the
IC are chopped Shottky diodes would be preferred.

DC MOTOR:
In any electric motor, operation is based on simple electromagnetism.
A current-carrying conductor generates a magnetic field; when this is
then placed in an external magnetic field, it will experience a force
proportional to the current in the conductor, and to the strength of the
external magnetic field. As you are well aware of from playing with
magnets as a kid, opposite (North and South) polarities attract, while like
polarities (North and North, South and South) repel. The internal
configuration of a DC motor is designed to harness the magnetic
interaction between a current-carrying conductor and an external
magnetic field to generate rotational motion.

23

Let's start by looking at a simple 2-pole DC electric motor (here red


represents a magnet or winding with a "North" polarization, while green
represents a magnet or winding with a "South" polarization).

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commutator, field magnet(s), and brushes. In most common DC motors
(and all that BEAMers will see), the external magnetic field is produced
by high-strength permanent magnets1. The stator is the stationary part of
the motor -- this includes the motor casing, as well as two or more
permanent magnet pole pieces. The rotor (together with the axle and
attached commutator) rotate with respect to the stator. The rotor consists
of windings (generally on a core), the windings being electrically
connected to the commutator. The above diagram shows a common motor
layout -- with the rotor inside the stator (field) magnets.
The geometry of the brushes, commutator contacts, and rotor windings
are such that when power is applied, the polarities of the energized
winding and the stator magnet(s) are misaligned, and the rotor will rotate
until it is almost aligned with the stator's field magnets. As the rotor
reaches alignment, the brushes move to the next commutator contacts,
24

and energize the next winding. Given our example two-pole motor, the
rotation reverses the direction of current through the rotor winding,
leading to a "flip" of the rotor's magnetic field, driving it to continue
rotating.
In real life, though, DC motors will always have more than two poles
(three is a very common number). In particular, this avoids "dead spots"
in the commutator. You can imagine how with our example two-pole
motor, if the rotor is exactly at the middle of its rotation (perfectly
aligned with the field magnets), it will get "stuck" there. Meanwhile, with
a two-pole motor, there is a moment where the commutator shorts out the
power supply (i.e., both brushes touch both commutator contacts
simultaneously). This would be bad for the power supply, waste energy,
and damage motor components as well. Yet another disadvantage of such
a simple motor is that it would exhibit a high amount of torque "ripple"
(the amount of torque it could produce is cyclic with the position of the
rotor).

In real life, though, DC motors will always have more than two poles
(three is a very common number). In particular, this avoids "dead spots"
in the commutator. You can imagine how with our example two-pole
motor, if the rotor is exactly at the middle of its rotation (perfectly aligned
with the field magnets), it will get "stuck" there. Meanwhile, with a twopole motor, there is a moment where the commutator shorts out the power
supply (i.e., both brushes touch both commutator contacts
simultaneously). This would be bad for the power supply, waste energy,
and damage motor components as well. Yet another disadvantage of such
a simple motor is that it would exhibit a high amount of torque "ripple"
(the amount of torque it could produce is cyclic with the position of the
rotor).

25

The use of an iron core armature (as in the Mabuchi, above) is quite
common, and has a number of advantages 2. First off, the iron core
provides a strong, rigid support for the windings -- a particularly
important consideration for high-torque motors. The core also conducts
heat away from the rotor windings, allowing the motor to be driven
harder than might otherwise be the case. Iron core construction is also
relatively inexpensive compared with other construction types.
But iron core construction also has several disadvantages. The iron
armature has a relatively high inertia which limits motor acceleration.
This construction also results in high winding inductances which limit
brush and commutator life.
In small motors, an alternative design is often used which features a
'coreless' armature winding. This design depends upon the coil wire itself
for structural integrity. As a result, the armature is hollow, and the
permanent magnet can be mounted inside the rotor coil.
Coreless DC motors have much lower armature inductancethan iron-core
motors of comparable size, extending brush and commutator life.

The coreless design also allows manufacturers to build smaller motors;


meanwhile, due to the lack of iron in their rotors, coreless motors are
somewhat prone to overheating. As a result, this design is generally used
26

just in small, low-power motors. BEAMers will most often see


coreless DC motors in the form of pager motors.

At a simplistic level, using DC motors is pretty straightforward -- you put


power in, and get rotary motion out. Life, of course, is never this simple
-- there are a number of subtleties of DC motor behavior that should be
accounted for in BEAMbot design.

3.1.7 TRANSFORMER:

Fig: 3.4 Transformer

Transformers convert AC electricity from one voltage to another with little


loss of power. Transformers work only with AC and this is one of the reasons why
mains electricity is AC.

27

Step-up transformers increase voltage, step-down transformers reduce voltage.


Most power supplies use a step-down transformer to reduce the dangerously high
mains voltage (230V in UK) to a safer low voltage.
The input coil is called the primary and the output coil is called the
secondary. There is no electrical connection between the two coils, instead they are
linked by an alternating magnetic field created in the soft-iron core of the transformer.
The two lines in the middle of the circuit symbol represent the core.

Fig: 3.5 Step Down Transformer


Transformers waste very little power so the power out is (almost) equal to the power
in. Note that as voltage is stepped down current is stepped up.

The ratio of the number of turns on each coil, called the turns ratio,
determines the ratio of the voltages. A step-down transformer has a large number of
turns on its primary (input) coil which is connected to the high voltage mains supply,

28

and a small number of turns on its secondary (output) coil to give a low output
voltage.
CIRCUIT DIAGRAM:

Fig: 3.6 Circuit Diagram Of Power Supply


3.1.8 CIRCUIT DESCRIPTION:
The +5 volt power supply is based on the commercial 7805 voltage
regulator IC.This IC contains all the circuitry needed to accept any input voltage
from 8 to 18 volts and produce a steady +5 volt output, accurate to within 5%
(0.25 volt). It also contains current-limiting circuitry and thermal overload
protection, so that the IC won't be damaged in case of excessive load current; it
will reduce its output voltage instead.
The 1000f capacitor serves as a "reservoir" which maintains a
reasonable input voltage to the 7805 throughout the entire cycle of the ac line
voltage. The two rectifier diodes keep recharging the reservoir capacitor on
alternate half-cycles of the line voltage, and the capacitor is quite capable of
sustaining any reasonable load in between charging pulses.

29

The 10f and .01f capacitors serve to help keep the power supply output
voltage constant when load conditions change. The electrolytic capacitor
smooths out any long-term or low frequency variations. However, at high
frequencies this capacitor is not very efficient. Therefore, the .01f is included to
bypass high-frequency changes, such as digital IC switching effects, to ground.
The LED and its series resistor serve as a pilot light to indicate when the
power supply is on. I like to use a miniature LED here, so it will serve that
function without being obtrusive or distracting while I'm performing an
experiment. I also use this LED to tell me when the reservoir capacitor is
completely discharged after power is turned off. Then I know it's safe to remove
or install components for the next experiment.
3.2 MICRO CONTROLLER
BLOCK DIAGRAM /PIN DIAGRAM etc.
GIVEN IN DATA SHEET

3.3.1 P89V51RD2 PIN DESCRIPTION


VCC
Supply voltage.
GND:
Ground.
PORT 0
Port 0 is an 8-bit open drain bidirectional 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 can 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 pullups. Port 0 also receives the code bytes during Flash programming
and outputs the code bytes during program verification. External pullups are required
during program verification.
PORT 1

30

Port 1 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups 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 pullups. In addition, P1.0 and P1.1 can be configured to be the timer/counter
2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX),
respectively, as shown in the following table.
Port 1 also receives the low-order address bytes during Flash programming
and verification.

3.1 Table for port 0


PORT 2
Port 2 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups 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
pullups. Port 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that use 16-bit
addresses (MOVX @DPTR). In this application, Port 2 uses strong internal pullups
when emitting 1s. During accesses to external data memory that use 8-bit addresses
(MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register.
Port 2 also receives the high-order address bits and some control signals during
Flash programming and verification.
PORT 3

31

Port 3 is an 8-bit bidirectional I/O port with internal pullups. 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 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 AT89S51, as shown
in the following table.
Port 3 also receives some control signals for Flash programming and
verification.

3.2 Table for port 3


RST
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives High for 96 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to
disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature
is enabled.
ALE/PROG
Address Latch Enable (ALE) 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

32

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 (PSEN) is the read strobe to external program memory.
When the AT89S51 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. EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2:
Output from the inverting oscillator amplifier.

3.3.2 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 Figure
1. 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
33

clock signal, since the input to the internal clocking circuitry is through a divide-bytwo flip-flop, but minimum and maximum voltage high and low time specifications
must be observed.

Fig: 3.9 CIRCUIT DIAGRAM OF CRYSTAL OSCILLATOR


OSCILLATOR CONNECTIONS:

34

Fig: 3.10 Fig Of Oscillator connection


TMOD (Timer Mode Register):
7

GATE

C/T

M1

M0

3
GATE

C/T

M1

MO

GATE: When set, start and stop of timer by hardware


When reset, start and stop of timer by software
C/T: Cleared for timer operation
Set for counter operation

M1

M0

MODE

OPERATING MODE

13-bit timer mode

16-bit timer mode

8-bit timer mode

Split timer mode

TCON (Timer Control Register):


Address =88H
Bit addressable
7

35

TF1

TF:

TR1

TF0

TR0

IE1

IT1

IE0

IT0

Timer overflow flag. Set by hardware when the timer/counter overflows. It is


cleared by hardware, as the processor vectors to the interrupt service routine.

TR:

Timer run control bit. Set or cleared by software to turn timer or

counter

on/off.
IE:

Set by CPU when the external interrupt edge (H-to-L transition) is detected. It

is
cleared by CPU when the interrupt is processed.
IT:

Set/cleared by software to specify falling edge/low-level triggered external


interrupt

5.3 MAX232:
The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to
supply EIA-232 (Electronic Industries Association) 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 hysteresis 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 Instruments LinASIC. Library.

The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic
levels during serial communication of microcontrollers with PC. The controller
operates at TTL logic level (0-5V) whereas the serial communication in PC

36

works on RS232 standards (-25 V to + 25V). This makes it difficult to establish


a direct link between them to communicate with each other.

The intermediate link is provided through MAX232. It is a dual driver/receiver


that includes a capacitive voltage generator to supply RS232 voltage levels
from a single 5V supply. Each receiver converts RS232 inputs to 5V
TTL/CMOS levels. These receivers (R1 & R2) can accept 30V inputs. The
drivers (T1 & T2), also called transmitters, convert the TTL/CMOS input level
into RS232 level.

The transmitters take input from controllers serial transmission pin and send
the output to RS232s receiver. The receivers, on the other hand, take input
from transmission pin of RS232 serial port and give serial output to
microcontrollers receiver pin. MAX232 needs four external capacitors whose
value ranges from 1F to 22F.

Microcontroller
Tx
Rx

MAX232
T1/2 In
R1/2 Out

T1/2 Out
R1/2 In

Pin Diagram:

37

RS232
Rx
Tx

Pin Description:

Pin
No
1
2
3
4
5
6
7
8
9
10
11
12
13

Function

Name
Capacitor 1 +
Capacitor 3
+
Capacitor 1 Capacitor 2
+
Capacitor 2 Capacitor 4 T2 Out

Capacitor connection pins

Output pin; outputs the serially transmitted data at


RS232 logic level; connected to receiver pin of PC serial
port
Input pin; receives serially transmitted data at RS 232 R2 In
logic level; connected to transmitter pin of PC serial port
Output pin; outputs the serially transmitted data at TTL R2 Out
logic level; connected to receiver pin of controller.
Input pins; receive the serial data at TTL logic level;
T2 In
connected to serial transmitter pin of controller.
T1 In
Output pin; outputs the serially transmitted data at TTL R1 Out
logic level; connected to receiver pin of controller.
Input pin; receives serially transmitted data at RS 232 R1 In
logic level; connected to transmitter pin of PC serial port
38

14
15
16

Output pin; outputs the serially transmitted data at


T1 Out
RS232 logic level; connected to receiver pin of PC serial
port
Ground (0V)
Ground
Supply voltage; 5V (4.5V 5.5V)
Vcc

5.4 RS232:
Information being transferred between data processing equipment and
peripherals is in the form of digital data which is transmitted in either a serial or
parallel mode. Parallel communications are used mainly for connections between test
instruments or computers and printers, while serial is often used between computers
and other peripherals. Serial transmission involves the sending of data one bit at a
time, over a single communications line. In contrast, parallel communications require
at least as many lines as there are bits in a word being transmitted (for an 8-bit word, a
minimum of 8 lines are needed). Serial transmission is beneficial for long distance
communications, whereas parallel is designed for short distances or when very high
transmission rates are required.
Standards
One of the advantages of a serial system is that it lends itself to transmission
over telephone lines The serial digital data can be converted by modem, placed onto a
standard voice-grade telephone line, and converted back to serial digital data at the
receiving end of the line by another modem. Officially, RS-232 is defined as the
Interface between data terminal equipment and data communications equipment
using serial binary data exchange. This definition defines data terminal equipment
(DTE) as the computer, while data communications equipment (DCE) is the modem.
A modem cable has pin-to-pin connections, and is designed to connect a DTE device
to a DCE device.
CHAPTER 6

39

6.SOFTWARE DISCUSSION
6.1 KEIL COMPILER -

6.2 DIP TRACE used for designing PCB .first a schematic of the circuit is
designed ,it can be simulated tested and modified .From the schematic a layout
can be made .This layout(mirror image ) is printed on the PCB (copper
side),then etching is performed to remove copper .Etching will remove all
copper but the copper inside the print will remain and traces are formed .
Drilling and Soldering are the next steps .

6.3 FLASH MAGIC- from flash magic manual


8. RESULT:

1. SCHEMATIC DIAGRAM:

40

8.CIRCUIT DIAGRAM EXPLANATION

10.WORKING PRINCIPLE

10. CONCLUSION

11. FUTURE SCOPE

12. BIBLIOGRAPHY:
8051-MICROCONTROLLER AND EMBEDDED SYSTEM.Pg.No.120-250
- Mohd. Ali Mazidi
The 8051 MICRO-CONTROLLER
- Ayala
PROGRAMMING AND CUSTOMIZING THE 8051

41

- Myke Predko
WEBSITES REFERRED

www.phillips.databook.com

www.keil.com

www.google.com

WWW.8051projects.com

WWW.freeprojects.com

WWW.electronicsforyou.com

42

S-ar putea să vă placă și