Académique Documents
Professionnel Documents
Culture Documents
I.
II.
ATMEGA-8
GSM-300
III.
L293D
IV.
LM7805
V.
VI.
VII.
VIII.
IX.
X.
XI.
XII.
Capacitors
Diodes
Resistors
Crystal oscillator
12 Volt DC motor
Solenoid lock
16*2 LCD
4*3 keypad matrix
XIII.
XIV.
5 volt adaptor
3.1.1 ATMEGA-8:
Microcontrollers, as the name suggests, are small controllers. They are like single
chip computers that are often embedded into other systems to function as
processing/controlling unit. For example, the remote control you are using probably
has microcontrollers inside that do decoding and other controlling functions. They are
also used in automobiles, washing machines, microwave ovens, toys ... etc, where
automation is needed.
Microcontrollers sometimes are called single-chip computers because they have onchip memory and I/O circuitry and other circuitries that enable them to function as
small standalone computers without other supporting circuitry.
Microcontrollers often use EEPROM or EPROM as their storage device to allow field
programmability so they are flexible to use. Once the program is tested to be correct
then large quantities of microcontrollers can be programmed to be used in embedded
systems.
EASY TO USE
Assembly language is often used in microcontrollers and since they usually follow
RISC architecture, the instruction set is small. The development package of
microcontrollers often includes an assembler, a simulator, a programmer to "burn" the
chip and a demonstration board. Some packages include a high-level language
compiler such as a C compiler and more sophisticated libraries.
8051 microcontroller has 128 bytes of RAM, 4K bytes of on-chip ROM, two timers,
one serial port, and four ports (each 8-bits wide) all on a single chip. The 8051 is an 8bit processor i.e. the CPU can work on only 8 bits of data at a time. The fixed amount
of on-chip ROM, RAM, and number of I/O ports in microcontroller makes them ideal
for many applications in which cost and space are critical.
3.1.2.1 FEATURES:
External
Interrupts
On-chip
ROM for
program
code
Timer 0
On-chip
RAM
Timer 1
4 I/O
Ports
Serial
port
CPU
Osc
Bus
control
P0 P1 P2 P3
ADDRESS/DATA
FIG 3.1
10
TXD
RXD
Counter Inputs
Interrupt
control
ETC.
40
39
P1.2
P1.3
P1.4
P1.5
RST
38
37
36
34
33
(RD) P3.7
32
10
31
GND
EA/VPP
PSEN
P2.7 (A15)
P2.6 (A14)
11
30
12
29
P2.5 (A13)
P2.4 (A12)
P2.3 (A11)
13
28
XTAL2
XTAL1
P0.7 (AD7)
ALE/PROG
(T0) P3.4
(WR) P3.6
P0.4 (AD4)
P0.6 (AD6)
(TXD) P3.1
(T1) P3.5
P0.3 (AD3)
35
(INT1) P3.3
P0.2 (AD2)
P0.5 (AD5)
(RXD) P3.0
(INT0) P3.2
P0.0 (AD0)
P0.1 (AD1)
P1.6
P1.7
Vcc
P2.2 (A10)
14
27
15
26
FIG 3.2
16
25
11
17
24
P2.1 (A9)
P2.0 (A8)
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 high- impedance inputs.
Port 0 also receives the code bytes during Flash programming, and outputs the code
bytes during program verification. External pull-ups are required during program
verification.
12
Port 2 also receives the high-order address bits and some control signals during Flash
programming and verification.
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 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.
PORT PIN
ALTERNATE FUNCTIONS
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
TABLE 3.1
13
In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency,
and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external Data Memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With
the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the
pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
PSEN - Program Store Enable is the read strobe to external program memory. When
the AT89C51 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each
access to external data memory.
XTAL1 - Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
14
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier,
which can be configured for use as an on-chip oscillator. 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.
XTAL1
C1
XTAL2
C2
GND
Fig 3.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.
15
The most widely used registers of the 8051 are A (accumulator), B, R0, R1, R2, R3,
R4, R5, R6, R7, DPTR (data pointer), and PC (program counter). All of the above
registers are 8-bits, except DPTR and the program counter. The 8 bots of a register are
shown below from the MSB (most significant bit) D7 to the LSB (least significant bit)
D0.
D7
D6
D5
D4
D3
D2
D1
D0
CY
AC
F0
RS1
RS0
OV
---
CY
AC
---
RS1
RS0
OV
---
RS1
0
Address
00H 07H
08H 0FH
10H 17H
18H 1FH
17
i.
A total of 32 bytes from locations 00 to 1H hex are set aside for register banks
and the stack.
ii.
A total of 16 bytes from locations 20H to 2FH are set aside for bit-addressable
read/write memory.
iii.
A total of 80 bytes from locations 30H to 7FH are used for read and write
storage, or what is normally called a scratch pad. These
80 locations of RAM are widely used for the purpose of storing data and
parameters by 8051 programmers.
7F
Scratch pad RAM
30
2F
Bit-Addressable RAM
20
1F
Register Bank 3
18
17
Register Bank 2
10
Fig 3.4
18
The 32 bytes of RAM which is set aside for the register banks and stack is divided
into 4 banks of registers in which each bank has 8 registers, R0 R7. RAM locations
from 0 to 7 are set aside for bank 0 of R0 R7
Bank 0
Bank 1
Bank 2
Bank 3
R7
R7
R7
R7
R6
R6
R6
R6
R5
R5
R5
R5
R4
R4
R4
R4
R3
R3
R3
R3
R2
R2
R2
R2
R1
R1
R1
R1
R0
R0
R0
R0
FIG 3.5
19
register contains value 07 which implies that RAM location 08 is the first location
being used for the stack by the 8051. The storing of a CPU register in the stack is
called a PUSH, and loading the contents of the stack back into a CPU register is
called a POP. In other words, a register is pushed onto the stack to save it and popped
off the stack to retrieve it.
20
2. INDIRECT ADDRESSING
In indirect addressing, the instruction specifies a register that specifies a register that
contains the address of the operand. Both internal and external RAM can be indirectly
accessed.The address register for 8-bit addresses can be either the stack pointer or R0
or R1 of the selected register bank. The address register for 16-bit addresses can be
only the 16-bit data pointer register, DPTR.
3. REGISTER INSTRUCTIONS
The register banks, which contain registers R0 through R7, can be accessed by
instructions whose opcodes carry a 3-bit register specification. Instructions that access
the registers this way make efficient use of code, since this mode eliminates an
address byte. When the instruction is executed, one of the eight registers in the
selected bank is accessed. One of four banks is selected at execution time by the two
bank select bits in the PSW.
4. REGISTER-SPECIFIC INSTRUCTIONS
Some instructions are specific to a certain register. For example, some instructions
always operate on the Accumulator, so no address byte is needed to point to it. In
these cases, the opcode itself points to the correct register.
5. IMMEDIATE CONSTANTS
The value of a constant can follow the opcode in program memory. For example,
MOV A, #100
Loads the Accumulator with the decimal number 100. The same number could be
specified in hex digits as 64H.
6. INDEXED ADDRESSING
Program memory can only be accessed via indexed addressing. This addressing mode
is intended for reading look-up labels in program memory. A 16-bit base register
(either DPTR or the Program Counter) points to the base of the table, and the
accumulator is set up with the table entry number. The address of the table entry in
program memory is formed by adding the accumulator data to the base pointer.
21
The MNEMONIC column contains the 8051 Instruction Set Mnemonic and a brief
description of the instruction's operation.
OPERATION:
The OPERATION column describes the 8051 Instruction Set in unambiguous
symbology. Following are the definitions of the symbols used in this column.
<n:m>
Binary addition
Logical And
Inclusive Or
Exclusive Or
>
Greater than
<>
Not equal to
Equals
->
AC
CF
DPTR
Jump Relative to PC
A Jump that can range between -128 bytes and +127 bytes
from the PC value of the next instruction.
Paddr
PC
PM (addr)
Remainder
Soper
SP
STACK
HEX OPCODE:
This column gives the machine language hexadecimal opcode for each 8051
instruction.
BYTE:
This column gives the number of bytes in each 8051 instruction.
23
CYC:
This column gives the number of cycles of each 8051 instruction. The time value of a
cycle is defined as 12 divided by the oscillator frequency. For example, if running an
8051 family component at 12 MHz, each cycle takes 1 microsecond.
24
3.1.3 SIM-300:
FIG 3.6
Two audio channels include two microphones inputs and two speaker outputs. This
can be easily configured by AT command.
SIM300 provide RF antenna interface with two alternatives: antenna connector and
antenna pad. The antenna connector is MURATA MM9329-2700. And customers
antenna can be soldered to the antenna pad.
The SIM300 is designed with power saving technique, the current consumption to as
low as 2.5mA in SLEEP mode.
The SIM300 is integrated with the TCP/IP protocolExtended TCP/IP AT
commands are developed for customers to use the TCP/IP protocol easily, which is
very useful for those data transfer applications.
26
3.1.3.3 SPECIFICATIONS:
TABLE 3.2
Feature
Implementation
Power supply
Power saving
Frequency bands
GSM class
Transmit power
GPRS connectivity
Small MS
Class 4 (2W) at EGSM900
Class 1 (1W) at DCS1800 and
PCS 1900
GPRS multi-slot class 8
default )
GPRS multi-slot class
10 (option
GPRS mobile station
class B
Temperature range
DATA GPRS:
CSD:
27
External antenna
Audio features
3.1.3.4 AT COMMANDS:
Command
Description
A/
ATA
ATD
28
ATT
ATV
ATX
ATZ
AT&C
AT&D
AT&F
AT&V
AT&W
STORE CURRENT
PROFILE
AT+DR
AT+DS
AT+GCAP
AT+GMI
AT+GMM
AT+GMR
REQUEST
TA
SOFTWARE
PARAMETER
REVISION
TO
USER DEFINED
INDENTIFICATION
OF
AT+GOI
RELEASE
REQUEST GLOBAL OBJECT IDENTIFICATION
AT+GSN
AT+ICF
AT+IFC
AT+ILRR
AT+IPR
TABLE 3.3
29
3.1.4 L293D:
FIG 3.7
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 highercurrent 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 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.
30
FIG 3.8
31
Function
Name
Enable 1,2
Input 1
Output 1
Ground (0V)
Ground
Ground (0V)
Ground
Output 2
Input 2
Vcc
Enable 3,4
10
Input 3
11
Output 3
12
Ground (0V)
Ground
13
Ground (0V)
Ground
14
Output 4
15
Input 4
16
Vcc
TABLE 3.4
32
3.1.5 LM7805:
FIG 3.9
3.1.5.1 FEATURES
Output Current up to 1A
Output Voltage of 5
Thermal Overload Protection
Short Circuit Protection
33
3.1.6 CAPACITORS
It is an electronic component whose function is to accumulate charges and then release
it.
To understand the concept of capacitance, consider a pair of metal plates which all
are placed near to each other without touching. If a battery is connected to these
FIG 3.11
plates the positive pole to one and the negative pole to the other, electrons from the
battery will be attracted from the plate connected to the positive terminal of the
battery. If the battery is then disconnected, one plate will be left with an excess of
electrons, the other with a shortage, and a potential or voltage difference will exists
between them. These plates will be acting as capacitors. Capacitors are of two
types: -
A) Fixed type:
like ceramic, polyester, electrolytic capacitors-these names refer to the material they
are made of aluminium foil.
34
B) Variable type:
like gang condenser in radio or trimmer. In fixed type capacitors, it has two leads and
its value is written over its body and variable type has three leads. Unit of
measurement of a capacitor is farad denoted by the symbol F. It is a very big unit of
capacitance.
Small
unit
capacitor
are
pico-farad
denoted
by
pf
(Ipf=1/1000,000,000,000 f) Above all, in case of electrolytic capacitors, it's two
terminal are marked as (-) and (+) so check it while using capacitors in the circuit in
right direction. Mistake can destroy the capacitor.
35
3.1.7 DIODES
The simplest semiconductor device is made up of a sandwich of P-type semi
conducting material, with contacts provided to connect the p-and n-type layers to an
external circuit. This is a junction Diode. If the positive terminal of the battery is
connected to the p-type material (cathode) and the negative terminal to the N-type
material (Anode), a large current will flow. This is called forward current or forward
biased.
If the connections are reversed, a very little current will flow. This is because
under this condition, the p-type material will accept the electrons from the negative
terminal of the battery and the N-type material will give up its free electrons to the
battery, resulting in the state of electrical equilibrium since the N-type material has no
more electrons. Thus there will be a small current to flow and the diode is called
Reverse biased.
Thus the Diode allows direct current to pass only in one direction while
blocking it in the other direction. Power diodes are used in concerting AC into DC. In
this, current will flow freely during the first half cycle (forward biased) and
practically not at all during the other half cycle (reverse biased). This makes the diode
an effective rectifier, which convert ac into pulsating dc. Signal diodes are used in
radio circuits for detection. Zener diodes are used in the circuit to control the voltage.
FIG 3.12
37
3.1.8 RESISTORS
CODE
Black ------------------------------------------------0
Brown-----------------------------------------------1
Red -------------------------------------------------2
Orange ----------------------------------------------3
Yellow ----------------------------------------------4
Green -----------------------------------------------5
Blue -------------------------------------------------6
Violet------------------------------------------------7
Grey-------------------------------------------------8
White------------------------------------------------9
38
FIG 3.13
The first rings give the first digit. The second ring gives the second digit. The
third ring indicates the number of zeroes to be placed after the digits. The fourth ring
gives tolerance (gold 5%, silver 10%, No colour 20%).
In variable resistors, we have the dial type of resistance boxes. There is a knob
with a metal pointer. This presses over brass pieces placed along a circle with some
space b/w each of them.
Resistance coils of different values are connected b/w the gaps. When the
knob is rotated, the pointer also moves over the brass pieces. If a gap is skipped over,
its resistance is included in the circuit. If two gaps are skipped over, the resistances of
both together are included in the circuit and so on.
A dial type of resistance box contains many dials depending upon the range,
dials
39
FIG 3.14
A crystal
oscillator is
an electronic
oscillator circuit
that
uses
the
mechanical resonance of a vibrating crystal of piezoelectric material to create an
electrical signal with a very precise frequency. This frequency is commonly used to
keep track of time (as in quartz wristwatches), to provide a stable clock
signal for digital integrated
circuits,
and
to
stabilize
frequencies
for radio
transmitters and receivers. The most common type of piezoelectric resonator used is
the quartz crystal, so oscillator circuits incorporating them became known as crystal
oscillators, but other piezoelectric materials including polycrystalline ceramics are
used in similar circuits.
Quartz crystals are manufactured for frequencies from a few tens of kilohertz to
hundreds of megahertz. More than two billion crystals are manufactured annually.
Most are used for consumer devices such as wristwatches, clocks, radios, computers,
and cell phones . Quartz crystals are also found inside test and measurement
equipment, such as counters, signal generators, and oscilloscopes.
3.1.9.1 OPERATION:
A crystal is a solid in which the constituent atoms, molecules, or ions are packed in a
regularly ordered, repeating pattern extending in all three spatial dimensions.
Almost any object made of an elastic material could be used like a crystal, with
appropriate transducers, since all objects have natural resonant frequencies
of vibration. For example, steel is very elastic and has a high speed of sound. It was
often used in mechanical filters before quartz. The resonant frequency depends on
size, shape, elasticity, and the speed of sound in the material. High-frequency crystals
are typically cut in the shape of a simple, rectangular plate. Low-frequency crystals,
such as those used in digital watches, are typically cut in the shape of a tuning fork.
For applications not needing very precise timing, a low-cost ceramic resonator is
often used in place of a quartz crystal.
40
When a crystal of quartz is properly cut and mounted, it can be made to distort in
an electric field by applying a voltage to an electrode near or on the crystal. This
property is known as electrostriction or inverse piezoelectricity. When the field is
removed, the quartz will generate an electric field as it returns to its previous shape,
and this can generate a voltage. The result is that a quartz crystal behaves like a circuit
composed of an inductor,capacitor and resistor, with a precise resonant frequency.
Quartz has the further advantage that its elastic constants and its size change in such a
way that the frequency dependence on temperature can be very low. The specific
characteristics will depend on the mode of vibration and the angle at which the quartz
is cut (relative to its crystallographic axes).Therefore, the resonant frequency of the
plate, which depends on its size, will not change much, either. This means that a
quartz clock, filter or oscillator will remain accurate. For critical applications the
quartz oscillator is mounted in a temperature-controlled container, called a crystal
oven, and can also be mounted on shock absorbers to prevent perturbation by external
mechanical vibrations.
41
3.1.10 DC MOTOR
Most electric motors work by electromagnetism, but motors based on other
electromechanical phenomena, such as electrostatic forces and the piezoelectric
effect, also exist. The fundamental principle upon which electromagnetic motors are
based is that there is a mechanical force on any current-carrying wire contained within
a magnetic field. The force is described by the Lorentz force law and is perpendicular
to both the wire and the magnetic field. Most magnetic motors are rotary, but linear
motors also exist. In a rotary motor, the rotating part (usually on the inside) is called
the rotor, and the stationary part is called the stator. The rotor rotates because the
wires and magnetic field are arranged so that a torque is developed about the rotor's
axis. The motor contains electromagnets that are wound on a frame. Though this
frame is often called the armature, that term is often erroneously applied. Correctly,
the armature is that part of the motor across which the input voltage is supplied.
Depending upon the design of the machine, either the rotor or the stator can serve as
the armature.
DC motors
FIG 3.15
42
place of the toxic mercury. This is the simplest form of a class of electric motors
called homopolar motors. A later refinement is the Barlow's Wheel.
Another early electric motor design used a reciprocating plunger inside a switched
solenoid; conceptually it could be viewed as an electromagnetic version of a two
stroke internal combustion engine.
The modern DC motor was invented by accident in 1873, when Znobe Gramme
connected a spinning dynamo to a second similar unit, driving it as a motor.
The classic DC motor has a rotating armature in the form of an electromagnet. A
rotary switch called a commutator reverses the direction of the electric current twice
every cycle, to flow through the armature so that the poles of the electromagnet push
and pull against the permanent magnets on the outside of the motor. As the poles of
the armature electromagnet pass the poles of the permanent magnets, the commutator
reverses the polarity of the armature electromagnet. During that instant of switching
polarity, inertia keeps the classical motor going in the proper direction.
Fig 3.16(a)
A simple DC electric motor. When the coil is powered, a magnetic field is generated
around the armature. The left side of the armature is pushed away from the left
magnet and drawn toward the right, causing rotation.
43
When the armature becomes horizontally aligned, the commutator reverses the
direction of current through the coil, reversing the magnetic field. The process then
repeats.
3.1.10.1 WOUND FIELD DC MOTOR
The permanent magnets on the outside (stator) of a DC motor may be replaced by
electromagnets. By varying the field current it is possible to alter the speed/torque
ratio of the motor. Typically the field winding will be placed in series (series wound)
with the armature winding to get a high torque low speed motor, in parallel (shunt
wound) with the armature to get a high speed low torque motor, or to have a winding
partly in parallel, and partly in series (compound wound) for a balance that gives
steady speed over a range of loads. Further reductions in field current are possible to
gain even higher speed but correspondingly lower torque, called "weak field"
operation.
rectifiers. In a circuit known as a chopper, the average voltage applied to the motor is
varied by switching the supply voltage very rapidly. As the "on" to "off" ratio is
varied to alter the average applied voltage, the speed of the motor varies. The rapid
switching wastes less energy than series resistors. Output filters smooth the average
voltage applied to the motor and reduce motor noise.
Since the series-wound DC motor develops its highest torque at low speed, it is often
used in traction applications such as electric locomotives, and trams. Another
application is starter motors for petrol and small diesel engines. Series motors must
never be used in applications where the drive can fail (such as belt drives). As the
motor accelerates, the armature (and hence field) current reduces. The reduction in
field causes the motor to speed up (see 'weak field' in the last section) until it destroys
itself. This can also be a problem with railway motors in the event of a loss of
adhesion since, unless quickly brought under control, the motors can reach speeds far
higher than they would do under normal circumstances. This can not only cause
problems for the motors themselves and the gears, but due to the differential speed
between the rails and the wheels it can also cause serious damage to the rails and
wheel treads as they heat and cool rapidly.
One interesting method of speed control of a DC motor is the Ward-Leonard Control.
It is a method of controlling a DC motor (usually a shunt or compound wound) and
was developed as a method of providing a speed-controlled motor from an AC supply,
though it is not without its advantages in DC schemes. The AC supply is used to drive
an AC motor, usually an induction motor that drives a DC generator or dynamo. The
DC output from the armature is directly connected to the armature of the DC motor
(usually of identical construction). The shunt field windings of both DC machines are
excited through a variable resistor from the generator's armature. This variable
resistor provides extremely good speed control from standstill to full speed, and
consistent torque. This method of control was the de facto method from its
development until it was superseded by solid state thyristor systems. It found service
in almost any environment where good speed control was required, from passenger
lifts through to large mine pit head winding gear and even industrial process
machinery and electric cranes. Its principal disadvantage was that three machines
were required to implement a scheme (five in very large installations, as the DC
machines were often duplicated and controlled by a tandem variable resistor). In
many applications, the motor-generator set was often left permanently running to
avoid the delays that would otherwise be caused by starting it up as required.
the pulsating force), and the resultant motor is generally less efficient than an
equivalent pure DC motor. Operating at normal power line frequencies, the maximum
output of universal motors is limited and motors exceeding one kilowatt are rare. But
universal motors also form the basis of the traditional railway traction motor. In this
application, to keep their electrical efficiency high, they were operated from very low
frequency AC supplies with 25 Hz and 16 2/3 Hz operation being common. Because
they are universal motors, locomotives using this design were also commonly capable
of operating from a third rail powered by DC.
The advantage of the universal motor is that AC supplies may be used on motors
which have the typical characteristics of DC motors, specifically high starting torque
and very compact design if high running speeds are used. The negative aspect is the
maintenance and short life problems caused by the commutator. As a result such
motors are usually used in AC devices such as food mixers and power tools which are
only used intermittently. Continuous speed control of a universal motor running on
AC is very easily accomplished using a thyristor circuit while stepped speed control
can be accomplished using multiple taps on the field coil. Household blenders that
advertise many speeds frequently combine a field coil with several taps and a diode
that can be inserted in series with the motor (causing the motor to run on half-wave
DC with half the RMS voltage of the AC power line).
Unlike AC motors, universal motors can easily exceed one revolution per cycle of the
mains current. This makes them useful for appliances such as blenders, vacuum
cleaners, and hair dryers where high-speed operation is desired. Many vacuum cleaner
and weed trimmer motors will exceed 10,000 RPM, Dremel and other similar
miniature grinders will often exceed 30,000 RPM. A theoretical universal motor
allowed to operate with no mechanical load will overspeed, which may damage it. In
real life, though, various bearing frictions, armature "windage", and the load of any
integrated cooling fan all act to prevent overspeed.
With the very low cost of semiconductorrectifiers, some applications that would have
previously used a universal motor now use a pure DC motor, usually with a
permanent magnet field. This is especially true if the semiconductor circuit is also
used for variable-speed control.
The advantages of the universal motor and alternating-current distribution made
installation of a low-frequency traction current distribution system economical for
some railway installations. At low enough frequencies, the motor performance is
approximately the same as if the motor were operating on DC. Frequencies as low as
16 2/3 Hertz were employed.
46
FIG 3.17
Solenoids are made up of a coil of wire and a plunger or actuator. The coil of wire is
wound many times around a plastic spool. The copper wire is lightly coated with a
varnish to electrically insulate the wire from conducting power to each strand, since
the wires are laying next to each other and touching. This allows the coil of wire to
have a long length for creating a magnetic field. The generation of the magnetic field
is dependent upon the way the coil is wound. The magnetic field can either be a push
or pull type of field. Since the coil is wound around the plastic spool, the plunger or
actuator fits inside of the spool. Attached to the plunger is a mechanical lever that can
increase the movement of the "in" or "out" action of the electric solenoid.
CAR DOOR LOCKS
The locks on modern cars and trucks are a typical example of a push & pull type
action solenoid. As described above, a coil of wire is wound around a plastic spool.
Inside the spool is a plunger or actuator. When the "lock" button is pressed on the
door panel of the vehicle, an electrical signal is sent to the coil. The electrical power
generates a magnetic field inside the coil, and may pull down on the plunger, causing
the lock mechanism to engage. The "unlock" button simply reverses the flow of
electricity to the solenoid, so the magnetic field is generated in the opposite direction.
This causes the plunger to be pushed from the plastic spool, forcing the lock
mechanism to disengage. Only direct current (DC) power has the ability to reverse the
magnetic force of an electrical solenoid. By reversing the current flow in DC, the
magnetic force will also be reversed. As the name implies, direct current can only
move in one direction at one time; either from positive to negative, or by switching,
from negative to positive.
47
AC SOLENOIDS
Alternating Current (AC) power goes from negative to positive 60 times every
second. This cycling of power is called a Hertz. The power from the wall outlet
energizing the computer you are reading this article on, operates at 120VAC with a
60-hertz cycle. Since the power is cycling at such a fast rate, the electric solenoid coil
must be wound in such as way that it can only move in one direction when energized
by AC power. Once engaged, the solenoid must have a way to disengage once the
power is released. This disengagement is typically performed by a spring. The springs
aid the push or pull action of the solenoid's ability to shut "off." Of course, since the
spring helps to release the plunger after being engaged, it must also be overcome in
force by the magnetism of the coil. In other words, the spring must be strong enough
to release the plunger to the "off" position, but not be so strong that the magnetic coil
cannot turn "on" the plunger. You can hear these types of electrical solenoids in the
cycling of a washing machine. This happens when the water valves are actuated to
allow cold and hot water to enter the machine. You should be able to hear an audible
"click" each time the push & pull solenoid is actuated.
48
FIG 3.18
49
FIG 3.19
A keypad is a set of buttons arranged in a block or "pad" which usually bear digits,
symbols and usually a complete set of alphabetical letters. If it mostly contains
numbers then it can also be called a numeric keypad. Keypads are found on
many alphanumeric keyboards and on other devices such as calculators, push-button
telephones, combination locks, and digital door locks, which require mainly numeric
input.
50
A computer keyboard usually has a small numeric keypad on the side, in addition to
the other number keys on the top, but with a calculator-style arrangement of buttons
that allow more efficient entry of numerical data. This number pad (commonly
abbreviated to "numpad") is usually positioned on the right side of the keyboard
because most people are right-handed.
Many laptop computers have special function keys which turn part of the alphabetical
keyboard into a numerical keypad as there is insufficient space to allow a separate
keypad to be built into the laptop's chassis. Separate external plug-in keypads can be
purchased.
As a general rule, the keys on calculator-style keypads are arranged such that 123 is
on the bottom row, whereas in a telephone keypad, there will be the 123-keys at the
top. A phone key-pad also has the special buttons labelled * (star) and #
(octothorpe, number sign, "pound", "hex" or "hash") on either side of the zero key.
Most of the keys on a telephone also bear letters which have had several auxiliary
uses, such as remembering area codes or whole telephone numbers.
The keypad of a calculator contains the digits 0 through 9, from bottom upwards,
together with the four arithmetic operations, the decimal point and other more
advanced mathematical functions.
The reason that the keypad of keyboards and calculators are different is the subject of
some uncertainty. There are several popular theories and folk histories. One popular
theory suggests that the reason is similar to that given for the QWERTY layout, the
unfamiliar ordering slowed down users to accommodate the slow switches of the late
1950s and early 1960s.[2] Although calculator keypads predate telephone keypads,
telephone designers had several reasons to use the descending order. At the time of
the introduction of the telephone keypad, telephone numbers in the U.S. where
commonly given out using alphabetical characters for the first two digits. Thus 5551234 would be given out as KL5-1234. These alpha sequences were mapped to
words. "27" was given out as "CRestview", "26" as "ATwood", etc. By placing the
"1" key in the upper left, the alphabet was arranged in the normal left-to-right
descending order for English characters. Additionally, on a rotary telephone the "1"
hole was at the top, albeit at the top right. Finally, some sources state that AT&T
conducted research to see which ordering resulted in the least confusion. [3]
The definitive answer appears to be the result of a research study conducted by Bell
Labs published in 1960: "Human Factor Engineering Studies of the Design and Use of
51
Pushbutton Telephone Sets" by R. L. Deininger. [4] This study concluded that the
adopted layout was best.
Keypads are also a feature of some combination locks. This type of lock is often used
on doors, such as that found at the main entrance to some offices.
Fig 3.20
52
FIG 3.21
In electronics, a center tap (CT) is a contact made to a point halfway along a winding
of a transformer or inductor, or along the element of a resistor or a potentiometer.
Taps are sometimes used on inductors for the coupling of signals, and may not
necessarily be at the half-way point, but rather, closer to one end. A common
application of this is in the Hartley oscillator. Inductors with taps also permit the
transformation of the amplitude of alternating current (AC) voltages for the purpose
of power conversion, in which case, they are referred to as autotransformers, since
there
is
only
one
winding.
An
example
of
an
autotransformer
is
Fig 3.22
53
3.1.15 5V ADAPTOR
FIG 3.23
An AC adapter, AC/DC adapter, or AC/DC converteris a type of external power
supply, often enclosed in a case similar to an AC plug. Other names include plug
pack, plug-in adapter, adapter block, domestic mains adapter, line power adapter, wall
wart, power brick, and power adapter. Adapters for battery-powered equipment may
be described as chargers or rechargers (see also battery charger). AC adapters are used
with electrical devices that require power but do not contain internal components to
derive the required voltage and power from mains power. The internal circuitry of an
external power supply is very similar to the design that would be used for a built-in or
internal supply.
External power supplies are used both with equipment with no other source of power
and with battery-powered equipment, where the supply, when plugged in, can
sometimes charge the battery in addition to powering the equipment.
Use of an external power supply allows portability of equipment powered either by
mains or battery without the added bulk of internal power components, and makes it
unnecessary to produce equipment for use only with a specified power source; the
same device can be powered from 120Vac or 230Vac mains, vehicle or aircraft
battery by using a different adapter.
54
The basic setup of circuits of advance locking system is shown in the above diagram
the connections are as follows:
55
Fig 4.2
5V VCC is connected to 31st pin of microcontroller.
A RC reset circuit is connected to 9 st pin of microcontroller which resets the
microcontroller each the setup is switched on.
Port-3 (1st to 7th pin of port-3) of microcontroller is connected to 3*4 keypad
matrix.
18th and 19th pin of microcontroller is connected to 12 MHz crystal oscillator
for providing clock pulse to the microcontroller.
10th and 11th pin of microcontroller is connected to SIM-300 which send SMS
to the user.
Port-3 is again connected to L293D which drives the solenoid lock and DC
motor.
56
4.2 PROCEDURE
Etching.
Drilling.
Soldering.
FIG 4.3
57
Fig 4..4
58
4.2.1.5 ETCHING:
Pour a small amount of Ferric Chloride into a shallow plastic sealable container. Do
not use a metal container to store the etchant as it will be dissolved over time by the
etchant chemicals. Place the toner transferred PCB into the etchant. Soak a disposable
sponge in the ferric chloride and slowly rub the entire PCB material. Every so often
dip the sponge in the etchant to suck up more fluid. Rub the circuit board in a constant
pattern for around two to three minutes until all of the unmasked copper has been
etched away. A smaller circuit board will etch faster than a larger circuit board, so
spread out your rubbing action on a larger design.
FIG 4.5
59
4.2.1.6 DRILLING:
Using 0.5 mm drill bit drill the holes on the PCB where the components have to be
installed.
Be careful while drilling because it can break the PCB.
FIG 4.6
4.2.1.7 SOLDERING:
Now solder the components on the PCB for making the complete circuit. Keep time
soldering surface mount components minimum to avoid overheating.
FIG 4.7
60
4.2.2 PROCEDURE
Working of advance locking system is divided into following categories:
(i)
Power supply
(ii)
Microcontroller
(iii)
LCD
(iv)
GSM module
(v)
Motor driver IC
(vi)
Locks
Fig 4.8
The transformer converts 220V AC to 12V AC which is then given to full wave
rectifier which is then rectified into 10.8V rectified AV i.e. into DC but it contains
some ripple which is removed by using 100 microfarad electrolytic capacitor.
This 12V rectified AC is then given to LM7805 which converts 12V DC 5V regulated
DC. LM7805 does not gives exact 5V but it fluctuates between 4.9V to 5.2V therefore
to convert it into 5V we use 10 microfarad capacitor which gives 5V regulated DC
this is used to drive all the components of the advance locking system like
microcontroller, 16*2 LCD display, L293D and 3*4 keypad matrix.
61
4.2.2.2 ADAPTOR:
5V adaptor is used to drive GSM module which send and receive message while
operation of advance locking system.
4.2.2.3 MICROCONTROLLER:
Microcontroller acts as the brain of the advance locking system it controls all
the operations of the system. It stores the PIN and program for the operation as
it contains 8 KB of flash memory. It also generates the OTP.
It also compares the entered input with pre stored input or with the generated
OTP.
When we switch on the system LCD displays enter the PIN if user enters
correct PIN, microcontroller will generate an OTP and it is delivered to the
GSM module which send this OTP to the user via SMS. When user enter the
OTP the latch will be unlocked and door opens.
When user type incorrect PIN microcontroller will send the message
unauthorised attempt detected to GSM module which interns send this
message to the user via SMS. And microcontroller sends another signal to
L293D which latches secondary lock.
4.2.2.4 LCD:
LCD acts as one of the output device of the advance locking system it displays the
entered input and also display the response of the system.
62
FIG 4.9
L293D is used to drive locks it can operate two motors at time at can deliver 36 V at
output.
According to the following input control signal it produces output which locks or
unlocks the system :
INPUT 1
0
0
1
1
INPUT 2
0
1
0
1
ENABLE 1,2
Result
1
Stop
1
Anti-clockwise rotation
1
Clockwise rotation
1
Stop
TABLE 4.1
63
CHAPTER 5 : PROGRAMMING
C program is used to control the operations of microcontroller which is as follows:
#include <REGX52.H> //Include file for 8051
#include<LCD.h>
#define lcdrow1() lcdcommand(0x80)
#define lcdrow2() lcdcommand(0xC0)
/* Begin at Line 1 */
/* Begin at Line 2 */
void lcdenable();
void lcdcommand(unsigned char command);
void lcdputc(unsigned char ascii);
void lcdputs(unsigned char *lcdstring);
void lcdinit()
void send(unsigned char cht);
void sends(unsigned char *stt);
#define c1 P0_2 //column 1
#define c2 P0_1 //column 2
#define c3 P0_0 //column 3
unsigned char s;
void clock()
{
P3_6=0;
P1_6=1;
delay(100);
P3_6=1;
P1_6=1;
}
void anticlock()
{
P3_6=1;
64
P1_6=0;
delay(100);
P3_6=1;
P1_6=1;
}
void lock()
{
P3_7=1;
P1_7=1;
}
void unlock()
{
P3_7=0;
P1_7=1;
}
char k,j;
unsigned temp[4];
char t,l,ni,no,h;
bit flag=1;
#define port P0
unsigned char get,key;
unsigned char getkey(void);
unsigned char code otp[6][4]=
{
{"4456"},
{"5567"},
{"3345"},
{"2234"},
{"1123"},
{"6678"}
65
};
bit clockflag=0;
void main()
{
P1=0xff;
lock();
anticlock();
clockflag=0;
lcdinit();
lcdrow1();
lcdputs(" GSM BASED
") ;
lcdrow2();
lcdputs("ADVANCED LOCKING") ;
delay(1000);
lcdrow1();
lcdputs("PROJECT DONE BY:")
lcdrow2();
lcdputs("ALAINA
")
delay(1000);
lcdrow1();
lcdputs("VEDANT
")
lcdrow2();
lcdputs("PRABHAT
") ;
delay(1000);
lcdrow1();
lcdputs("PALLAVI
")
lcdrow2();
lcdputs("QUAYAD ")
delay(1000);
lcdrow1();
66
lcdrow2();
lcdputs("B.B.D.N.I.T.M. ") ;
delay(1000);
EA = 1;
ET0 = 1;
TR0 = 1;
serial_init();
lcdcommand(0x01);
while(1)
{
lcdrow1();
lcdputs("Enter Password ");
lcdrow2();
lcdputs("
");
lcdrow2();
t=0;
while(t!=4)
{
temp[t] =getkey();
}
if(t==4)
{
if(temp[0]=='1'&&temp[1]=='2'&&temp[2]=='3'&&temp[3]=='4')
{
lcdrow1();
lcdputs("USER ONE
");
lcdrow2();
lcdputs("SENDING OTP
");
delay(1000);
67
ni=no;
sends("AT+CMGS=");
send('"');
sends("9696277789");
send('"');
sends("\r");
for(h=0;h<4;h++)
send(otp[ni][h]);
send(0x1a);
lcdrow1();
lcdputs("USER ONE
");
lcdrow2();
lcdputs("OTP SENT
");
delay(1500);
lcdrow1();
lcdputs("Enter OTP
");
lcdrow2();
lcdputs("
");
lcdrow2();
t=0;
while(t!=4)
{
temp[t] =getkey();
}
if(temp[0]==otp[ni][0]&&temp[1]==otp[ni][1]&&temp[2]==otp[ni][2]&&temp[3]==
otp[ni][3])
{
lcdrow1();
lcdputs("Success
");
if(flag==1)
{
68
flag=0;
unlock();
lcdrow2();
lcdputs("Unlocked
");
delay(1500);
}
else
{
flag=1;
lock();
lcdrow2();
lcdputs("Locked
");
delay(1500);
}
if(clockflag==1)
{
clockflag=0;
anticlock();
}
}
}
else
if(temp[0]=='9'&&temp[1]=='8'&&temp[2]=='7'&&temp[3]=='6')
{
lcdrow1();
lcdputs("USER TWO
");
lcdrow2();
lcdputs("SENDING OTP
");
delay(1500);
ni=no;
69
sends("AT+CMGS=");
send('"');
sends("8979627559"); ///////////////////////
send('"');
sends("\r");
for(h=0;h<4;h++)
send(otp[ni][h]);
delay(50) ;
send(0x1a);
lcdrow1();
lcdputs("USER TWO");
lcdrow2();
lcdputs("OTP SENT");
delay(1500);
lcdrow1();
lcdputs("Enter OTP");
lcdrow2();
lcdputs("
");
lcdrow2();
t=0;
while(t!=4)
{
temp[t] =getkey();
}
if(temp[0]==otp[ni][0]&&temp[1]==otp[ni][1]&&temp[2]==otp[ni][2]&&temp[3]==
otp[ni][3])
{
lcdrow1();
lcdputs("Success
");
if(flag==1)
{
70
flag=0;
unlock();
lcdrow2();
lcdputs("Unlocked
");
delay(1500);
}
else
{
flag=1;
lock();
lcdrow2();
lcdputs("Locked
");
delay(1500);
}
if(clockflag==1)
{
clockflag=0;
anticlock();
}
}
}
else
{
clock();
clockflag=1;
lock();
flag=1;
lcdrow1();
lcdputs("INVALID USER
");
lcdrow2();
71
72
no++;
else
no=0;
}
73