vg1 (2) - copy
TRANSCRIPT
-
7/28/2019 vg1 (2) - Copy
1/75
ACCELEROMETER BASED ROBOTIC ARM
PROJECT REPORT
ON
ACCELEROMETER BASED ROBOTIC ARM
Submitted in partial fulfillment of the requirements for the
award of the degree
of
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERINGTo
BADDI UNIVERSITY OF EMERGING SCIENCES &TECHNOLOGY,BADDI
SUPERVISOR
SUBMITTED BY
Ms. Kamna Kohli Ankit
kashyap (13503)
Lecturer Preet kamalRana
(13537)
I.E.E.T., Baadi LalitaSharma(13540)
DEPTT. OF ELECTRONICS & COMMUNICATION
ENGINEERING INSTITUTE OF ENGINEERING & EMERGING
TECHNOLOGIES, BADDI MAY, 2011
-
7/28/2019 vg1 (2) - Copy
2/75
ACCELEROMETER BASED ROBOTIC ARM
CANDIDATES DECLARATION
I hereby declare that the work which is being presented in this dissertation
entitled, ACCELEROMETER BASED ROBOTIC ARM submitted in the
partial fulfillment of the requirements for the award of the degree of
BACHELOR OF TECHNOLOGY in ELECTRONICS &
COMMUNICATION ENGINEERING, to H.P.U., Baddi, H.P, India, is an
authentic record of my own work carried out from February 2011 to May,2011
under the supervision ofMs. kamna kohli, I.E.E.T., Baddi, H.P.
The matter embodied in this dissertation report has not been submitted by me forthe award of any other degree.
Place:Baddi
Date:
Ankitkashyap(135030)
PreetkamaRana(13537)
Lalita Sharma(13540)
This is to certify that the above statement made by the candidate is correct to the
best of my knowledge.
PROJECT GUIDE MS. PAMELA
CHAWLA
Ms.Kamna kohli. HOD
(ECE)
This is certified that the viva voice has been taken and the project report has been
found satisfactory.
EXTERNAL EXAMINER
-
7/28/2019 vg1 (2) - Copy
3/75
ACCELEROMETER BASED ROBOTIC ARM
ABSTRACT
The Aim of this project is to show how a mechanical arm can be automated
with the help of Microcontroller .the arm is controlled with the help of gears,
whose function is controlled with the help of microcontroller.
Arm perform different functions like up and down moment ,griping of things,
closing of arm and left and right moment of robotic arm.
-
7/28/2019 vg1 (2) - Copy
4/75
ACCELEROMETER BASED ROBOTIC ARM
ACKNOWLEDGEMENT
I would like to express my sincere, humble and deep sense of gratitude to my
supervisor Ms.Kamana Kohli, Institute of Engineering and Emerging Technology,
Baddi for his valuable guidance and constant encouragement throughout the course of
this work.
I would like to thank Mr. Rakesh sharma, Principal, Institute of Engineering and
Emerging Technology, Baddi for providing me the facilities and opportunities to
undergo my dissertation work.
I am grateful to Ms. Pamela Chawla, H.O.D. E.C.E. & faculty members of HPU
regional center, Ms. Kamna kholi for their humble support and allowing me to use
maximum resources during this period.
I am also grateful to my colleagues, and friends. I wish to acknowledge my family, for
giving me the moral strength and encouragement. The work could never reach its
present status without their support all ways. I specially appreciate the help andguidance of all those people who have directly or indirectly helped me making my
dissertation a success.
Ankit kashyap
Lalita Sharma
Preet kamal Rana
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
5/75
ACCELEROMETER BASED ROBOTIC ARM
CONTENTS
DESCRIPTION
List of Figures
List of Tables
CHAPTER 1
Introduction
1.1 Block Diagram
1.2 Circuit Diagram
1.3 Functional Description
CHAPTER 2
Power supply
2.1 Power Supply Description
2.1.1 Transformer
2.1.2 Rectifier
2.1.3 Capacitor
2.1.4 Voltage Regulator
2.1.5 Functional Description of Power Supply
CHAPTER 3ADC 0809(Analog to Digital Converter)
3.1 General Description
3.2 Features
3.3 Key Specifications
3.4 Block Diagram
3.4.1 Functional Description
3.5 555 Timer
3.6 Schematic of 555 timer in monostable mode,Waveshapes
3.7 Standard 555 Astable Circuit
CHAPTER 4
Microcontroller Basic Introduction
4.1 Introduction
4.2 Microcontroller Vs Microprocessor
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
6/75
ACCELEROMETER BASED ROBOTIC ARM
CHAPTER 5
5.1 Description
5.2 Pin Configuration
5.2.1 Pin Description
5.3 Special Function Regulator
5.4 Oscillator Characeristics
CHAPTER 6
LCD
6.1 Introduction
6.2 Operation
6.3 Illumination
6.4 Pin Description
CHAPTER 7
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
7/75
ACCELEROMETER BASED ROBOTIC ARM
LIST OF FIGURES
1.1 Block Diagram
1.2 Circuit Diagram
1.3 2.1 Block Diagram of Power supply
1.4 2.2 An ideal Transformer
1.5 2.3 Ideal Transformer as circuit Element
1.6 2.4 half wave rectifier
1.7 2.5 bridge rectifier
1.8 2.6 Center Tap full wave rectifier
1.9 2.7 RC filter rectifier
2.8 Electrolytic capacitor
2.9 A popular 3pin 12V DC voltage regulator IC
2.10 Circuit diagram of power supply
2.11 Pinout of 7805 regulator IC
2.12 Circuit diagram of power supply
3.1 Block diagram of ADC 0809
5.1 Block Diagram of 89C52
5.2 Pin Diagram
5.3 Oscillator connections
6.1 PIN Diagram
LIST OF TABLES
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
8/75
ACCELEROMETER BASED ROBOTIC ARM
3.1 PIN Description of 0809
3.2 PIN Description of 555 timer
3.3 Specifications of 555
5.1 89c52 Port1 function
5.2 Port3 function
5.3 Interrupt Enable Register
5.4 Interrupt function table
CHAPTER 1
INTRODUCTION
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
9/75
ACCELEROMETER BASED ROBOTIC ARM
1.1 BLOCK DIAGRAM
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
10/75
ACCELEROMETER BASED ROBOTIC ARM
1.2 CIRCUIT DIAGRAM
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
11/75
ACCELEROMETER BASED ROBOTIC ARM
U 24 N 3 5
1
6
2
5 4
a a c e l e r o m e t e r
1 0 K
C 2
V C C
Q 1
3
2
1
V C C
1 0 U F
D 5
L E D
A
-
+ M G 1
1
2
1 2 V ( D C )
R 6
R E S I S T O R
1 3
57
2 4
68
g
n
d
q
c
v
d
is
tr
r
th
r
v
c
c
U 34 N 3 5
1
6
2
5 4
G R O U N D
U 14 N 3 5
1
6
2
5 43 3 P FC 1
U 5
A D C 0 8 0 9
2 6
2 7
2 81
2
3
4
5
1 2
1 6
1 0
9
7
1 7
1 4 1 5
8
1 8
1 9
2 0
2 1
2 5
2 4
2 3
6
2 2
1 1
1 3
I N 0
I N 1
I N 2I N 3
I N 4
I N 5
I N 6
I N 7
R E F +
R E F -
C L K
O E
E O C
D 0
D 1 D 2
D 3
D 4
D 5
D 6
D 7
A 0
A 1
A 2
S T A R T
A L E
V C C
G N D
T 11 5
4 8
4
7
0
O
H
M
3 6 9 ( P N P )
3 3 P F
3 6 9 ( P N P )
4
7
0
O
H
M
Q 1
3
2
1
3 6 9 ( P N P )
Y 1
Q 1
3
2
1
U 6
1 3
2
V I N V O U T
G
N
D
A
-
+ M G 4
1
2
3 6 9 ( P N P )
C
1
23456789U 1
8 0 5 1
3 1
1 9
1 8
9
1 2
1 3
1 4
1 5
1
2
3
4
5
6
7
8
3 9
3 8
3 7
3 6
3 5
3 4
3 3
3 2
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
1 7
1 6
2 9
3 01 1
1 0
4 0
2 0
E A / V P
X 1
X 2
R E S E T
I N T 0
I N T 1
T 0
T 1
P 1 . 0
P 1 . 1
P 1 . 2P 1 . 3
P 1 . 4
P 1 . 5
P 1 . 6
P 1 . 7
P 0 . 0
P 0 . 1P 0 . 2
P 0 . 3
P 0 . 4
P 0 . 5
P 0 . 6
P 0 . 7
P 2 . 0
P 2 . 1
P 2 . 2
P 2 . 3
P 2 . 4
P 2 . 5
P 2 . 6
P 2 . 7
R D
W R
P S E N
A L E / PT X D
R X D
V C C
V S S
V C C
4
7
0
O
H
M
A
-
+ M G 2
1
2
S W 1
R
ES
ET
S
/W
1
2
C R Y S T A L
V C C
4
7
0
O
H
M
Q 1
3
2
1
C 3
A
-
+ M G 3
1
2
U 44 N 3 5
1
6
2
5 4
R 1
fig.1.2 Circuit Digram
1.3 FUNCTIONAL DESCRIPTION
The Aim of this project is to show how a mechanical arm can be automated with the help of
microcontroller. In this project we are having gear motors that are controlled with the help of
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
12/75
ACCELEROMETER BASED ROBOTIC ARM
keypad. Keypad consisting of 2 keys specified for different functions like up and down
moment ,griping of things, closing of arm and left and right moment of robotic arm.
This project is consisting of 3 gear motors that are working on AC 220V. As we know our
microcontroller is a dc controlled device means working on +5v Dc, So to provide insulation to
the MCU and also to drive motors we are using switching circuit.
Switching circuit are consisting of four Opto-couplers and four power amplifiers (PNP-369) .The
main purpose of using opto-coupler is to provide insulation to microcontroller from AC 220 V.
Opto-coupler is a 6 pin IC having LED b/w 1 st and 2nd pin, also a npn phototransistor b/w 4 th and
5th pin. Since the signal forwarded by an opto-coupler is not capable of making relay ON. So to
make relay ON an amplifying signal is required hence as we know we can use transistor as an
amplifier and here we are using transistor as an amplifier (PNP-369).
ROBOTIC- ARM will move up direction. And similarly to the down direction. Andf if youwant to click or pick the think then you have to use the switches.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
13/75
ACCELEROMETER BASED ROBOTIC ARM
CHAPTER 2
POWER SUPPLY
2.1 POWER SUPPLY DESCRIPTION:
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
14/75
ACCELEROMETER BASED ROBOTIC ARM
fig 2.1 Block diagram of power supply
The power supply circuit comprises of four basic parts:
2.1.1 TRANSFORMER
A transformer is a static device that transfers electrical energy from one circuit to
another through inductively coupled conductorsthe transformer's coils. A
varying current in the first orprimary winding creates a varying magnetic flux in the
transformer's core and thus a varying magnetic fieldthrough thesecondary winding.This varying magnetic field induces a varying electromotive force (EMF) or "voltage"
in the secondary winding. This effect is called mutual induction.
If a load is connected to the secondary, an electric current will flow in the secondary
winding and electrical energy will be transferred from the primary circuit through the
transformer to the load. In an ideal transformer, the induced voltage in the secondary
winding (Vs) is in proportion to the primary voltage (Vp), and is given by the ratio of
the number of turns in the secondary (Ns) to the number of turns in the primary (Np) as
follows:
By appropriate selection of the ratio of turns, a transformer thus allows an alternating
current (AC) voltage to be "stepped up" by making Ns greater thanNp, or "stepped
down" by makingNs less thanNp.
In the vast majority of transformers, the windings are coils wound around
a ferromagnetic core, air-core transformers being a notable exception.
BASIC PRINCIPLE TRANSFORMER
The transformer is based on two principles: first, that an electric current can produce
a magnetic field (electromagnetism), and, second that a changing magnetic field
within a coil of wire induces a voltage across the ends of the coil (electromagnetic
induction). Changing the current in the primary coil changes the magnetic flux that is
developed. The changing magnetic flux induces a voltage in the secondary coil.
1
IEET BADDI
TRANSFO
RMER
SHUNT
CAPACITOR
BRIDGE
RECTIFIER
VOLTAGE
REGULATOR
http://en.wikipedia.org/wiki/Electrical_energyhttp://en.wikipedia.org/wiki/Electrical_networkhttp://en.wikipedia.org/wiki/Inductive_couplinghttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Magnetic_fluxhttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Electromotive_forcehttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Mutual_inductionhttp://en.wikipedia.org/wiki/Mutual_inductionhttp://en.wikipedia.org/wiki/Electrical_loadhttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Magnetic_corehttp://en.wikipedia.org/wiki/Transformer#Coreshttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Electromagnetismhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Electrical_networkhttp://en.wikipedia.org/wiki/Inductive_couplinghttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Magnetic_fluxhttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Electromotive_forcehttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Mutual_inductionhttp://en.wikipedia.org/wiki/Electrical_loadhttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Magnetic_corehttp://en.wikipedia.org/wiki/Transformer#Coreshttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Electromagnetismhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Electrical_energy -
7/28/2019 vg1 (2) - Copy
15/75
ACCELEROMETER BASED ROBOTIC ARM
Fig.2.1.1An ideal transformer
An ideal transformer is shown in the figure 2.2. Current passing through the primary
coil creates a magnetic field. The primary and secondary coils are wrapped around
a core of very high magnetic permeability, such as iron, so that most of the magnetic
flux passes through both the primary and secondary coils.
2.1.2 RECTIFIER
A rectifier is an electrical device that converts alternating current (AC), which
periodically reverses direction, to direct current (DC), which is in only one direction, a
process known as rectification. Rectifiers have many uses including as components
ofpower supplies and as detectors ofradio signals. Rectifiers may be made ofsolid
state diodes, vacuum tube diodes, mercury arc valves, and other components.
When only one diode is used to rectify AC (by blocking the negative or positive
portion of the waveform), the difference between the term diode and the
term rectifieris merely one of usage, i.e., the term rectifierdescribes a diode that is
being used to convert AC to DC. Almost all rectifiers comprise a number of diodes in
a specific arrangement for more efficiently converting AC to DC than is possible with
only one diode.
1
IEET BADDI
http://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Magnetic_corehttp://en.wikipedia.org/wiki/Permeability_(electromagnetism)http://en.wikipedia.org/wiki/Ironhttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/Detector_(radio)http://en.wikipedia.org/wiki/Radiohttp://en.wikipedia.org/wiki/Solid_state_(electronics)http://en.wikipedia.org/wiki/Solid_state_(electronics)http://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Vacuum_tubehttp://en.wikipedia.org/wiki/Mercury_arc_valvehttp://en.wikipedia.org/wiki/Wavehttp://en.wikipedia.org/wiki/File:Transformer3d_col3.svghttp://en.wikipedia.org/wiki/File:Transformer3d_col3.svghttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Magnetic_corehttp://en.wikipedia.org/wiki/Permeability_(electromagnetism)http://en.wikipedia.org/wiki/Ironhttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/Detector_(radio)http://en.wikipedia.org/wiki/Radiohttp://en.wikipedia.org/wiki/Solid_state_(electronics)http://en.wikipedia.org/wiki/Solid_state_(electronics)http://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Vacuum_tubehttp://en.wikipedia.org/wiki/Mercury_arc_valvehttp://en.wikipedia.org/wiki/Wave -
7/28/2019 vg1 (2) - Copy
16/75
ACCELEROMETER BASED ROBOTIC ARM
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 tappedtransformer, four diodes are required
instead of the one needed for half-wave rectification. (See semiconductors, diode).
Four diodes arranged this way are called a diode bridge or bridge rectifier.
Fig.2.1.2(a) 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.
Fig.2.1.2(b) Full-wave rectifier using a center tap transformer and 2
diodes.
2.1.3 CAPACITOR
A capacitor (formerly known as condenser) is a device for storing electric charge.
The forms of practical capacitors vary widely, but all contain at least two conductors
1
IEET BADDI
http://en.wikipedia.org/wiki/Center_taphttp://en.wikipedia.org/wiki/Transformerhttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Diode_bridgehttp://en.wikipedia.org/wiki/Center_taphttp://en.wikipedia.org/wiki/File:RC_Filter.pnghttp://en.wikipedia.org/wiki/File:Fullwave.rectifier.en.svghttp://en.wikipedia.org/wiki/File:Gratz.rectifier.en.svghttp://en.wikipedia.org/wiki/File:Gratz.rectifier.en.svghttp://en.wikipedia.org/wiki/Center_taphttp://en.wikipedia.org/wiki/Transformerhttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Diode_bridgehttp://en.wikipedia.org/wiki/Center_tap -
7/28/2019 vg1 (2) - Copy
17/75
ACCELEROMETER BASED ROBOTIC ARM
separated by a non-conductor. Capacitors used as parts of electrical systems, for
example, consist of metal foils separated by a layer of insulating film.
A capacitor is a passiveelectronic component consisting of a pair
ofconductors separated by a dielectric (insulator). When there is apotential
difference (voltage) across the conductors, a static electric field develops across thedielectric, causing positive charge to collect on one plate and negative charge on the
other plate. Energy is stored in the electrostatic field. An ideal capacitor is
characterized by a single constant value,capacitance, measured in farads. This is the
ratio of the electric charge on each conductor to the potential difference between them.
Capacitors are widely used in electronic circuits for blocking direct current while
allowing alternating current to pass, in filter networks, for smoothing the output
ofpower supplies, in the resonant circuits that tune radios to particularfrequencies and
for many other purposes.
The capacitance is greatest when there is a narrow separation between large areas ofconductor, hence capacitor conductors are often called "plates", referring to an early
means of construction. In practice the dielectric between the plates passes a small
amount ofleakage current and also has an electric field strength limit, resulting in
abreakdown voltage, while the conductors and leads introduce an
undesired inductance and resistance.
Fig.2.1.3 A typical electrolytic capacitor
A capacitor consists of two conductors separated by a non-conductive region. The
non-conductive region is called the dielectric or sometimes the dielectric medium. In
simpler terms, the dielectric is just an electrical insulator. Examples of dielectric
mediums are glass, air, paper, vacuum, and even a semiconductordepletion
region chemically identical to the conductors. A capacitor is assumed to be self-
contained and isolated, with no net electric charge and no influence from any external
electric field. The conductors thus hold equal and opposite charges on their facing
1
IEET BADDI
http://en.wikipedia.org/wiki/Passivity_(engineering)http://en.wikipedia.org/wiki/Electronic_componenthttp://en.wikipedia.org/wiki/Electrical_conductorhttp://en.wikipedia.org/wiki/Dielectrichttp://en.wikipedia.org/wiki/Potential_differencehttp://en.wikipedia.org/wiki/Potential_differencehttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Capacitancehttp://en.wikipedia.org/wiki/Faradhttp://en.wikipedia.org/wiki/Electric_chargehttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/LC_circuithttp://en.wikipedia.org/wiki/Frequencyhttp://en.wikipedia.org/wiki/Leakage_(electronics)http://en.wikipedia.org/wiki/Breakdown_voltagehttp://en.wikipedia.org/wiki/Lead_(electronics)http://en.wikipedia.org/wiki/Equivalent_series_inductancehttp://en.wikipedia.org/wiki/Equivalent_series_resistancehttp://en.wikipedia.org/wiki/Electrical_conductorhttp://en.wikipedia.org/wiki/Dielectric_mediumhttp://en.wikipedia.org/wiki/Insulator_(electrical)http://en.wikipedia.org/wiki/Vacuumhttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Depletion_regionhttp://en.wikipedia.org/wiki/Depletion_regionhttp://en.wikipedia.org/wiki/Electric_chargehttp://upload.wikimedia.org/wikipedia/commons/3/31/Condensador_electrolitico_150_microF_400V.jpghttp://en.wikipedia.org/wiki/Passivity_(engineering)http://en.wikipedia.org/wiki/Electronic_componenthttp://en.wikipedia.org/wiki/Electrical_conductorhttp://en.wikipedia.org/wiki/Dielectrichttp://en.wikipedia.org/wiki/Potential_differencehttp://en.wikipedia.org/wiki/Potential_differencehttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Capacitancehttp://en.wikipedia.org/wiki/Faradhttp://en.wikipedia.org/wiki/Electric_chargehttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/LC_circuithttp://en.wikipedia.org/wiki/Frequencyhttp://en.wikipedia.org/wiki/Leakage_(electronics)http://en.wikipedia.org/wiki/Breakdown_voltagehttp://en.wikipedia.org/wiki/Lead_(electronics)http://en.wikipedia.org/wiki/Equivalent_series_inductancehttp://en.wikipedia.org/wiki/Equivalent_series_resistancehttp://en.wikipedia.org/wiki/Electrical_conductorhttp://en.wikipedia.org/wiki/Dielectric_mediumhttp://en.wikipedia.org/wiki/Insulator_(electrical)http://en.wikipedia.org/wiki/Vacuumhttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Depletion_regionhttp://en.wikipedia.org/wiki/Depletion_regionhttp://en.wikipedia.org/wiki/Electric_charge -
7/28/2019 vg1 (2) - Copy
18/75
ACCELEROMETER BASED ROBOTIC ARM
surfaces, and the dielectric develops an electric field. In SI units, a capacitance of
one farad means that one coulomb of charge on each conductor causes a voltage of
one volt across the device.
The capacitor is a reasonably general model for electric fields within electric circuits.
An ideal capacitor is wholly characterized by a constant capacitance C, defined as theratio of charge Q on each conductor to the voltage Vbetween them:
Sometimes charge build-up affects the capacitor mechanically, causing its capacitance
to vary. In this case, capacitance is defined in terms of incremental changes:
2.1.4 VOLTAGE REGULATOR
A voltage regulator is an electricalregulatordesigned to automatically maintain a
constant voltage level. A voltage regulator may be a simple "feed-forward" design or
may include negative feedbackcontrol loops. It may use an
electromechanical mechanism, or electronic components. Depending on the design, it
may be used to regulate one or more AC orDC voltages.
Electronic voltage regulators are found in devices such as computerpower
supplies where they stabilize the DC voltages used by the processor and other
elements. In automobile alternators and centralpower station generator plants, voltageregulators control the output of the plant. In an electric power distribution system,
voltage regulators may be installed at a substation or along distribution lines so that all
customers receive steady voltage independent of how much power is drawn from the
line.
Fig. 2.1.4 A popular three pin 12 V DC voltage regulator IC.
IC VOLTAGE REGULATORS
1
IEET BADDI
http://en.wikipedia.org/wiki/SIhttp://en.wikipedia.org/wiki/Faradhttp://en.wikipedia.org/wiki/Coulombhttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Electricityhttp://en.wikipedia.org/wiki/Regulator_(automatic_control)http://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Negative_feedbackhttp://en.wikipedia.org/wiki/Control_theoryhttp://en.wikipedia.org/wiki/Mechanism_(technology)http://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/Alternatorhttp://en.wikipedia.org/wiki/Power_stationhttp://en.wikipedia.org/wiki/Electric_power_distributionhttp://en.wikipedia.org/wiki/File:7812_voltage_regulator.jpghttp://en.wikipedia.org/wiki/SIhttp://en.wikipedia.org/wiki/Faradhttp://en.wikipedia.org/wiki/Coulombhttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Electricityhttp://en.wikipedia.org/wiki/Regulator_(automatic_control)http://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Negative_feedbackhttp://en.wikipedia.org/wiki/Control_theoryhttp://en.wikipedia.org/wiki/Mechanism_(technology)http://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/Alternatorhttp://en.wikipedia.org/wiki/Power_stationhttp://en.wikipedia.org/wiki/Electric_power_distribution -
7/28/2019 vg1 (2) - Copy
19/75
ACCELEROMETER BASED ROBOTIC ARM
AC voltages are subject to spikes and dips from occurrences such as lightning. Power
supplies that use them as input will also have these surges. The role of an IC (or
integrated circuit) voltage regulator is to help control these variations in the voltage.
Significance
Voltage regulators compare a power supply's output with a fixed voltage. They are
able to automatically adjust the output to a desired level called a reference voltage.
Power supplies that use them are called regulated, and ones that don't are called
unregulated.
Features
IC voltage regulators are made using semiconductors. They are small and lightweight.
They have three leads, and a metal tab to dissipate heat. They usually require resistors,
capacitors and an external heat sink.
Fixed vs. Adjustable
IC voltage regulators are fixed or adjustable. Fixed regulators yield a constant positive
or negative reference voltage. Adjustable regulators can vary in reference voltage.
Fixed IC Regulators
Popular fixed positive IC regulators are the LM78xx series. Negative IC regulators are
the LM79xx series. The letters "xx" represent the output voltage, and so 7806 means a
positive 6-volt reference voltage, for example.
Adjustable IC Regulators
A common adjustable IC is the LM317. Its output regulated voltage can be up to 37
volts. The LM337T outputs regulated negative voltages from --1.2 to --37 volts.
2.1.5 FUNCTIONAL DESCRIPTION OF POWER SUPPLY
The transformer steps down the 220 V a/c. into 12 V a/c. The transformer work on the
principle of magnetic induction, where two coils: primary and secondary are woundaround an iron core. The two coils are physically insulated from each other in such a
way that passing an a/c. current through the primary coil creates a changing voltage in
the primary coil and a changing magnetic field in the core. This in turn induces a
varying a/c. voltage in the secondary coil.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
20/75
ACCELEROMETER BASED ROBOTIC ARM
The a/c. voltage is then fed to the bridge rectifier. The rectifier circuit is used in most
electronic power supplies is the single-phase bridge rectifier with capacitor filtering,
usually followed by a linear voltage regulator. A rectifier circuit is necessary to
convert a signal having zero average value into a non-zero average value. A rectifier
transforms alternating current into direct current by limiting or regulating the direction
of flow of current. The output resulting from a rectifier is a pulsating D.C. voltage.
This voltage is not appropriate for the components that are going to work through it.
Fig.2.1.5 circuit diagram of power supply
The ripple of the D.C. voltage is smoothened using a filter capacitor of 1000 microF
25V. The filter capacitor stores electrical charge. If it is large enough the capacitor
will store charge as the voltage rises and give up the charge as the voltage falls. Thishas the effect of smoothing out the waveform and provides steadier voltage output. A
filter capacitor is connected at the rectifier output and the d.c voltage is obtained
across the capacitor. When this capacitor is used in this project, it should be twice the
supply voltage. When the filter is used, the RC charge time of the filter capacitor must
be short and the RC discharge time must be long to eliminate ripple action. In other
words the capacitor must charge up fast, preferably with no discharge.
When the rectifier output voltage is increasing, the capacitor charges to the peak
voltage Vm. Just past the positive peak, the rectifier output voltage starts to fall but at
this point the capacitor has +Vm voltage across it. Since the source voltage becomes
slightly less than Vm, the capacitor will try to send current back through the diode of
rectifier. This reverse biases the diode. The diode disconnects or separates the source
the source form load. The capacitor starts to discharge through load. This prevents the
load voltage from falling to zero. The capacitor continues to discharge until source
voltage becomes more than capacitor voltage. The diode again starts conducting and
the capacitor is again charged to peak value Vm. When capacitor is charging the1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
21/75
ACCELEROMETER BASED ROBOTIC ARM
rectifier supplies the charging through capacitor branch as well as load current, the
capacitor sends currents through the load. The rate at which capacitor discharge
depends upon time constant RC. The longer the time constant, the steadier is the
output voltage. An increase in load current i.e. decrease in resistance makes time
constant of discharge path smaller. The ripple increase and d.c output voltage V dc
decreases. Maximum capacity cannot exceed a certain limit because the larger the
capacitance the greater is the current required to charge the capacitor.
The voltage regulator regulates the supply if the supply if the line voltage increases
or decreases. The series 78xx regulators provide fixed regulated voltages from 5 to 24
volts. An unregulated input voltage is applied at the IC Input pin i.e. pin 1 which is
filtered by capacitor. The out terminal of the IC i.e. pin 3 provides a regular output.
The third terminal is connected to ground. While the input voltage may vary over
some permissible voltage range, and the output voltage remains constant within
specified voltage variation limit. The 78xx ICs are positive voltage regulatorswhereas 79xx ICs are negative voltage regulators.
These voltage regulators are integrated circuits designed as fixed voltage
regulators for a wide variety of applications. These regulators employ current limiting,
thermal shutdown and safe area compensation. With adequate heat sinking they can
deliver output currents in excess of 1 A. These regulators have internal thermal
overload protection. It uses output transistor safe area compensation and the output
voltage offered is in 2% and 4% tolerance.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
22/75
ACCELEROMETER BASED ROBOTIC ARM
CHAPTER 3
ADC0809 (ANALOG TO DIGITALCONVERTER)
3.1 GENERAL DESCRIPTION
The ADC0808, ADC0809 data acquisition component is a monolithic CMOS device
with an 8-bit analog-to-digital converter,8-channel multiplexer and microprocessor
compatible control logic. The 8-bit A/D converter uses successive approximation as
the conversion technique. The converter features
a high impedance chopper stabilized comparator, a 256R voltage divider with analog
switch tree and a successive approximation register. The 8-channel multiplexer can
directly access any of 8-single-ended analog signals.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
23/75
-
7/28/2019 vg1 (2) - Copy
24/75
ACCELEROMETER BASED ROBOTIC ARM
Fig.3.1 block diagram of ADC0809
3.4.1 FUNCTIONAL DESCRIPTION
The various functional blocks of ADC are:
8-channel multiplexer,
comparator,
256R resistor ladder,
switch tree, successive approximation register,
output buffer,
address latch and decoder.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
25/75
ACCELEROMETER BASED ROBOTIC ARM
The 8-channel multiplexer can accept eight analog inputs in the range of 0 to 5V and
allow one by one for conversion depending on the 3-bit address input. The channel
selection logic is,
The successive approximation register (SAR) performs eight iterations to determine
the digital code for input value. The SAR is reset on the positive edge of START pulse
and start the conversion process on the falling edge of START pulse.
A conversion process will be interrupted on receipt of new START pulse.
The End-Of-Conversion (EOC) will go low between 0 and 8 clock pulses after the
positive edge of START pulse.
The ADC can be used in continuous conversion mode by tying the EOC output to
START input. In this mode an external START pulse should be applied whenever
power is switched ON.
3.4.2 PIN DIAGRAM
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
26/75
ACCELEROMETER BASED ROBOTIC ARM
FIG.3.5 pin diagram of ADC0809
3.5.1 PIN DESCRIPTION
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
27/75
ACCELEROMETER BASED ROBOTIC ARM
Pin Number Description
1 IN3 - Analog Input 3
2 IN4 - Analog Input 4
3 IN5 - Analog Input 54 IN6 - Analog Input 6
5 IN7 - Analog Input 7
6 START - Start Conversion
7 EOC - End Of Conversion
8 2(-5) - Tri-State Output Bit 5
9 OUT EN - Output Enable
10 CLK - Clock 11 Vcc - Positive Supply
12 Vref+ - Positive Voltage Reference Input
13 GND - Ground
14 2(-7) - Tri-State Output Bit 7
15 2(-6) - Tri-State Output Bit 6
16 Vref- - Voltage Reference Negative Input
17 2(-8) - Tri-State Output Bit 8
18 2(-4) - Tri-State Output Bit 4
19 2(-3) - Tri-State Output Bit 3
20 2(-2) - Tri-State Output Bit 2
21 2(-1) - Tri-State Output Bit 1
22 ALE - Address Latch Enable
23 ADD C - Address Input C
24 ADD B - Address Input B
25 ADD A - Address Input A
26 IN0 - Analog Input 0
27 IN1 - Analog Input 1
28 IN2 - Analog Input 2
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
28/75
ACCELEROMETER BASED ROBOTIC ARM
3.5 555 Timer
The 555 Timer IC is an integrated circuit (chip) used in a variety of timer, pulse
generation and oscillatorapplications. The IC design was proposed in 1970 by HansR. Camenzind and Jim Ball. After prototyping, the design was ported to the Monochip
analogue array, incorporating detailed design by Wayne Foletta and others from
Qualidyne Semiconductors. Signetics (later acquired by Philips) took over the design
and production, and released the first 555s in 1971. The original name was the SE555
(TO5 metal can)/NE555 (plastic DIP) and the part was described as "The IC Time
Machine".[1] It has been claimed that the 555 gets its name from the three 5 k
resistors used in typical early implementations,[2] but Hans Camenzind has stated that
the number was arbitrary.[3] The part is still in wide use, thanks to its ease of use, low
price and good stability. As of 2003, it is estimated that 1 billion units are
manufactured every year.[3]. The circuit arrangement of the 555 is said to be even morecommon, being incorporated in many single-voltage Flash and other electrically-
erasable ICs where it is the basis for the oscillator driving the charge pump which
provides the programming overvoltage.
555 has three operating modes:
Monostable mode: in this mode, the 555 functions as a "one-shot" pulse generator.
Applications include timers, missing pulse detection, bouncefree switches, touch
switches, frequency divider, capacitance measurement, pulse-width modulation
(PWM) and so on. Astable - free running mode: the 555 can operate as an oscillator. Uses include LED
and lamp flashers, pulse generation, logic clocks, tone generation, security alarms,
pulse position modulation and so on.
Bistable mode orSchmitt trigger: the 555 can operate as a flip-flop, if the DIS pin is
not connected and no capacitor is used. Uses include bouncefree latched switches.
1
IEET BADDI
http://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Timerhttp://en.wikipedia.org/wiki/Electronic_oscillatorhttp://en.wikipedia.org/wiki/1970http://en.wikipedia.org/wiki/Hans_R._Camenzindhttp://en.wikipedia.org/wiki/Hans_R._Camenzindhttp://en.wikipedia.org/wiki/Signeticshttp://en.wikipedia.org/wiki/Philipshttp://en.wikipedia.org/wiki/1971http://en.wikipedia.org/wiki/DIP-8http://en.wikipedia.org/wiki/555_timer_IC#cite_note-0http://en.wikipedia.org/wiki/Ohmhttp://en.wikipedia.org/wiki/555_timer_IC#cite_note-1http://en.wikipedia.org/wiki/555_timer_IC#cite_note-semiconductormuseum.com-2http://en.wikipedia.org/wiki/1000000000_(number)http://en.wikipedia.org/wiki/555_timer_IC#cite_note-semiconductormuseum.com-2http://en.wikipedia.org/wiki/Flash_memoryhttp://en.wikipedia.org/wiki/Monostablehttp://en.wikipedia.org/wiki/Pulse-width_modulationhttp://en.wikipedia.org/wiki/Astablehttp://en.wikipedia.org/wiki/Oscillatorhttp://en.wikipedia.org/wiki/LEDhttp://en.wikipedia.org/wiki/Pulse_position_modulationhttp://en.wikipedia.org/wiki/Bistablehttp://en.wikipedia.org/wiki/Schmitt_triggerhttp://en.wikipedia.org/wiki/Flip-flop_(electronics)http://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Timerhttp://en.wikipedia.org/wiki/Electronic_oscillatorhttp://en.wikipedia.org/wiki/1970http://en.wikipedia.org/wiki/Hans_R._Camenzindhttp://en.wikipedia.org/wiki/Hans_R._Camenzindhttp://en.wikipedia.org/wiki/Signeticshttp://en.wikipedia.org/wiki/Philipshttp://en.wikipedia.org/wiki/1971http://en.wikipedia.org/wiki/DIP-8http://en.wikipedia.org/wiki/555_timer_IC#cite_note-0http://en.wikipedia.org/wiki/Ohmhttp://en.wikipedia.org/wiki/555_timer_IC#cite_note-1http://en.wikipedia.org/wiki/555_timer_IC#cite_note-semiconductormuseum.com-2http://en.wikipedia.org/wiki/1000000000_(number)http://en.wikipedia.org/wiki/555_timer_IC#cite_note-semiconductormuseum.com-2http://en.wikipedia.org/wiki/Flash_memoryhttp://en.wikipedia.org/wiki/Monostablehttp://en.wikipedia.org/wiki/Pulse-width_modulationhttp://en.wikipedia.org/wiki/Astablehttp://en.wikipedia.org/wiki/Oscillatorhttp://en.wikipedia.org/wiki/LEDhttp://en.wikipedia.org/wiki/Pulse_position_modulationhttp://en.wikipedia.org/wiki/Bistablehttp://en.wikipedia.org/wiki/Schmitt_triggerhttp://en.wikipedia.org/wiki/Flip-flop_(electronics) -
7/28/2019 vg1 (2) - Copy
29/75
ACCELEROMETER BASED ROBOTIC ARM
The connection of the pins is as follows:
Fig:-3.5 Pin description:
Pin Name Purpose
1 GND Ground, low level (0 V)
2 TRIG OUT rises, and interval starts, when this input
falls below 1/3 VCC.
3 OUT This output is driven to +VCC or GND.
4 RESET A timing interval may be interrupted by drivingthis input to GND.
5 CTRL "Control" access to the internal voltage divider
(by default, 2/3 VCC).
6 THR The interval ends when the voltage at THR is
greater than at CTRL.
7 DIS Open collectoroutput; may discharge a capacitor
between intervals.
8 V+, VCC Positive supply voltage is usually between 3 and
15 V.
3.6 Monostable mode
1
IEET BADDI
http://en.wikipedia.org/wiki/Vcchttp://en.wikipedia.org/wiki/Vcchttp://en.wikipedia.org/wiki/Vcchttp://en.wikipedia.org/wiki/Open_collectorhttp://en.wikipedia.org/wiki/Vcchttp://en.wikipedia.org/wiki/Open_collector -
7/28/2019 vg1 (2) - Copy
30/75
ACCELEROMETER BASED ROBOTIC ARM
Fig:-3.6.1Schematic of a 555 in monostable mode,waveshapes
The relationships of the trigger signal, the voltage on C and the pulse width in
monostable mode
In the monostable mode, the 555 timer acts as a one-shot pulse generator. The pulse
begins when the 555 timer receives a signal at the trigger input that falls below a third
of the voltage supply. The width of the output pulse is determined by the time constant
of an RC network, which consists of a capacitor (C) and a resistor (R). The output
pulse ends when the charge on the C equals 2/3 of the supply voltage. The output
pulse width can be lengthened or shortened to the need of the specific application by
adjusting the values of R and C.
The output pulse width of time t, which is the time it takes to charge C to 2/3 of the
supply voltage, is given by
where t is in seconds, R is in ohms and C is in farads. See RC circuit for an
explanation of this effect.
1
IEET BADDI
http://en.wikipedia.org/wiki/Capacitorhttp://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Ohmshttp://en.wikipedia.org/wiki/Faradshttp://en.wikipedia.org/wiki/RC_circuithttp://en.wikipedia.org/wiki/File:NE555_Monotable_Waveforms_%28English%29.pnghttp://en.wikipedia.org/wiki/File:NE555_Monotable_Waveforms_%28English%29.pnghttp://en.wikipedia.org/wiki/File:555_Monostable.svghttp://en.wikipedia.org/wiki/File:555_Monostable.svghttp://en.wikipedia.org/wiki/Capacitorhttp://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Ohmshttp://en.wikipedia.org/wiki/Faradshttp://en.wikipedia.org/wiki/RC_circuit -
7/28/2019 vg1 (2) - Copy
31/75
ACCELEROMETER BASED ROBOTIC ARM
Bistable Mode
In bistable mode, the 555 timer acts as a basic flip-flop. The trigger and reset inputs
(pins 2 and 4 respectively on a 555) are held high via Pull-up resistors while the
threshold input (pin 6) is simply grounded. Thus configured, pulling the trigger
momentarily to ground acts as a 'set' and transitions the output pin (pin 3) to Vcc (high
state). Pulling the reset input to ground acts as a 'reset' and transitions the output pin to
ground (low state). No capacitors are required in a bistable configuration. Pins 5 and 7
(control and discharge) are left floating.
Astable mode
Fig:-3.6 Standard 555 Astable Circuit
In astable mode, the 555 timer puts out a continuous stream of rectangular pulses
having a specified frequency. Resistor R1 is connected between VCC and the discharge
pin (pin 7) and another resistor (R2) is connected between the discharge pin (pin 7),
and the trigger (pin 2) and threshold (pin 6) pins that share a common node. Hence the
capacitor is charged through R1 and R2, and discharged only through R2, since pin 7
has low impedance to ground during output low intervals of the cycle, therefore
discharging the capacitor.
To achieve a duty cycle of less than 50% a diode can be added in parallel with R2
towards the capacitor. This bypasses R2 during the high part of the cycle so that the
high interval depends only on R1 and C.
1
IEET BADDI
http://en.wikipedia.org/wiki/Pull-up_resistorhttp://en.wikipedia.org/wiki/Duty_cyclehttp://en.wikipedia.org/wiki/File:555_Astable_Diagram.svghttp://upload.wikimedia.org/wikipedia/commons/3/3d/555_Astable_Diagram.svghttp://en.wikipedia.org/wiki/Pull-up_resistorhttp://en.wikipedia.org/wiki/Duty_cycle -
7/28/2019 vg1 (2) - Copy
32/75
ACCELEROMETER BASED ROBOTIC ARM
CHAPTER4MICROCONTROLLER BASIC
INTRODUCTION
4.1 INTRODUCTION
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
33/75
ACCELEROMETER BASED ROBOTIC ARM
A microcontroller is a small computer on a single integrated circuit containing a
processor core, memory, and programmable input/outputperipherals. Program
memory in the form ofNOR flash orOTP ROM is also often included on chip, as well
as a typically small amount ofRAM. Microcontrollers are designed for embedded
applications, in contrast to the microprocessors used inpersonal computers or other
general purpose applications.
Microcontrollers are used in automatically controlled products and devices, such as
automobile engine control systems, implantable medical devices, remote controls,
office machines, appliances, power tools, and toys. By reducing the size and cost
compared to a design that uses a separate microprocessor, memory, and input/output
devices, microcontrollers make it economical to digitally control even more devices
and processes. Mixed signal microcontrollers are common, integrating analog
components needed to control non-digital electronic systems.
Some microcontrollers may use Four-bit words and operate at clock rate frequencies
as low as 4 kHz, for low power consumption (milliwatts or microwatts). They will
generally have the ability to retain functionality while waiting for an event such as a
button press or other interrupt; power consumption while sleeping (CPU clock and
most peripherals off) may be just nanowatts, making many of them well suited for
long lasting battery applications. Other microcontrollers may serve performance-
critical roles, where they may need to act more like a digital signal processor(DSP),
with higher clock speeds and power consumption.
4.2 MICROCONTROLLERS VERSUS MICROPROCESSORS
What is the difference between a microprocessor and microcontroller?
The microprocessors (such as 8086,80286,68000 etc.) contain no RAM, no ROM and
no I/O ports on the chip itself. For this reason they are referred as general- purpose
microprocessors.
A system designer using general- purpose microprocessor must add external RAM,
ROM, I/O ports and timers to make them functional. Although the addition of external
RAM, ROM, and I/O ports make the system bulkier and much more expensive, they
have the advantage of versatility such that the designer can decide on the amount of
RAM, ROM and I/o ports needed to fit the task at hand. This is the not the case withmicrocontrollers.
A microcontroller has a CPU (a microprocessor) in addition to the fixed amount of
RAM, ROM, I/O ports, and timer are all embedded together on the chip: therefore, the
designer cannot add any external memory, I/O, or timer to it.
The fixed amount of on chip RAM, ROM, and number of I/O ports in microcontrollers
make them ideal for many applications in which cost and space are critical.
1
IEET BADDI
http://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikipedia.org/wiki/Flash_memory#NOR_flashhttp://en.wikipedia.org/wiki/Programmable_read-only_memoryhttp://en.wikipedia.org/wiki/Random-access_memoryhttp://en.wikipedia.org/wiki/Microprocessorhttp://en.wikipedia.org/wiki/Personal_computerhttp://en.wikipedia.org/wiki/Clock_ratehttp://en.wikipedia.org/wiki/Digital_signal_processorhttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikipedia.org/wiki/Flash_memory#NOR_flashhttp://en.wikipedia.org/wiki/Programmable_read-only_memoryhttp://en.wikipedia.org/wiki/Random-access_memoryhttp://en.wikipedia.org/wiki/Microprocessorhttp://en.wikipedia.org/wiki/Personal_computerhttp://en.wikipedia.org/wiki/Clock_ratehttp://en.wikipedia.org/wiki/Digital_signal_processor -
7/28/2019 vg1 (2) - Copy
34/75
ACCELEROMETER BASED ROBOTIC ARM
In many applications, for example a TV remote control, there is no need for the
computing power of a 486 or even a 8086 microprocessor.
In many applications, the space it takes, the power it consumes, and the price per unit
are much more critical considerations than the computing power. These applications
most often require some I/O operations to read signals and turn on and off certain bits.
It is interesting to know that some microcontrollers manufactures have gone as far as
integrating an ADC and other peripherals into the microcontrollers.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
35/75
ACCELEROMETER BASED ROBOTIC ARM
CHAPTER 5
MICROCONTROLLER 89C52
5.1 DESCRIPTION
The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with 8K
bytes of Flash programmable and erasable read only memory (PEROM). The device is
manufactured using Atmels high-density nonvolatile memory technology and is
compatible with the industry-standard 80C51 and 80C52 instruction set and pinout.
The on-chip Flash allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU
with Flash on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer
which provides a highly-flexible and cost-effective solution to many embedded
control applications
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
36/75
ACCELEROMETER BASED ROBOTIC ARM
FIG.5.1.1 Block diagram
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
37/75
ACCELEROMETER BASED ROBOTIC ARM
5.1.2 PIN CONFIGURATION
Fig:-5.2 Pin Diagram
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
38/75
ACCELEROMETER BASED ROBOTIC ARM
5.2.1 PIN DESCRIPTION
VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as
highimpedance inputs.
Port 0 can also be configured to be the multiplexed loworder 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
Port 1 is an 8-bit bi-directional 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
Port
Pin
Alternate Functions
P1.0 0 T2 (external count input to Timer/Counter 2),clock-out
P1.1 (Timer/Counter 2 capture/reload trigger and
direction control)
Table:-5.1 Port function
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
39/75
ACCELEROMETER BASED ROBOTIC ARM
Port 2
Port 2 is an 8-bit bi-directional 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 Flashprogramming and verification.
Port 3
Port 3 is an 8-bit bi-directional 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 AT89C51, as shown
in the following table.
Port 3 also receives some control signals for Flash programming and verification.
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)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
Table:-5.2 Port 3 function
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
40/75
ACCELEROMETER BASED ROBOTIC ARM
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
ALE/PROG
Address Latch Enable is an output pulse for latching the low byte of the address
during accesses to external memory.
This pin is also the program pulse input (PROG) during Flash programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency
and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external data
memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With
the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the
pin is weakly pulled high. Setting the ALE-disable bit has no
effect if the microcontroller is in external execution mode.
PSEN
Program Store Enable is the read strobe to external program memory.
When the AT89C52 is executing code from external program memory, PSEN is
activated twice each machine cycle, except that two PSEN activations are skipped
duringeach 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 when 12-volt programming is selected.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
41/75
ACCELEROMETER BASED ROBOTIC ARM
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2
Output from the inverting oscillator amplifier.
5.3 SPECIAL FUNCTION REGISTERS
A map of the on-chip memory area called the Special Function Register (SFR) space
is shown in Table 1. Note 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.
Timer 2 Registers
Control and status bits are contained in registers T2CON (shown in Table 2) and
T2MOD (shown in Table 4) for Timer 2. The register pair (RCAP2H, RCAP2L)
are the Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-
reload mode.
Interrupt Registers
The individual interrupt enable bits are in the IE register. Two priorities can be set for
each of the six interrupt sources in the IP register.r
Data Memory
The AT89C52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a
parallel address space to the Special Function Registers. That means the upper 128
bytes have the same addresses as the SFR space but are
physically separate from SFR space.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
42/75
ACCELEROMETER BASED ROBOTIC ARM
When an instruction accesses an internal location above address 7FH, the address
mode used in the instruction specifies whether the CPU accesses the upper 128 bytes
of RAM or the SFR space. Instructions that use direct addressing access SFR space.
For example, the following direct addressing instruction accesses the SFR at location
0A0H (which is P2).
MOV 0A0H, #data
Instructions that use indirect addressing access the upper 128 bytes of RAM. For
example, the following indirect addressing instruction, where R0 contains 0A0H,
accesses the data byte at address 0A0H, rather than P2 (whose
address is 0A0H).
MOV @R0, #data
Note that stack operations are examples of indirect addressing, so the upper 128 bytesof data RAM are available as stack space.
Timer 0 and 1
Timer 0 and Timer 1 in the AT89C52 operate the same way as Timer 0 and Timer 1 in
the AT89C51.
Timer 2
Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an eventcounter. The type of operation is selected by bit C/T2 in the SFR T2CON (shown in
Table 2).
Timer 2 has three operating modes: capture, auto-reload (up or down counting), and
baud rate generator. The modes are selected by bits in T2CON, as shown in Table 3.
Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2
register is incremented every machine cycle. Since a machine cycle consists of 12
oscillator periods, the count rate is 1/12 of the oscillator frequency.
TIMER 2 OPERATING MODES
RCLK
+TCLK
CP/RL2 TR2 MODE
0 0 1 16-bit Auto-reload
0 1 1 16-bit Capture
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
43/75
ACCELEROMETER BASED ROBOTIC ARM
1 X 1 Baud Rate Generator
X X 0 (Off)
Table:-Port3 function.
In the Counter function, the register is incremented inresponse to a 1-to-0 ransition at
its corresponding external input pin, T2. In this function, the external input is sampled
during S5P2 of every machine cycle. When the samples show a high in one cycle and
a low in the next cycle, the count is incremented. The new count value appears in the
register during S3P1 of the cycle following the one in which the transition was
detected. Since two machine cycles (24 oscillator periods) are required to recognize a
1-to-0 transition, the maximum count rate is 1/24 of the oscillator frequency. To
ensure that a given level is sampled at least
once before it changes, the level should be held for at least one full machine cycle.
Capture Mode
In the capture mode, two options are selected by bit EXEN2 in T2CON. If EXEN2 =
0, Timer 2 is a 16-bit timer or counter which upon overflow sets bit TF2 in T2CON.
This bit can then be used to generate an interrupt. If EXEN2 = 1, Timer 2 performs the
same operation, but a 1- to-0 transition at external input T2EX also causes the current
value in TH2 and TL2 to be captured into RCAP2H and
RCAP2L, respectively. In addition, the transition at T2EX causes bit EXF2 in T2CON
to be set. The EXF2 bit, like TF2, can generate an interrupt. The capture mode isillustrated in Figure 1.
Auto-reload (Up or Down Counter)
Timer 2 can be programmed to count up or down when configured in its 16-bit auto-
reload mode. This feature is invoked by the DCEN (Down Counter Enable) bit located
in the SFR T2MOD (see Table 4). Upon reset, the DCEN bit
is set to 0 so that timer 2 will default to count up. When DCEN is set, Timer 2 can
count up or down, depending on the value of the T2EX pin.
Programmable Clock Out
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
44/75
ACCELEROMETER BASED ROBOTIC ARM
A 50% duty cycle clock can be programmed to come out on P1.0, as shown in Figure
5. This pin, besides being a regular I/O pin, has two alternate functions. It can be
programmed to input the external clock for Timer/Counter 2 or to output a 50% duty
cycle clock ranging from 61 Hz to 4 MHz at a 16 MHz operating frequency.
To configure the Timer/Counter 2 as a clock generator, bit C/T2 (T2CON.1) must be
cleared and bit T2OE (T2MOD.1) must be set. Bit TR2 (T2CON.2) starts and stops
the timer.
The clock-out frequency depends on the oscillator frequency and the reload value of
Timer 2 capture registers (RCAP2H, RCAP2L), as shown in the following equation.
In the clock-out mode, Timer 2 roll-overs will not generate an interrupt. This behavior
is similar to when Timer 2 is used as a baud-rate generator. It is possible to use Timer
2 as a baud-rate generator and a clock generator simultaneously.
Note, however, that the baud-rate and clock-out frequencies cannot be determined
independently from one another since they both use RCAP2H and RCAP2L.
UART
The UART in the AT89C52 operates the same way as the UART in the AT89C51.
Interrupts
The AT89C52 has a total of six interrupt vectors: two external interrupts (INT0 and
INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These
interrupts are all shown in Figure 6.
Each of these interrupt sources can be individually enabled or disabled by setting or
clearing a bit in Special Function Register IE. IE also contains a global disable bit,
EA, which disables all interrupts at once.
In the AT89C51, bit position IE.5 is also unimplemented. User software should not
write 1s to these bit positions, since they may be used in future AT89
products.
Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register
T2CON. Neither of these flags is cleared by hardware when the service routine is
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
45/75
ACCELEROMETER BASED ROBOTIC ARM
vectored to. In fact, the service routine may have to determine whether it was TF2 or
EXF2 that generated the interrupt, and that bit will have to be cleared in software.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the
timers overflow. The values are then polled by the circuitry in the next cycle. However
the Timer 2 flag, TF2, is set at S2P2 and is polled in the
same cycle in which the timer overflows.
(MSB) (LSB)
EA _ ET2 ES ET1 EX1 ET0 EX0
Table 5.3:- Intrupt enable register
Enable Bit = 1 enables the interrupt.
Enable Bit = 0 disables the interrupt.
Symbol Position Function
EA IE.7 D no interrupt is
acknowledged. If isables all
interrupts. If EA = 0,
EA = 1, each interrupt source is
individually enabled or
disabled by setting or clearing
its enable bit.
IE.6 Reserved.ET2 IE.5 Timer 2 interrupt enable bit.
ES IE.4 Serial Port interrupt enable bit.
ET1 IE.3 Timer 1 interrupt enable bit.
EX1 IE.2 External interrupt 1 enable bit.
ET0 IE.1 Timer 0 interrupt enable bit.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
46/75
ACCELEROMETER BASED ROBOTIC ARM
EX0 IE.0 External interrupt 0 enable bit.
User software should never
write 1s to unimplemented bits,
because they may be used in
future AT89 products.
Table:-Interrupt Function table
5.4 OSCILLATOR CHARACTERISTICS
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
that can be configured for use as an on-chip oscillator, as shown in Figure 7. 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 5.3
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 5.3 Oscillator connections
C1, C2 = 30 Pf-10 pF for Crystals
Xtal1,xtal2 = 40 pF-10 pF for Ceramic Resonators
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
47/75
ACCELEROMETER BASED ROBOTIC ARM
CHAPTER 6
LCD
6.1 INTRODUCTION
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
48/75
ACCELEROMETER BASED ROBOTIC ARM
A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the
light modulating properties ofliquid crystals (LCs). LCs do not emit light directly.
They are used in a wide range of applications, including computer
monitors, television, instrument panels, aircraft cockpit displays, signage, etc. Theyare common in consumer devices such as video players, gaming devices, clocks,
watches, calculators, and telephones. LCDs have displaced cathode ray tube (CRT)
displays in most applications. They are usually more compact, lightweight, portable,
less expensive, more reliable, and easier on the eyes. They are available in a wider
range of screen sizes than CRT and plasma displays, and since they do not use
phosphors, they cannot suffer image burn-in.
LCDs are more energy efficient and offer safer disposal than CRTs. Its low electrical
power consumption enables it to be used in battery-poweredelectronic equipment. It is
an electronically-modulated optical device made up of any number ofpixels filledwith liquid crystals and arrayed in front of alight source (backlight) orreflectorto
produce images in color ormonochrome. The earliest discovery leading to the
development of LCD technology, the discovery of liquid crystals, dates from 1888. By
2008, worldwide sales of televisions with LCD screens had surpassed the sale of CRT
units.
6.2 OPERATION
Each pixel of an LCD typically consists of a layer ofmolecules aligned between
two transparentelectrodes, and twopolarizingfilters, the axes of transmission of
which are (in most of the cases) perpendicular to each other. With no actual liquid
crystal between the polarizing filters, light passing through the first filter would be
blocked by the second (crossed) polarizer. In most of the cases the liquid
crystal has double refraction.
The surface of the electrodes that are in contact with the liquid crystal material are
treated so as to align the liquid crystal molecules in a particular direction. This
treatment typically consists of a thinpolymerlayer that is unidirectionally rubbed
using, for example, a cloth. The direction of the liquid crystal alignment is then
defined by the direction of rubbing. Electrodes are made of a transparent conductorcalled Indium Tin Oxide (ITO).
Before applying an electric field, the orientation of the liquid crystal molecules is
determined by the alignment at the surfaces of electrodes. In a twisted nematic device
(still the most common liquid crystal device), the surface alignment directions at the
two electrodes are perpendicular to each other, and so the molecules arrange
1
IEET BADDI
http://en.wikipedia.org/wiki/Electronic_visual_displayhttp://en.wikipedia.org/wiki/Liquid_Crystalshttp://en.wikipedia.org/wiki/Computer_monitorhttp://en.wikipedia.org/wiki/Computer_monitorhttp://en.wikipedia.org/wiki/Televisionhttp://en.wikipedia.org/wiki/Flight_instrumentshttp://en.wikipedia.org/wiki/Signagehttp://en.wikipedia.org/wiki/Clockhttp://en.wikipedia.org/wiki/Calculatorhttp://en.wikipedia.org/wiki/Telephonehttp://en.wikipedia.org/wiki/Cathode_ray_tubehttp://en.wikipedia.org/wiki/Plasma_displayhttp://en.wikipedia.org/wiki/Battery_(electricity)http://en.wikipedia.org/wiki/Electronicshttp://en.wikipedia.org/wiki/Electro-optic_modulatorhttp://en.wikipedia.org/wiki/Pixelhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Light#Light_sourceshttp://en.wikipedia.org/wiki/Backlighthttp://en.wikipedia.org/wiki/Reflector_(photography)http://en.wikipedia.org/wiki/Monochromehttp://en.wikipedia.org/wiki/Pixelhttp://en.wikipedia.org/wiki/Moleculehttp://en.wikipedia.org/wiki/Transparency_(optics)http://en.wikipedia.org/wiki/Electrodehttp://en.wikipedia.org/wiki/Polarizerhttp://en.wikipedia.org/wiki/Filter_(optics)http://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Lighthttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Double_refractionhttp://en.wikipedia.org/wiki/Polymerhttp://en.wikipedia.org/wiki/Indium_Tin_Oxidehttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Electronic_visual_displayhttp://en.wikipedia.org/wiki/Liquid_Crystalshttp://en.wikipedia.org/wiki/Computer_monitorhttp://en.wikipedia.org/wiki/Computer_monitorhttp://en.wikipedia.org/wiki/Televisionhttp://en.wikipedia.org/wiki/Flight_instrumentshttp://en.wikipedia.org/wiki/Signagehttp://en.wikipedia.org/wiki/Clockhttp://en.wikipedia.org/wiki/Calculatorhttp://en.wikipedia.org/wiki/Telephonehttp://en.wikipedia.org/wiki/Cathode_ray_tubehttp://en.wikipedia.org/wiki/Plasma_displayhttp://en.wikipedia.org/wiki/Battery_(electricity)http://en.wikipedia.org/wiki/Electronicshttp://en.wikipedia.org/wiki/Electro-optic_modulatorhttp://en.wikipedia.org/wiki/Pixelhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Light#Light_sourceshttp://en.wikipedia.org/wiki/Backlighthttp://en.wikipedia.org/wiki/Reflector_(photography)http://en.wikipedia.org/wiki/Monochromehttp://en.wikipedia.org/wiki/Pixelhttp://en.wikipedia.org/wiki/Moleculehttp://en.wikipedia.org/wiki/Transparency_(optics)http://en.wikipedia.org/wiki/Electrodehttp://en.wikipedia.org/wiki/Polarizerhttp://en.wikipedia.org/wiki/Filter_(optics)http://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Lighthttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Double_refractionhttp://en.wikipedia.org/wiki/Polymerhttp://en.wikipedia.org/wiki/Indium_Tin_Oxidehttp://en.wikipedia.org/wiki/Electric_field -
7/28/2019 vg1 (2) - Copy
49/75
ACCELEROMETER BASED ROBOTIC ARM
themselves in a helical structure, or twist. This reduces the rotation of the polarization
of the incident light, and the device appears grey. If the applied voltage is large
enough, the liquid crystal molecules in the center of the layer are almost completely
untwisted and the polarization of the incident light is not rotated as it passes through
the liquid crystal layer. This light will then be mainly polarized perpendicularto the
second filter, and thus be blocked and the pixel will appearblack. By controlling the
voltage applied across the liquid crystal layer in each pixel, light can be allowed to
pass through in varying amounts thus constituting different levels of gray. This electric
field also controls (reduces) the double refraction properties of the liquid crystal.
6.3 ILLUMINATION
As LCD panels produce no light of their own, they require an external lighting
mechanism to be easily visible. On most displays, this consists of a cold
cathode fluorescent lamp that is situated behind the LCD panel. Passive-matrix
displays are usually not backlit, but active-matrix displays almost always are, with a
few exceptions such as the display in the original Gameboy Advance.
Recently, two types ofLED backlit LCD displays have appeared in some televisions
as an alternative to conventional backlit LCDs. In one scheme, the LEDs are used to
backlight the entire LCD panel. In another scheme, a set of red, green and blue LEDs
is used to illuminate a small cluster of pixels, which can improve contrast and black
level in some situations. For example, the LEDs in one section of the screen can be
dimmed to produce a dark section of the image while the LEDs in another section are
kept bright. Both schemes also allows for a slimmer panel than on conventionaldisplays.
6.4 PIN CONFIGURATION
The LCD discuss in this section has the most common connector used for the Hitatchi
44780 based LCD is 14 pins in a row and modes of operation and how to program and
interface with microcontroller is describes in this section.
1
IEET BADDI
http://en.wikipedia.org/wiki/Helixhttp://en.wikipedia.org/wiki/Greyhttp://en.wikipedia.org/wiki/Incident_lighthttp://en.wikipedia.org/wiki/Perpendicularhttp://en.wikipedia.org/wiki/Pixelhttp://en.wikipedia.org/wiki/Blackhttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Double_refractionhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Fluorescent_lamphttp://en.wikipedia.org/wiki/Gameboy_Advancehttp://en.wikipedia.org/wiki/LED-backlit_LCD_televisionhttp://en.wikipedia.org/wiki/Helixhttp://en.wikipedia.org/wiki/Greyhttp://en.wikipedia.org/wiki/Incident_lighthttp://en.wikipedia.org/wiki/Perpendicularhttp://en.wikipedia.org/wiki/Pixelhttp://en.wikipedia.org/wiki/Blackhttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Double_refractionhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Fluorescent_lamphttp://en.wikipedia.org/wiki/Gameboy_Advancehttp://en.wikipedia.org/wiki/LED-backlit_LCD_television -
7/28/2019 vg1 (2) - Copy
50/75
ACCELEROMETER BASED ROBOTIC ARM
V c c
1 6
1 5
1 4
1 3
1 2
1 1
1 0
9
8
6
5
4
3
2
1
7
1 6
1 5
1 4
1 3
1 2
1 1
1 09
8
6
5
4
3
2
1
7
D 7
E
V c c
D 4
C o n t r a s tR S
G n d
R / W
G n d
D 0
D 3
D 6D 5
3
2
D 2D 1
Fig 6.4 Pin Diagram
6.4.1 PIN DESCRIPTIONVCC, VSS, VEE
The voltage VCC and VSS provided by +5V and ground respectively while VEE is used
for controlling LCD contrast. Variable voltage between Ground and Vcc is used to
specify the contrast (or "darkness") of the characters on the LCD screen.
RS (register select)
There are two important registers inside the LCD. The RS pin is used for their
selection as follows. If RS=0, the instruction command code register is selected, then
allowing to user to send a command such as clear display, cursor at home etc.. If
RS=1, the data register is selected, allowing the user to send data to be displayed onthe LCD.
R/W (read/write)
The R/W (read/write) input allowing the user to write information from it. R/W=1,
when it read and R/W=0, when it writing.
EN (enable)
The enable pin is used by the LCD to latch information presented to its data pins.
When data is supplied to data pins, a high power, a high-to-low pulse must be applied
to this pin in order to for the LCD to latch in the data presented at the data pins.
D0-D7 (data lines)
The 8-bit data pins, D0-D7, are used to send information to the LCD or read the
contents of the LCDs internal registers. To displays the letters and numbers, we send
ASCII codes for the letters A-Z, a-z, and numbers 0-9 to these pins while making RS
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
51/75
ACCELEROMETER BASED ROBOTIC ARM
=1. There are also command codes that can be sent to clear the display or force the
cursor to the home position or blink the cursor.
We also use RS =0 to check the busy flag bit to see if the LCD is ready to receive the
information. The busy flag is D7 and can be read when R/W =1 and RS =0, as
follows: if R/W =1 and RS =0, when D7 =1(busy flag =1), the LCD is busy taking
care of internal operations and will not accept any information. When D7 =0, the LCD
is ready to receive new information.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
52/75
ACCELEROMETER BASED ROBOTIC ARM
CHAPTER 7
H-BRIDGE IC
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
53/75
ACCELEROMETER BASED ROBOTIC ARM
7.1 Bi-directional or H-bridge control:
With the help of relays or opto couplers with amplifiers (some specially designed ICs) we can
change the direction of the DC motor rotation. Circuits below shows the simple concept behind
H-bride control of DC motors.
Fig 7.1 Interface of H-Bridge IC
Simple H-bridge Connection is shown using switch. Where all the switches are open and the
motor is not receiving any potential difference V or current I and hence it is not rotating.
Fig 7.2 H-bridge motor clockwise rotation
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
54/75
ACCELEROMETER BASED ROBOTIC ARM
Switches S2 and S3 are open and S1 and S4 are closed which creates a potential difference
across the motor and simultaneously a current flows through the circuit which rotates the motor
shaft, lets say, in the clockwise (CW) direction.
Fig 7.3 H-bridge motor anticlockwise rotation
Similarly, in Fig.4.3 switches S1 and S4 are open and S2 and S3 are closed which rotates the
motor in anti-clockwise direction.
Fig 7.4 H-Bridge IC
S1 S2 S3 S4 Result
1 0 0 1 Motor moves right
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
55/75
ACCELEROMETER BASED ROBOTIC ARM
0 1 1 0 Motor moves left
0 0 0 0 Motor free runs
0 1 0 1 Motor brakes
1 0 1 0 Motor brakes.
7.5 H-Bridge L293B/D:
After the basics here comes the real Integrated Circuit (ICs) based H-Bridges which are
essentially made by using electronic circuit elements such as Opto coupler switches, operational
amplifiers and some safety elements.
These ICs are also called Motor controllers and come as a single package depending on the
desired current and voltage ratings. One of the very common H-bridge ICs available in the
market is L293B or L293D. It is in fact a double H-Bridge, since motion of two motors can be
simultaneously controlled on each half. While interfacing with Microcontrollers GND (0 V) and
voltage supply to the motor is needed in H-Bridge since input is being provided from
microcontroller. Additionally H-Bridge can also be used in remote controlled circuits with the
only difference being that the inputs provided to the input pins of the H-Bridge (which was
earlier being provided by the microcontroller) will now be in the form of external 5V supply for
bit 1 (high) and ground (0 V) for bit 0 (low). It is always advised to go through the datasheet of
the ICs before using them. There are a lot of manufacturers who sell these ICs, and finding a
datasheet is easy. Yet a detailed description of how to use an H-Bridge IC L293D is provided
below.
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
56/75
ACCELEROMETER BASED ROBOTIC ARM
Fig.7.5Pin diagram of L293D
Firstly identify your PINs like IN for input, OUT for output, GND for ground (0 V), EN enable
pin for enabling whichever half of the H-Bridge to be used (explained later in detail), Vcc for
operating voltage of ICs generally 5v and lastly +V voltage applied to the motor which should be
more than Vcc otherwise ICs would not work properly.
Secondly, have a look at the numbering of the pins and try to remember them. Here we have
used bit 1(one) and bit 0 (zero) in place of 5V and GND respectively (or simply we will consider
our inputs in terms of binary digits 0 and 1). Let us see how L293D works
Fig: 7.6circuit connection of L293D
a circuit connection has been shown, where M1 & M2 are two DC motors connected to the
outputs on each half (pin no 3, 6 & 11, 14) .We can see that Vcc, GND and +V all have fixed
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
57/75
ACCELEROMETER BASED ROBOTIC ARM
potentials. Now we will simultaneously enable the two half with enable pins (1 & 9) by
providing logic high i.e. bit 1 or simply value equal to Vcc i.e. 5V , then we try to rotate the
motor in the same direction by applying bit 1 & 0 to INPUT pins (2,7 & 15,10). We will observe
a potential difference of +V voltage across both the output terminals of M1and M2 (pin no 3,6 &
14,11
Fig: 7.7pin diagram to show rotation of motor in same direction
Since we have explained earlier we can change the direction of rotation of the motor by just
reversing our INPUT. Lets say, now we have reversed our input for M1 i.e. we are now
applying bit 0 & 1 to the input pins (IN1 and IN2). We can see in the circuit that the outputs for
M1 has reversed and hence the direction of rotation of the motor (because polarity has been
reversed). Similarly the other half can also behave as per your requirements
Fig 7.8 pin diagram to show rotation of motor in opposite direction
Now we will see the role of ENABLE pins (1,2EN & 3,4EN or pin no 1 & 9). In Fig. 4 we have
changed the input of 1,2 EN to bit 0 (zero) and the potential difference across M1 output pins is
ZERO or nil which tells us that one H-bridge has been disabled and the motor stops rotating.
This is basically an additional help to control the motor by just enabling or disabling the required
half of L293D IC. Some facts about L293D H-bridge1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
58/75
ACCELEROMETER BASED ROBOTIC ARM
600-mA Output Current Capability Per Driver.
Pulsed Current 1.2-A Per Driver
Output Clamp Diodes for Inductive Transient Suppression
Wide Supply Voltage Range 4.5 V to 36 V
Separate Input-Logic Supply Thermal Shutdown
Internal ESD Protection
High-Noise-Immunity Inputs
Functional Replacement for SGS L293D
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
59/75
ACCELEROMETER BASED ROBOTIC ARM
CHAPTER 8
GEAR MOTOR
1
IEET BADDI
-
7/28/2019 vg1 (2) - Copy
60/75
ACCELEROMETER BASED ROBOTIC ARM
8.1 Gear motor:
Gear motor is a motor that has a gear reduction system or the gearbox integrally built into the
motor. The gearbox increases the torque generating ability of the motor while simultaneously
reducing its output speed. The main advantage of a gear motor is that the driving shaft may be
coupled directly to the driven shaft. Belts, pulleys, chains, or additional gearing to step down
motor speed are needed. Also, coupling or belting of a motor to a separate speed-reducer unit is
eliminated
AC gear motor consists of a series of three windings in the stator section with a simple rotating
section and an integral gearbox. DC gear motors are configured in many types and sizes,
including brushless and servo. They consist of a rotor and a permanent magnetic field stator and
an integral gearbox. They are used in variable speed and torque applications. Direct motors are
most common in industrial robots.
Important performance specifications to consider when searching for gear motors include shaft
speed, continuous torque, continuous current, and continuous output power. The terminal voltage