Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SUBMITTED BY
--------------------
(--------------)
--------------------- (---------------)
--------------------- (---------------)
CERTIFICATE
This is to certify that the dissertation work entitled PROTOTYPE OF A PICK
& PLACE ROBO REMOTELY CONTROLLED BY HAND HELD
TRANSMITTER WITH METAL DETECTOR is the work done
by
________________
(Head of the department, ECE)
____________
(Assistant Professor)
EXTERNAL EXAMINER
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of any
task would be incomplete without the mentioning of the people whose constant
guidance and encouragement made it possible. We take pleasure in presenting
before you, our project, which is result of studied blend of both research and
knowledge.
We express our earnest gratitude to our internal guide, Assistant Professor
______________, Department of ECE, our project guide, for his constant support,
encouragement and guidance. We are grateful for his cooperation and his valuable
suggestions.
Finally, we express our gratitude to all other members who are involved either
directly or indirectly for the completion of this project.
DECLARATION
3
We, the undersigned, declare that the project entitled PROTOTYPE OF A PICK
& PLACE ROBO REMOTELY CONTROLLED BY HAND HELD
TRANSMITTER WITH METAL DETECTOR, being submitted in partial
fulfillment for the award of Bachelor of Engineering Degree in MECHANICAL
Engineering, affiliated to _________ University, is the work carried out by us.
__________
_________
_________
__________
_________
_________
CONTENTS
PAGE NO.
4
1. ABSTRACT
10
13
19
22
56
5.1 IDE
57
57
58
59
5
5.6 EMBEDDED C
6. SCHEMATIC DIAGRAM
6.1 DESCRIPTION
7. CODING
66
67
75
9.1 COMPILER
76
84
88
88
89
11. APPLICATION
69
12. CONCLUSION
93
13. BIBLIOGRAPHY
94
LIST OF FIGURES
PAGE NO.
19
2(b) V DIAGRAM
19
26
21
24
25
29
30
51
1. ABSTRACT
As our project deals with RF controlled robot. This robot is prototype for the Path Finder. This
robot is controlled by a RF remote. This can be moved forward and reverse direction using
geared motors of 60RPM. Also this robot can take sharp turnings towards left and right
directions. In our project uses AT89S52 MCU as its controller. A high sensitive induction type
metal detector is designed using colpitts oscillator principle and fixed to this robot. Also a
wireless camera with voice is interfaced to the kit. When the robot is moving on a surface, the
system produces a beep sound when metal is detected. This beep sound will be transmitted to
remote place. Simultaneously the images around the robot will be transmitted to remote place.
User
can
monitor
the
images
and
metal
detection
alarms
on
Television.
The RF modules used here are STT-433 MHz Transmitter, STR-433 MHz Receiver, HT12E
Encoder and HT12D RF Decoder. The three switches are interfaced to the RF transmitter through
RF Encoder. The encoder continuously reads the status of the switches, passes the data to the RF
transmitter and the transmitter transmits the data. This project uses 9V battery. This project is
much useful for mines detection and surveillance applications.
Introduction
embedded & lower end embedded systems. High-end embedded system - Generally 32, 64 Bit
Controllers used with OS. Examples Personal Digital Assistant and Mobile phones etc .Lower
end embedded systems - Generally 8,16 Bit Controllers used with an minimal operating systems
and hardware layout designed for the specific purpose.
SYSTEM DESIGN CALLS:
Build
Operating
DigitalSystems
Integrated Download
circuit
Electronic design
design
Debug
Analog
Tools
Electronic design
Computer
Embedded Architecture
Sensors and Systems
measurements
Software
Engineering
Electric motors
and actuatorsControl
Data
Engineering
Communication
11
Har
Sy
dw
ste
are
m
Rapi
-inDef
d
the
init
Prot
ion
otypi
Lo
Targ
ng
op
eting
Tes
tin
g
Sy
ste
m
Tes
tin
g
Figure:2(b) V Diagram
An embedded system is any computer system hidden inside a product other than a
computer.
They will encounter a number of difficulties when writing embedded system software in
addition to those we encounter when we write applications.
Throughput Our system may need to handle a lot of data in a short period of
time.
Memory space Memory is limited on embedded systems, and you must make
the software and the data fit into whatever memory exists.
Program installation you will need special tools to get your software into
embedded systems.
12
Power consumption Portable systems must run on battery power, and the
software in these systems must conserve power.
Processor hogs computing that requires large amounts of CPU time can
complicate the response problem.
Cost Reducing the cost of the hardware is a concern in many embedded system
projects; software often operates on hardware that is barely adequate for the job.
APPLICATIONS
1)
2)
3)
4)
5)
6)
7)
CLASSIFICATION
RTS CLASSIFICATION
13
"Soft" real-time systems have reduced constrains on "lateness" but still must operate very
quickly and repeatable.
Example: Railway reservation system takes a few extra seconds the data remains valid.
14
15
4 HARDWARE REQUIREMENTS
HARDWARE COMPONENTS:
16
Description
The LM78XX/LM78XXA series of three-terminal positive regulators are available in the
TO-220/D-PAK package and with several fixed output voltages, making them useful in a Wide
range of applications. Each type employs internal current limiting, thermal shutdown and safe
operating area protection, making it essentially indestructible. If adequate heat sinking is
provided, they can deliver over 1A output Current. Although designed primarily as fixed voltage
regulators, these devices can be used with external components to obtain adjustable voltages and
currents.
19
4.2 MICROCONTROLLER
A microcontroller often serves as the brain of a mechatronic system. Like a mini, self
contained computer, it can be programmed to interact with both the hardware of the system and
the user. Even the most basic microcontroller can perform simple math operations, control digital
outputs, and monitor digital inputs. As the computer industry has evolved, so has the technology
associated with microcontrollers. Newer microcontrollers are much faster, have more memory,
and have a host of input and output features that dwarf the ability of earlier models. Most modern
controllers have analog-to-digital converters, high-speed timers and counters, interrupt
capabilities, outputs that can be pulse-width modulated, serial communication ports, etc.
Key Parameters
Parameter
Value
Flash (Kbytes):
16 Kbytes
Pin Count:
40
16 MHz
CPU:
8-bit AVR
# of Touch Channels:
16
No
32
Ext Interrupts:
USB Speed:
No
USB Interface:
No
21
Pin No.
1
Pin name
Description
Alternate Function
(XCK/T0) PB0
22
(T1) PB1
(INT2/AIN0) PB2
(OC0/AIN1) PB3
(SS) PB4
(MOSI) PB5
(MISO) PB6
(SCK) PB7
RESET
10
Vcc
11
GND
GROUND
12
XTAL2
13
XTAL1
14
(RXD) PD0
15
(TXD) PD1
16
(INT0) PD2
17
(INT1) PD3
18
(OC1B) PD4
19
(OC1A) PD5
20
(ICP) PD6
21
PD7 (OC2)
22
PC0 (SCL)
23
PC1 (SDA)
24
PC2 (TCK)
25
PC3 (TMS)
26
PC4 (TDO)
27
PC5 (TDI)
28
PC6 (TOSC1)
29
PC7 (TOSC2)
TWI Interface
JTAG Interface
23
30
AVcc
31
GND
GROUND
32
AREF
33
PA7 (ADC7)
ADC Channel 7
34
PA6 (ADC6)
ADC Channel 6
35
PA5 (ADC5)
ADC Channel 5
36
PA4 (ADC4)
ADC Channel 4
37
PA3 (ADC3)
ADC Channel 3
38
PA2 (ADC2)
ADC Channel 2
39
PA1 (ADC1)
ADC Channel 1
40
PA0 (ADC0)
ADC Channel 0
A push-button (also spelled pushbutton) or simply button is a simple switch mechanism for
controlling some aspect of a machine or a process. Buttons are typically made out of hard
material, usually plastic or metal. The surface is usually flat or shaped to accommodate the
human finger or hand, so as to be easily depressed or pushed. Buttons are most often biased
switches, though even many un-biased buttons (due to their physical nature) require a spring to
return to their un-pushed state. Different people use different terms for the "pushing" of the
button, such as press, depress, mash, and punch.
24
Uses:
In industrial and commercial applications push buttons can be linked together by a mechanical
linkage so that the act of pushing one button causes the other button to be released. In this way, a
stop button can "force" a start button to be released. This method of linkage is used in simple
manual operations in which the machine or process have no electrical circuits for control.
Pushbuttons are often color-coded to associate them with their function so that the
operator will not push the wrong button in error. Commonly used colors are red for stopping the
machine or process and green for starting the machine or process.
Red pushbuttons can also have large heads (mushroom shaped) for easy operation and to
facilitate the stopping of a machine. These pushbuttons are called emergency stop buttons and
are mandated by the electrical code in many jurisdictions for increased safety. This large
mushroom shape can also be found in buttons for use with operators who need to wear gloves for
their work and could not actuate a regular flush-mounted push button. As an aid for operators
and users in industrial or commercial applications, a pilot light is commonly added to draw the
attention of the user and to provide feedback if the button is pushed. Typically this light is
included into the center of the pushbutton and a lens replaces the pushbutton hard center disk.
The source of the energy to illuminate the light is not directly tied to the contacts on the
back of the pushbutton but to the action the pushbutton controls. In this way a start button when
pushed will cause the process or machine operation to be started and a secondary contact
designed into the operation or process will close to turn on the pilot light and signify the action
of pushing the button caused the resultant process or action to start.
In popular culture, the phrase "the button" refers to a (usually fictional) button that a
military or government leader could press to launch nuclear weapons.
Push to ON button:
Initially the two contacts of the button are open. When the button is pressed they become
connected. This makes the switching operation using the push button.
DESCRIPTION:
L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as
current amplifiers since they take a low-current control signal and provide a higher-current
signal. This higher current signal is used to drive the motors.
L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation,
two DC motors can be driven simultaneously, both in forward and reverse direction. The motor
operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15. Input logic
00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise and
anticlockwise directions, respectively.
Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start
operating. When an enable input is high, the associated driver gets enabled. As a result, the
26
outputs become active and work in phase with their inputs. Similarly, when the enable input is
low, that driver is disabled, and their outputs are off and in the high-impedance state.
Block diagram:
Pin Diagram:
27
Pin description:
4.5 DC MOTOR
28
A DC motor is an electric motor that runs on direct current (DC) electricity. 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.
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).
Fig.4.5(c) DC motor
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, 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
rotates 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, and energize the
29
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". So since most small DC motors are of a
three-pole design, let's tinker with the workings of one via an interactive animation.
You'll notice a few things from this -- namely, one pole is fully energized at a time (but
two others are "partially" energized). As each brush transitions from one commutator contact to
the next, one coil's field will rapidly collapse, as the next coil's field will rapidly charge up (this
30
occurs within a few microsecond). We'll see more about the effects of this later, but in the
meantime you can see that this is a direct result of the coil windings' series wiring.
4.6 Encoder
Features
Operating voltage
2.4V~5V for the HT12A
2.4V~12V for the HT12E
Low power and high noise immunity CMOS
technology
Low standby current: 0.1A (typ.) at
VDD=5V
HT12A with a 38kHz carrier for infrared
31
transmission medium
Minimum transmission word Four words for the HT12E
One word for the HT12A
Built-in oscillator needs only 5% resistor
Data code has positive polarity
Minimal external components
HT12A/E: 18-pin DIP/20-pin SOP package
General Description
The 212 encoders are a series of CMOS LSIs for remote control system
applications. They are capable of encoding information which consists of N
address bits and 12_N data bits. Each address/ data input can be set to one
of the two logic states. The programmed addresses/data are transmitted
together with the header bits via an RF or an infrared transmission medium
upon receipt of a trigger signal.
Block Diagram
Functional Description
32
Operation
The 2^12 series of encoders begin a 4-word transmission cycle upon
receipt of a transmission enable (TE for the HT12E or D8~D11 for the HT12A,
active low). This cycle will repeat itself as long as the transmission enable
(TE or D8~D11) is held low. Once the transmission enable returns high the
encoder output completes its final cycle and then stops.
Address/data programming (preset)
The status of each address/data pin can be individually pre-set to logic
highor low. If a transmission- enable signal is applied, the encoder scans
and transmits the status of the 12 bits of address/ data serially in the order
A0 to AD11 for the HT12E encoder and A0 to D11 for the HT12A encoder.
During information transmission these bits are transmitted with a preceding
synchronization bit. If the trigger signal is not applied, the chip enters the
standby mode and consumes a reduced current of less than 1_A for a supply
voltage of 5V. Usual applications preset the address pins with individual
security codes using DIP switches or PCB wiring, while the data is selected by
push buttons or electronic switches.
33
Features
BLOCK DIAGRAM
General Description
35
The 2^12 decoders are a series of CMOS LSIs for remote control
system applications. They are paired with Holtek_s 2^12 series of encoders.
For proper operation, a pair of encoder/decoder with the same number of
addresses and data format should be chosen. The decoders receive serial
addresses and data from a programmed 2^12 series of encoders that are
transmitted by a carrier using an RF or an IR transmission medium. They
compare the serial input data three times continuously with their loca
addresses. If no error or unmatched codes are found, the input data codes
are decoded and then transferred to the output pins. The VT pin also goes
high to indicate a valid transmission. The 2^12 series of decoders are
capable of decoding informations that consist of N bits of address and 12_N
bits of data. Of this series, the HT12D is arranged to provide 8 address bits
and 4 data bits, and HT12F is used to decode 12 bits of address information.
Functional Description
Operation
The 2^12 series of decoders provides various combinations of
addresses and data pins in different packages so as to pair with the 2^12
series of encoders. The decoders receive data that are transmitted by an
encoder and interpret the first N bits of code period as addresses and the
last 12_N bits as data, where N is the address code number. A signal on the
DIN pin activates the oscillator which in turn decodes the incoming address
and data. The decoders will then check the received address three times
continuously. If the received address codes all match the contents of the
decoder local address, the 12_N bits of data are decoded to activate the
output pins and the VT pin is set high to indicate a valid transmission. This
will last unless the address code is incorrect or no signal is received. The
output of the VT pin is high only when the transmission is valid. Otherwise it
is always low.
36
Output type
Of the 2^12 series of decoders, the HT12F has no data output pin but
its VT pin can be used as a momentary data output. The HT12D, on the other
hand, provides 4 latch type data pins whose data remain unchanged until
new data are received.
RF Module Interfacing:
The TWS-434 and RWS-434 are extremely small, and are excellent for applications requiring
short-range RF remote controls. The transmitter module is only 1/3 the size of a standard postage
stamp, and can easily be placed inside a small plastic enclosure.
TWS-434:
The transmitter output is up to 8mW at 433.92MHz with a range of approximately 400 foot
(open area) outdoors. Indoors, the range is approximately 200 foot, and will go through most
walls..
The TWS-434 transmitter accepts both linear and digital inputs, can operate from 1.5 to 12 VoltsDC, and makes building a miniature hand-held RF transmitter very easy. The TWS-434 is
approximately the size of a standard postage stamp.
37
Sample Transmitter
Application Circuit
RWS-434:
The receiver also operates at 433.92MHz, and has a sensitivity of 3uV. The RWS-434 receiver operates
from 4.5 to 5.5 volts-DC, and has both linear and digital outputs.
38
4.7 BC547
TECHNICAL SPECIFICATIONS:
The BC547 transistor is an NPN Epitaxial Silicon Transistor. The BC547 transistor is a
general-purpose transistor in small plastic packages. It is used in general-purpose switching and
amplification BC847/BC547 series 45 V, 100 mA NPN general-purpose transistors.
39
We know that the transistor is a "CURRENT" operated device and that a large current
(Ic) flows freely through the device between the collector and the emitter terminals. However,
this only happens when a small biasing current (Ib) is flowing into the base terminal of the
transistor thus allowing the base to act as a sort of current control input. The ratio of these two
currents (Ic/Ib) is called the DC Current Gain of the device and is given the symbol of hfe or
nowadays Beta, (). Beta has no units as it is a ratio. Also, the current gain from the emitter to
the collector terminal, Ic/Ie, is called Alpha, (), and is a function of the transistor itself. As the
emitter current Ie is the product of a very small base current to a very large collector current the
value of this parameter is very close to unity, and for a typical low-power signal transistor this
value ranges from about 0.950 to 0.999.
40
4.8 LED
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator
lamps in many devices, and are increasingly used for lighting. When a light-emitting diode is
forward biased (switched on), electrons are able to recombine with holes within the device,
releasing energy in the form of photons.
This effect is called electroluminescence and the color of the light (corresponding to the
energy of the photon) is determined by the energy gap of the semiconductor. An LED is often
small in area (less than 1 mm2), and integrated optical components may be used to shape its
radiation pattern. LEDs present many advantages over incandescent light sources including
lower energy consumption, longer lifetime, improved robustness, smaller size, faster switching,
and greater durability and reliability.
41
Types of LEDS
4.9 1N4007
Diodes are used to convert AC into DC these are used as half wave rectifier or full wave
rectifier. Three points must he kept in mind while using any type of diode.
1.
2.
3.
Diodes of number IN4001, IN4002, IN4003, IN4004, IN4005, IN4006 and IN4007 have
maximum reverse bias voltage capacity of 50V and maximum forward current capacity of 1
Amp.
Diode of same capacities can be used in place of one another. Besides this diode of more
capacity can be used in place of diode of low capacity but diode of low capacity cannot be used
in place of diode of high capacity. For example, in place of IN4002; IN4001 or IN4007 can be
used but IN4001 or IN4002 cannot be used in place of IN4007.The diode BY125made by
company BEL is equivalent of diode from IN4001 to IN4003. BY 126 is equivalent to diodes
IN4004 to 4006 and BY 127 is equivalent to diode IN4007.
43
PN JUNCTION OPERATION
Now that you are familiar with P- and N-type materials, how these materials are joined
together to form a diode, and the function of the diode, let us continue our discussion with the
operation of the PN junction. But before we can understand how the PN junction works, we must
first consider current flow in the materials that make up the junction and what happens initially
within the junction when these two materials are joined together.
44
Therefore, the majority current carriers in the N-type material (electrons) are repelled by the
negative side of the battery and move through the crystal toward the positive side of the battery.
4.10 RESISTORS
A resistor is a two-terminal electronic component designed to oppose an electric current by
producing a voltage drop between its terminals in proportion to the current, that is, in accordance
with Ohm's law:
V = IR
Resistors are used as part of electrical networks and electronic circuits. They are extremely
commonplace in most electronic equipment. Practical resistors can be made of various
compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as
nickel/chrome).
45
The primary characteristics of resistors are their resistance and the power they can
dissipate. Other characteristics include temperature coefficient, noise, and inductance. Less wellknown is critical resistance, the value below which power dissipation limits the maximum
permitted current flow, and above which the limit is applied voltage. Critical resistance depends
upon the materials constituting the resistor as well as its physical dimensions; it's determined by
design.
Resistors can be integrated into hybrid and printed circuits, as well as integrated
circuits. Size, and position of leads (or terminals) are relevant to equipment designers; resistors
must be physically large enough not to overheat when dissipating their power.
A resistor is a two-terminal passive electronic component which implements electrical
resistance as a circuit element. When a voltage V is applied across the terminals of a resistor, a
current I will flow through the resistor in direct proportion to that voltage. The reciprocal of the
constant of proportionality is known as the resistance R, since, with a given voltage V, a larger
value of R further "resists" the flow of current I as given by Ohm's law:
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in most electronic equipment. Practical resistors can be made of various compounds
46
and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickelchrome). Resistors are also implemented within integrated circuits, particularly analog devices,
and can also be integrated into hybrid and printed circuits.
The electrical functionality of a resistor is specified by its resistance: common
commercial resistors are manufactured over a range of more than 9 orders of magnitude. When
specifying that resistance in an electronic design, the required precision of the resistance may
require attention to the manufacturing tolerance of the chosen resistor, according to its specific
application. The temperature coefficient of the resistance may also be of concern in some
precision applications. Practical resistors are also specified as having a maximum power rating
which must exceed the anticipated power dissipation of that resistor in a particular circuit: this is
mainly of concern in power electronics applications. Resistors with higher power ratings are
physically larger and may require heat sinking. In a high voltage circuit, attention must
sometimes be paid to the rated maximum working voltage of the resistor.
The series inductance of a practical resistor causes its behavior to depart from ohms law;
this specification can be important in some high-frequency applications for smaller values of
resistance. In a low-noise amplifier or pre-amp the noise characteristics of a resistor may be an
issue. The unwanted inductance, excess noise, and temperature coefficient are mainly dependent
on the technology used in manufacturing the resistor. They are not normally specified
individually for a particular family of resistors manufactured using a particular technology. [1] A
family of discrete resistors is also characterized according to its form factor, that is, the size of
the device and position of its leads (or terminals) which is relevant in the practical manufacturing
of circuits using them.
Units
The ohm (symbol: ) is the SI unit of electrical resistance, named after Georg Simon
Ohm. An ohm is equivalent to a volt per ampere. Since resistors are specified and manufactured
over a very large range of values, the derived units of milliohm (1 m = 103 ), kilohm (1 k =
103 ), and megohm (1 M = 106 ) are also in common usage.
47
4.11 CAPACITORS
A capacitor or condenser is a passive electronic component consisting of a pair of conductors
separated by a dielectric. When a voltage potential difference exists between the conductors, an
electric field is present in the dielectric. This field stores energy and produces a mechanical force
between the plates. The effect is greatest between wide, flat, parallel, narrowly separated
conductors.
48
49
Theory of operation
Main article: Capacitance
50
of one farad means that one coulomb of charge on each conductor causes a voltage of one volt
across the device.[10]
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 the ratio of charge Q
on each conductor to the voltage V between them:[8]
Sometimes charge build-up affects the capacitor mechanically, causing its capacitance to vary. In
this case, capacitance is defined in terms of incremental changes:
Energy storage
Work must be done by an external influence to "move" charge between the conductors in a
capacitor. When the external influence is removed the charge separation persists in the electric
field and energy is stored to be released when the charge is allowed to return to its equilibrium
position. The work done in establishing the electric field, and hence the amount of energy stored,
is given by:[11]
Current-voltage relation
The current i(t) through any component in an electric circuit is defined as the rate of flow of a
charge q(t) passing through it, but actual charges, electrons, cannot pass through the dielectric
layer of a capacitor, rather an electron accumulates on the negative plate for each one that leaves
the positive plate, resulting in an electron depletion and consequent positive charge on one
electrode that is equal and opposite to the accumulated negative charge on the other. Thus the
charge on the electrodes is equal to the integral of the current as well as proportional to the
51
voltage as discussed above. As with any anti derivative, a constant of integration is added to
represent the initial voltage v (t0). This is the integral form of the capacitor equation,[12]
.
Taking the derivative of this, and multiplying by C, yields the derivative form,[13]
.
The dual of the capacitor is the inductor, which stores energy in the magnetic field rather than the
electric field. Its current-voltage relation is obtained by exchanging current and voltage in the
capacitor equations and replacing C with the inductance L.
4.12 RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to operate a
switching mechanism mechanically, but other operating principles are also used. Relays are used
where it is necessary to control a circuit by a low-power signal (with complete electrical isolation
between control and controlled circuits), or where several circuits must be controlled by one
signal.
52
A relay is an electrically operated switch. Current flowing through the coil of the relay
creates a magnetic field which attracts a lever and changes the switch contacts. The coil current
can be on or off so relays have two switch positions and most have double throw (changeover)
switch contacts as shown in the diagram.
Relays allow one circuit to switch a second circuit which can be completely separate
from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC
mains circuit. There is no electrical connection inside the relay between the two circuits; the link
is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it
can be as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips)
cannot provide this current and a transistor is usually used to amplify the small IC current to the
larger value required for the relay coil. The maximum output current for the popular 555 timer IC
is 200mA so these devices can supply relay coils directly without amplification.
53
Relays are usually SPDT or DPDT but they can have many more sets of switch contacts,
for example relays with 4 sets of changeover contacts are readily available. For further
information about switch contacts and the terms used to describe them please see the page on
switches.
Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay.
The supplier's catalogue should show you the relay's connections. The coil will be
obvious and it may be connected either way round. Relay coils produce brief high voltage
'spikes' when they are switched off and this can destroy transistors and ICs in the circuit. To
prevent damage you must connect a protection diode across the relay coil.
The figure shows a relay with its coil and switch contacts. You can see a lever on the left
being attracted by magnetism when the coil is switched on. This lever moves the switch contacts.
54
There is one set of contacts (SPDT) in the foreground and another behind them, making
the relay DPDT.
The relay's switch connections are usually labelled COM, NC and NO:
COM = Common, always connect to this; it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
55
Applications of relays
Relays are used to and for:
Detect and isolate faults on transmission and distribution lines by opening and closing
circuit breakers.
Time delay functions. Relays can be modified to delay opening or delay closing a set of contacts.
A very short (a fraction of a second) delay would use a copper disk between the armature and
moving blade assembly. Current flowing in the disk maintains magnetic field for a short time,
lengthening release time. For a slightly longer (up to a minute) delay, a dashpot is used. A
dashpot is a piston filled with fluid that is allowed to escape slowly. The time period can be
varied by increasing or decreasing the flow rate. For longer time periods, a mechanical
clockwork timer is installed.
56
5. SOFTWARE REQUIREMENTS
9.1 COMPILER
A simplest MCU system may look like below
57
The program it is executing is like this (In C language).The MCU contains a flash memory
where it stores its program (it is like a hard disk to it). The flash memory can be easily erased and
a new program can burned. This makes them very flexible. MCUs can be programmed few
thousand times before they die.
A SAMPLE PROGRAM
#include <delay.h>;
void main()
{
SetPortDirection();
while(1)
{
PORTA=0b00000001;
delay_ms(500);
PORTA=0b00000000;
delay_ms(500);
}
}
PORTS
58
A MCU has some ports. Ports are PINs on the MCU that can be turned on and off by program.
On means 5V and off means 0V or GND .This behavior is for OUTPUT mode. They can also be
put in INPUT mode. In INPUT mode they can read what is the signal level on them (only on and
off).If voltage is more than a threshold voltage (usually half the supply) it is reported as ON(1)
otherwise OFF(0).This is how MCU control everything .Majority of the PINs of a MCU are
PORT so you can hookup lots of gizmos to it !!!They are named PORTA ,PORTB ,PORTC
,PORTD etc .They are of one byte which means 8 Bitts all bits of them are connected to external
pins and are available outside the chip. In smaller chips only some of the eight bits are available.
Setting PORTB=0b00000001 will set PORTB's zeroth bit high that is 5V while remaining PINs
will be low (GND).
To write a binary number in c prefix it with 0b ex 0b00001000. It is decimal 8 not 1000!!
Which you can't make easily without MCU. So you have seen that major functioning of a MCU project is
made in software and hardware part is simple and small. So you have learned the basics of MCUs and
their use.
60
A SAMPLE PROGRAM
Suppose that you have a LED and a switch. Now you want that when you press the switch the LED is
switched OFF, otherwise it is ON. Also suppose that you have made proper connection of the mcu, that is
provided power connections (GND on the GND terminals-11 & 31, and Vcc on 10 and 30 and also on
RESET . Then your next task is to connect the output of your switch to appropriate pin, say connect it to
Pin 0 of Port C, and connect LED to, say Pin 2 of Port C. Then the Programme to do the above mentioned
task will be:
#include <delay.h>;
DDRC=0b00000100 //it is a good practice to set unused pins to
input.
While (1)
{
If(PINC.0==1)
{
PORTC.2=0;
delay_ms(100);
}
else
{
PORTC.2=1;
delay_ms(100);
}
}
61
WinAVR
There are several ways that you can write, compile, and download a program to the ATmega16
microcontroller. There are many different text editors, compilers, and utilities available for many
different languages (C, BASIC, assembly language, etc.). Some of these are free of charge, and
some require a licensing fee to use them. In this class, we will use a freeware package of
software tools named WinAVR (pronounced, whenever). WinAVR consists of a suite of
executable, open source software development tools for the Atmel AVR series of RISC
microprocessors hosted on the Windows platform. It includes the GNU GCC compiler for C and
C++, which is sometimes referred to as avr-gcc. Traditionally, the microcontroller in embedded
systems was programmed directly using assembly language. Assembly language uses only the
basic instruction set for a particular microcontroller. While this can produce fast, efficient code, it
is limited in that every processor type has its own instruction set. Therefore it is not a practical
language to learn unless you are doing a project that is dedicated to a specific microcontroller or
has a real need for precise timing and/or memory use. The C language, on the other hand, is
commonly used in industry and can be applied over many different platforms. By learning this
one language, you will be able to program almost any microcontroller, provided that you have a
compiler that can translate C code into assembly language for your controller. The Gnu-C
compiler is an open-source, freeware, C compiler that forms the basis for compilers that generate
code for many different microcontrollers and various operating systems, such as Windows and
UNIX.
62
63
When the Create New File dialog box pops up, click Project then OK.
A dialog box titled Confirm will pop up asking if you would like to use CodeWizardAVR.
This is a helpful tool which will help you automatically generate the proper code depending on
your MCU. Select Yes. The following window will open:
64
65
The default setting is to have the ports for all the target systems to be inputs.
You can also change other settings in this window such as Timers, etc. These topics shall be
covered in the following tutorials.
By selecting the File -> Generate, Save and Exit option, the CodeWizard will generate a skeleton
C program with the appropriate Port initializations. Many Save File prompts shall open these
are the project files generated by the wizard. Save them with appropriate names.
66
A dialog box appears. Make sure that the message says No errors, otherwise, go back to your
code and fix the errors.
Now that the program is ready, it is time to put it on the chip. This is accomplished by a software
known as AVR Studio:
Start AVR Studio. It will immediately ask you to start a new project. Click on Cancel.
In AVR Studio, select menu Tools | Program AVR | Connect.
In the Select AVR Programmer dialog box, choose STK500 or AVRISP as the platform and
Auto as Port. Then click button Connect.
Depending on the version of your AVR Studio, a message about firmware may appear. For now,
this message can be discarded by clicking button Cancel.
In the STK500 dialog box that appears, select the generated hex file as Input Hex File. Then,
click the button Program to download the HEX file to the AVR chip.
68
5.15 EMBEDDED C
Use of embedded processors in passenger cars, mobile phones, medical equipment,
aerospace systems and defense systems is widespread, and even everyday domestic appliances
such as dish washers, televisions, washing machines and video recorders now include at least one
such device.
Because most embedded projects have severe cost constraints, they tend to use low-cost
processors like the 8051 family of devices considered in this book. These popular chips have
69
very limited resources available most such devices have around 256 bytes (not megabytes!) of
RAM, and the available processor power is around 1000 times less than that of a desktop
processor. As a result, developing embedded software presents significant new challenges, even
for experienced desktop programmers. If you have some programming experience - in C, C++
or Java - then this book and its accompanying CD will help make your move to the embedded
world as quick and painless as possible.
6.SCHEMATIC DIAGRAM
70
6.1 DESCRIPTION
POWER SUPPLY
71
This project uses a 12V battery for power supply. A voltage regulator 7805 is used to get
the constant 5V DC supply. One LED is connected of this 5V point in series with a resistor of
330 to the ground i.e., negative voltage to indicate 5V power supply availability.
STANDARD CONNECTIONS TO MICRO CONTROLLER
ATMEL series of 8051 family of micro controllers need certain standard connections.
The actual number of the Micro controller could be 89C51 , 89C52, 89S51, 89S52, as
regards to 20 pin configuration a number of 89C2051. The 4 set of I/O ports are used based on
the project requirement. Every micro controller requires a timing reference for its internal
program execution therefore an oscillator needs to be functional with a desired frequency to
obtain the timing reference as t =1/f.
A crystal ranging from 2 to 20 MHz is required to be used at its pin number 18 and 19 for
the oscillator. Typically 11.0592 MHz crystal is used in general for most of the circuits. Crystal
provides the reference frequency only and it is not a crystal oscillator as miss understood by
many but it oscillates at 11.0592MHz. Two small value ceramic capacitors of 33pF each is used
as a standard connection for the crystal as shown in the circuit diagram.
72
RESET
Pin no 9 is provided with an RESET arrangement by a combination of an electrolytic
capacitor and a register forming RC time constant. At the time of switch on, the capacitor gets
charged, after charging it behaves as a full short circuit from the positive to the pin number 9.
After the capacitor gets fully charged the current stops flowing and pin number 9 is pulled down
by a 10k resistor to the ground. This arrangement of reset pin 9 going high initially and then to
logic 0 i.e., low helps the program execution to start from the beginning. In absence of this the
program execution could have taken place habitually anywhere from the program cycle. A
pushbutton switch is connected across the capacitor so that at any given time as desired it can be
pressed that discharges the capacitor and while released the capacitor starts charging again and
then pin number 9 goes to high and then back to low, to enable the program execution from the
beginning. This operation of high to low of the reset pin takes place in fraction of a second as
decided by the time constant R and C.
For example: A 10F capacitor and a 10k resistor would render a 100ms time to pin number 9
from logic high to low, there after the pin number 9 remains low.
L293D has 2 set of arrangements where one set has input 1, input 2, output 1
and output 2 and other set has input 3, input 4, output 3 and output 4, according to block
diagram if pin no 2 & 7 are high then pin no 3 & 6 are also high.
If enable 1
and pin number 2 are high leaving pin number 7 as low then the
73
OPERATION EXPLANATION
Connections:
The output of the power supply which is 5v is connected to 40 pin of MC and GND is connected
to its 20th pin. Pin 2.0 of port 2 of microcontroller is connected to transistor BC547 that drives the
load. Pin 2.2 of port 2 of MC is connected to pin 9 i.e., EN 2 of motor driver L293D. Pin 2.4 of
port 2 of Microcontroller is connected to pin 10 i.e., IN 3 of L293D. Pin 2.5 of port 2 of MC is
connected to pin 7 i.e., IN2 of L293D. Pin 2.6 of port 2 of MC is connected to pin 2 i.e., IN1 of
L293D. Pin 2.7 of port 2 of MC is connected to pin 1 i.e., EN1 of L293D. Pin 3.0 of port 3 of
MC is given to pin 3 of TSOP 1738. Pin no 14 and 11 of L293D are connected to dc motor 1. Pin
3 and 6 of L293D are connected to dc motor 2. Pin 0 of L293D is given 12v and pin 16 of
L293D is given 5v. Pin no 4, 5, 13, 12 of L293D are given to GND.
Working:
Conventional T.V. remotes output infra red codes. A standard TV remote that delivers infrared
codes at 38 KHz is thus received by the TSOP receiver feeding a 14 bit data so emitted from the
remote to the controller through receiver. The program is so returned that it recognizes the
corresponding 14 bit data relating to a particular number being pressed at the remote.
74
The program is so returned i.e., while executed it sends commands to the motor driver IC
as per its requirement for running the motor for the movement of the robot as explained in the
subject above in L293D. the TV remote button 1 is for left, 3 is for right, 2 is forward, 5 is for
backward and 0 is for stop.
75
76
9.CODING
77
VAR1 equ r7
;Temporary Variable
;Temp variable
equ 11H
;Count
;Device address
;Command
;Flip bit
IR
equ P3.0
EN1
equ P2.7
EN2
equ P2.2
IN1
equ P2.6
IN2
equ P2.5
IN3
equ P2.4
IN4
equ P2.3
fan
equ P2.0
SWport
equ P2
org 00H
main:
jnb IR,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
78
djnz VAR1,$
mov VAR1,#123
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#25
djnz VAR1,$
mov VAR1,#11
djnz VAR1,$
mov c,IR
mov FLIP,c
clr A
mov COUNT,#5
mov VAR1,#25
fadd:
djnz VAR1,$
mov VAR1,#32
djnz VAR1,$
mov VAR1,#25
djnz VAR1,$
mov VAR1,#4
djnz VAR1,$
mov c,IR
rrc a
djnz COUNT,fadd
mov ADDR,A
clr a
mov COUNT,#6
mov VAR1,#115
fcmd:
djnz VAR1,$
79
mov VAR1,#55
djnz VAR1,$
mov VAR1,#23
djnz VAR1,$
mov VAR1,#4
djnz VAR1,$
mov c,IR
rlc a
djnz COUNT,fcmd
mov TEMP,CMD
mov CMD,a
mov a,ADDR
cjne a,#00,nvalid
mov a,TEMP
cjne a,CMD,valid
nvalid:
ljmp main
valid:
valid1:
mov c,FLIP
mov TOG,c
mov a,CMD
80
clr c
cjne a,#2,skip1
clr EN1
setb EN2
;set enable2
setb IN1
; set input1
clr IN2
; set input2
clr IN3
; set input3
clr IN4
; set input4
ljmp main
isset1:
ljmp main
skip1:
cjne a,#5,skip2
clr EN1
clr EN2
clr IN1
clr IN2
clr IN3
clr IN4
ljmp main
skip2:
cjne a,#8,skip3
setb EN1
clr EN2
clr IN1
setb IN2
clr IN3
81
setb IN4
ljmp main
skip3:
cjne a,#4,skip4
setb EN1
setb EN2
clr IN1
setb IN2
setb IN3
clr IN4
ljmp main
skip4:
cjne a,#6,skip5
setb EN1
setb EN2
setb IN1
clr IN2
clr IN3
setb IN4
ljmp main
skip5:
cjne a,#1,skip6
clr fan
ljmp main
skip6:
cjne a,#7,skip7
clr fan
ljmp main
skip7:
cjne a,#0CH,exit
mov SWport,#00H
ljmp main
exit:
ljmp main
END
;End of program
10.HARDWARE TESTING
In electronics, a continuity test is the checking of an electric circuit to see if current flows
(that it is in fact a complete circuit). A continuity test is performed by placing a small voltage
(wired in series with an LED or noise-producing component such as a piezoelectric speaker)
across the chosen path. If electron flow is inhibited by broken conductors, damaged components,
or excessive resistance, the circuit is "open".
83
Devices that can be used to perform continuity tests include multi meters which measure
current and specialized continuity testers which are cheaper, more basic devices, generally with a
simple light bulb that lights up when current flows.
An important application is the continuity test of a bundle of wires so as to find the two ends
belonging to a particular one of these wires; there will be a negligible resistance between the
"right" ends, and only between the "right" ends.
This test is the performed just after the hardware soldering and configuration has been
completed. This test aims at finding any electrical open paths in the circuit after the soldering.
Many a times, the electrical continuity in the circuit is lost due to improper soldering, wrong and
rough handling of the PCB, improper usage of the soldering iron, component failures and
presence of bugs in the circuit diagram. We use a multi meter to perform this test. We keep the
multi meter in buzzer mode and connect the ground terminal of the multi meter to the ground.
We connect both the terminals across the path that needs to be checked. If there is continuation
then you will hear the beep sound.
not. If proper voltages appear at the supply pins of IC bases then insert IC and check the required
output.
Now we have to check whether the LEDs are in working condition or not, Red LED or IR
LED or Photo diode has got one longer leg and one shorter leg. Longer leg is positive
terminal of LED and shorter leg is negative terminal.
Now keep the multi meter in buzzer mode or continuity mode and touch red probe of multi
meter to the longer leg of LED and black probe of multi meter to the shorter leg of LED, if
LED glows in such case that means its working.
Now solder Red LED into PCB, remember longer leg of LED should be inserted into
positive marking on PCB and shorter leg should be inserted into other hole of LED marking on
PCB. Now after soldering LED with a series resistor apply battery voltage to the board and see
whether the LED is glowing or not.
The black LED is photodiode and white LED is IR diode even these components have
got longer leg and shorter leg, insert longer leg into +ve marking hole on PCB and insert shorter
leg into other hole of LED marking on PCB .
11. Application
Robots are used for in detecting the minerals present in the ground.
These can be used in construction industry for locating steel bars present in concrete.
They are used in airports and building security to detect the weapons.
85
12.CONCLUSION
86
From the design and analysis of the above project we conclude that ROBOTICS is one of the
best means of future advancement in any field of science. Use several wireless technologies is
empowering the designing and use of ROBOTS in a better way. Our prototype design could be
interfaced with more advanced wireless technologies like GSM, GPS, Zigbee etc to enhance its
capabilities to be used in more critical situations.
87
13.BIBLIOGRAPHY
TEXT BOOKS REFERED:
1. The AVR Microcontroller and Embedded systems by Muhammad Ali Mazidi and Janice
Gillispie Mazidi , Pearson Education.
2. ATMEGA16Data Sheets.
WEBSITES
www.atmel.com
www.beyondlogic.org
www.wikipedia.org
www.howstuffworks.com
www.alldatasheets.com
88