Security Code Lock Project Report
-
Author
threephasefault -
Category
Documents
-
view
109 -
download
2
Embed Size (px)
description
Transcript of Security Code Lock Project Report

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 1
1 INTRODUCTION Today everybody is very conscious about the security of their assets and home appliance So home security system is very popular nowadays but it also have some drawbacks In case conventional home security system anyone can operate it that means any one can switch it on or off without permission of the owner Introduction of code lock home security system can greatly solve this problem By using this system only user can operate home security system In this system when correct code is entered the controller senses it and triggers motor and whenever faulty code is entered the microcontroller senses it and alarm turns on Hence user can change the code and can keep it secret This project is very useful for door security applications It operates a relay( for example to open a door) for a few seconds when a valid code is entered The secret code can be changed any time after entering the current code The kit includes the relay for door lock Now a dayrsquos security must require for our home as well as office Here the micro controlled based digital code lock an access control system that allow only authorized person to access a restricted area When an authorized person enters the predetermined number via keypad the relay operates for a limited time ( itrsquos about 6 seconds) or jumper setting J1 show on the circuit board sets continuous It shows relay can be used up to operate solenoid solenoid is an electronic lock which can be used to openclose door When the code has been enters in corrected five times in row keypad will be locked for few minutes and it will be switched on the alarm
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 2
2 BLOCK DIAGRAM
KEY PAD
MICROCONTROLLER
RELAY CIRCUIT
ALARM OR MOTOR
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 3
3 CIRCUIY DIAGRAM
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 4
4 PROJECT DESCRIPTION
MICRO CONTROLLER A Micro controller is used for controlling entire circuits and to maintain timings Here a micro controller named AT89c51 from Atmel Corporation is used for that purpose AT89c51 is an bit micro controller has 40 pins arranged in 4 IO ports that ports are used here for connecting to interface with the load Micro controllerrsquos RESET pin is connected to an RC circuit as shown in above figure This will give a high pulse to the RESET pin at time of starting This will reset the micro controller means start execution from 0000h It is essential for a micro controller circuit When the power is switched ON charge in capacitor will be zero then the reset pin will get high voltage capacitor starts charging then the voltage across the RST pin will decrease micro controller starts execution
KEY PAD
In code lock circuit keypad is made using 12paces of micro switches sw1 to sw9 is used for enter 0to 9 numbers Sw10 is used for code change sw11 is used for enter the code
OPERATION First enter your right password by using number key 0 to 9 If your password is right LED L2 glows and relay is energized For code change enter your old password and push code change key sw10 LED L3 will glows now enter new code
LED INDICATOR L1 - LED used for power indicator L2 - relay status indicator L3 - this LED will glow when you want to change code L4 - this LED will glow when wrong password is entering for five times serially
TECHANICAL FEATURE Up to 32 digits password can be accepted Battery backup facility is provided Password can be changed at any time MasterSlave password facility Wrong password indication
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 5
5 PART LIST FOR CODE LOCK
Resistors R1 to R4 R8 330 Ω orange brown golden R5 8K2 Ω grey red red golden R6R7R9R10 1kΩ brown black red golden RN1 RN2 10K resistor network 9 pin Capacitors CD1CD2 33PF ceramic disc C3 10 uF 25v electrolyte capacitor C4C6 100KPF -104-01 uF ceramic disc C5 1000uF16v25v electrolyte capacitor C7 100uF 16v electrolyte capacitor Semiconductor U1 AT89c5152 micro controller U2U3 SN74LS 373 U4 LM7805 +5v regulator IC Q1Q3 BC547 NPN transistor Q2Q4 BC 548 NPN transistor L1L4L5 red LED 5mm L3 green LED L2 yellow LED D1 to D4 1N4007 rectifier diode Miscellaneous IC socket 40 pin 1 20 pin 2 X1 110592 crystal oscillator Switch 1 to13 3 leg tactile switch reset 2 leg switcj Relay 12 v 1CO PCB mount relay CN2 3 pin burgsstrip with jumper switch Buzzer continuous type Transformer 12v 500mA Two Pencil cell 15 v for dc motor Cell container Plywood Dc motor drive for door lock Main cord 2pin main cord for 230v ac power
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 6
RESISTORS
Example Circuit symbol
Function
Resistors restrict the flow of electric current for example a resistor is placed in series with a
light-emitting diode (LED) to limit the current passing through the LED
CAPACITORS The capacitors function is to store electricity or electrical energy The capacitor also functions
as a filter passing alternating current (AC) and blocking direct current (DC)
This symbol is used to indicate a capacitor in a circuit diagram The capacitor is
constructed with two electrode plates facing each other but separated by an insulator
When DC voltage is applied to the capacitor an electric charge is stored on each electrode While the capacitor is charging up current flows The current will stop flowing when the capacitor has fully charged
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 7
DIODES
Example Circuit symbol
Function
Diodes allow electricity to flow in only one direction The arrow of the circuit symbol shows the
direction in which the current can flow Diodes are the electrical version of a valve and early
diodes were actually called valves
Light Emitting Diodes (LEDs)
Example Circuit symbol
Function
LEDs emit light when an electric current passes through them
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 8
6 MAJOR COMPONENTS OF CODE LOCK
A Key pad
In access control system circuit keypad is made using 12 pcs Of micro switches sw1 to sw10 is
using for 0-9 numbersw10 is used for code changessw11 is usesd for enter the code When
this all this keys at logic high no key is pressed and when any of pin output goes low the two of
output is made logic high and even then if the input pin remains low then the key of the column
which is not made high is pressed In this way key board is sensed by the microcontroller
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 2
2 BLOCK DIAGRAM
KEY PAD
MICROCONTROLLER
RELAY CIRCUIT
ALARM OR MOTOR
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 3
3 CIRCUIY DIAGRAM
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 4
4 PROJECT DESCRIPTION
MICRO CONTROLLER A Micro controller is used for controlling entire circuits and to maintain timings Here a micro controller named AT89c51 from Atmel Corporation is used for that purpose AT89c51 is an bit micro controller has 40 pins arranged in 4 IO ports that ports are used here for connecting to interface with the load Micro controllerrsquos RESET pin is connected to an RC circuit as shown in above figure This will give a high pulse to the RESET pin at time of starting This will reset the micro controller means start execution from 0000h It is essential for a micro controller circuit When the power is switched ON charge in capacitor will be zero then the reset pin will get high voltage capacitor starts charging then the voltage across the RST pin will decrease micro controller starts execution
KEY PAD
In code lock circuit keypad is made using 12paces of micro switches sw1 to sw9 is used for enter 0to 9 numbers Sw10 is used for code change sw11 is used for enter the code
OPERATION First enter your right password by using number key 0 to 9 If your password is right LED L2 glows and relay is energized For code change enter your old password and push code change key sw10 LED L3 will glows now enter new code
LED INDICATOR L1 - LED used for power indicator L2 - relay status indicator L3 - this LED will glow when you want to change code L4 - this LED will glow when wrong password is entering for five times serially
TECHANICAL FEATURE Up to 32 digits password can be accepted Battery backup facility is provided Password can be changed at any time MasterSlave password facility Wrong password indication
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 5
5 PART LIST FOR CODE LOCK
Resistors R1 to R4 R8 330 Ω orange brown golden R5 8K2 Ω grey red red golden R6R7R9R10 1kΩ brown black red golden RN1 RN2 10K resistor network 9 pin Capacitors CD1CD2 33PF ceramic disc C3 10 uF 25v electrolyte capacitor C4C6 100KPF -104-01 uF ceramic disc C5 1000uF16v25v electrolyte capacitor C7 100uF 16v electrolyte capacitor Semiconductor U1 AT89c5152 micro controller U2U3 SN74LS 373 U4 LM7805 +5v regulator IC Q1Q3 BC547 NPN transistor Q2Q4 BC 548 NPN transistor L1L4L5 red LED 5mm L3 green LED L2 yellow LED D1 to D4 1N4007 rectifier diode Miscellaneous IC socket 40 pin 1 20 pin 2 X1 110592 crystal oscillator Switch 1 to13 3 leg tactile switch reset 2 leg switcj Relay 12 v 1CO PCB mount relay CN2 3 pin burgsstrip with jumper switch Buzzer continuous type Transformer 12v 500mA Two Pencil cell 15 v for dc motor Cell container Plywood Dc motor drive for door lock Main cord 2pin main cord for 230v ac power
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 6
RESISTORS
Example Circuit symbol
Function
Resistors restrict the flow of electric current for example a resistor is placed in series with a
light-emitting diode (LED) to limit the current passing through the LED
CAPACITORS The capacitors function is to store electricity or electrical energy The capacitor also functions
as a filter passing alternating current (AC) and blocking direct current (DC)
This symbol is used to indicate a capacitor in a circuit diagram The capacitor is
constructed with two electrode plates facing each other but separated by an insulator
When DC voltage is applied to the capacitor an electric charge is stored on each electrode While the capacitor is charging up current flows The current will stop flowing when the capacitor has fully charged
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 7
DIODES
Example Circuit symbol
Function
Diodes allow electricity to flow in only one direction The arrow of the circuit symbol shows the
direction in which the current can flow Diodes are the electrical version of a valve and early
diodes were actually called valves
Light Emitting Diodes (LEDs)
Example Circuit symbol
Function
LEDs emit light when an electric current passes through them
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 8
6 MAJOR COMPONENTS OF CODE LOCK
A Key pad
In access control system circuit keypad is made using 12 pcs Of micro switches sw1 to sw10 is
using for 0-9 numbersw10 is used for code changessw11 is usesd for enter the code When
this all this keys at logic high no key is pressed and when any of pin output goes low the two of
output is made logic high and even then if the input pin remains low then the key of the column
which is not made high is pressed In this way key board is sensed by the microcontroller
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 3
3 CIRCUIY DIAGRAM
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 4
4 PROJECT DESCRIPTION
MICRO CONTROLLER A Micro controller is used for controlling entire circuits and to maintain timings Here a micro controller named AT89c51 from Atmel Corporation is used for that purpose AT89c51 is an bit micro controller has 40 pins arranged in 4 IO ports that ports are used here for connecting to interface with the load Micro controllerrsquos RESET pin is connected to an RC circuit as shown in above figure This will give a high pulse to the RESET pin at time of starting This will reset the micro controller means start execution from 0000h It is essential for a micro controller circuit When the power is switched ON charge in capacitor will be zero then the reset pin will get high voltage capacitor starts charging then the voltage across the RST pin will decrease micro controller starts execution
KEY PAD
In code lock circuit keypad is made using 12paces of micro switches sw1 to sw9 is used for enter 0to 9 numbers Sw10 is used for code change sw11 is used for enter the code
OPERATION First enter your right password by using number key 0 to 9 If your password is right LED L2 glows and relay is energized For code change enter your old password and push code change key sw10 LED L3 will glows now enter new code
LED INDICATOR L1 - LED used for power indicator L2 - relay status indicator L3 - this LED will glow when you want to change code L4 - this LED will glow when wrong password is entering for five times serially
TECHANICAL FEATURE Up to 32 digits password can be accepted Battery backup facility is provided Password can be changed at any time MasterSlave password facility Wrong password indication
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 5
5 PART LIST FOR CODE LOCK
Resistors R1 to R4 R8 330 Ω orange brown golden R5 8K2 Ω grey red red golden R6R7R9R10 1kΩ brown black red golden RN1 RN2 10K resistor network 9 pin Capacitors CD1CD2 33PF ceramic disc C3 10 uF 25v electrolyte capacitor C4C6 100KPF -104-01 uF ceramic disc C5 1000uF16v25v electrolyte capacitor C7 100uF 16v electrolyte capacitor Semiconductor U1 AT89c5152 micro controller U2U3 SN74LS 373 U4 LM7805 +5v regulator IC Q1Q3 BC547 NPN transistor Q2Q4 BC 548 NPN transistor L1L4L5 red LED 5mm L3 green LED L2 yellow LED D1 to D4 1N4007 rectifier diode Miscellaneous IC socket 40 pin 1 20 pin 2 X1 110592 crystal oscillator Switch 1 to13 3 leg tactile switch reset 2 leg switcj Relay 12 v 1CO PCB mount relay CN2 3 pin burgsstrip with jumper switch Buzzer continuous type Transformer 12v 500mA Two Pencil cell 15 v for dc motor Cell container Plywood Dc motor drive for door lock Main cord 2pin main cord for 230v ac power
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 6
RESISTORS
Example Circuit symbol
Function
Resistors restrict the flow of electric current for example a resistor is placed in series with a
light-emitting diode (LED) to limit the current passing through the LED
CAPACITORS The capacitors function is to store electricity or electrical energy The capacitor also functions
as a filter passing alternating current (AC) and blocking direct current (DC)
This symbol is used to indicate a capacitor in a circuit diagram The capacitor is
constructed with two electrode plates facing each other but separated by an insulator
When DC voltage is applied to the capacitor an electric charge is stored on each electrode While the capacitor is charging up current flows The current will stop flowing when the capacitor has fully charged
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 7
DIODES
Example Circuit symbol
Function
Diodes allow electricity to flow in only one direction The arrow of the circuit symbol shows the
direction in which the current can flow Diodes are the electrical version of a valve and early
diodes were actually called valves
Light Emitting Diodes (LEDs)
Example Circuit symbol
Function
LEDs emit light when an electric current passes through them
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 8
6 MAJOR COMPONENTS OF CODE LOCK
A Key pad
In access control system circuit keypad is made using 12 pcs Of micro switches sw1 to sw10 is
using for 0-9 numbersw10 is used for code changessw11 is usesd for enter the code When
this all this keys at logic high no key is pressed and when any of pin output goes low the two of
output is made logic high and even then if the input pin remains low then the key of the column
which is not made high is pressed In this way key board is sensed by the microcontroller
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 4
4 PROJECT DESCRIPTION
MICRO CONTROLLER A Micro controller is used for controlling entire circuits and to maintain timings Here a micro controller named AT89c51 from Atmel Corporation is used for that purpose AT89c51 is an bit micro controller has 40 pins arranged in 4 IO ports that ports are used here for connecting to interface with the load Micro controllerrsquos RESET pin is connected to an RC circuit as shown in above figure This will give a high pulse to the RESET pin at time of starting This will reset the micro controller means start execution from 0000h It is essential for a micro controller circuit When the power is switched ON charge in capacitor will be zero then the reset pin will get high voltage capacitor starts charging then the voltage across the RST pin will decrease micro controller starts execution
KEY PAD
In code lock circuit keypad is made using 12paces of micro switches sw1 to sw9 is used for enter 0to 9 numbers Sw10 is used for code change sw11 is used for enter the code
OPERATION First enter your right password by using number key 0 to 9 If your password is right LED L2 glows and relay is energized For code change enter your old password and push code change key sw10 LED L3 will glows now enter new code
LED INDICATOR L1 - LED used for power indicator L2 - relay status indicator L3 - this LED will glow when you want to change code L4 - this LED will glow when wrong password is entering for five times serially
TECHANICAL FEATURE Up to 32 digits password can be accepted Battery backup facility is provided Password can be changed at any time MasterSlave password facility Wrong password indication
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 5
5 PART LIST FOR CODE LOCK
Resistors R1 to R4 R8 330 Ω orange brown golden R5 8K2 Ω grey red red golden R6R7R9R10 1kΩ brown black red golden RN1 RN2 10K resistor network 9 pin Capacitors CD1CD2 33PF ceramic disc C3 10 uF 25v electrolyte capacitor C4C6 100KPF -104-01 uF ceramic disc C5 1000uF16v25v electrolyte capacitor C7 100uF 16v electrolyte capacitor Semiconductor U1 AT89c5152 micro controller U2U3 SN74LS 373 U4 LM7805 +5v regulator IC Q1Q3 BC547 NPN transistor Q2Q4 BC 548 NPN transistor L1L4L5 red LED 5mm L3 green LED L2 yellow LED D1 to D4 1N4007 rectifier diode Miscellaneous IC socket 40 pin 1 20 pin 2 X1 110592 crystal oscillator Switch 1 to13 3 leg tactile switch reset 2 leg switcj Relay 12 v 1CO PCB mount relay CN2 3 pin burgsstrip with jumper switch Buzzer continuous type Transformer 12v 500mA Two Pencil cell 15 v for dc motor Cell container Plywood Dc motor drive for door lock Main cord 2pin main cord for 230v ac power
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 6
RESISTORS
Example Circuit symbol
Function
Resistors restrict the flow of electric current for example a resistor is placed in series with a
light-emitting diode (LED) to limit the current passing through the LED
CAPACITORS The capacitors function is to store electricity or electrical energy The capacitor also functions
as a filter passing alternating current (AC) and blocking direct current (DC)
This symbol is used to indicate a capacitor in a circuit diagram The capacitor is
constructed with two electrode plates facing each other but separated by an insulator
When DC voltage is applied to the capacitor an electric charge is stored on each electrode While the capacitor is charging up current flows The current will stop flowing when the capacitor has fully charged
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 7
DIODES
Example Circuit symbol
Function
Diodes allow electricity to flow in only one direction The arrow of the circuit symbol shows the
direction in which the current can flow Diodes are the electrical version of a valve and early
diodes were actually called valves
Light Emitting Diodes (LEDs)
Example Circuit symbol
Function
LEDs emit light when an electric current passes through them
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 8
6 MAJOR COMPONENTS OF CODE LOCK
A Key pad
In access control system circuit keypad is made using 12 pcs Of micro switches sw1 to sw10 is
using for 0-9 numbersw10 is used for code changessw11 is usesd for enter the code When
this all this keys at logic high no key is pressed and when any of pin output goes low the two of
output is made logic high and even then if the input pin remains low then the key of the column
which is not made high is pressed In this way key board is sensed by the microcontroller
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 5
5 PART LIST FOR CODE LOCK
Resistors R1 to R4 R8 330 Ω orange brown golden R5 8K2 Ω grey red red golden R6R7R9R10 1kΩ brown black red golden RN1 RN2 10K resistor network 9 pin Capacitors CD1CD2 33PF ceramic disc C3 10 uF 25v electrolyte capacitor C4C6 100KPF -104-01 uF ceramic disc C5 1000uF16v25v electrolyte capacitor C7 100uF 16v electrolyte capacitor Semiconductor U1 AT89c5152 micro controller U2U3 SN74LS 373 U4 LM7805 +5v regulator IC Q1Q3 BC547 NPN transistor Q2Q4 BC 548 NPN transistor L1L4L5 red LED 5mm L3 green LED L2 yellow LED D1 to D4 1N4007 rectifier diode Miscellaneous IC socket 40 pin 1 20 pin 2 X1 110592 crystal oscillator Switch 1 to13 3 leg tactile switch reset 2 leg switcj Relay 12 v 1CO PCB mount relay CN2 3 pin burgsstrip with jumper switch Buzzer continuous type Transformer 12v 500mA Two Pencil cell 15 v for dc motor Cell container Plywood Dc motor drive for door lock Main cord 2pin main cord for 230v ac power
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 6
RESISTORS
Example Circuit symbol
Function
Resistors restrict the flow of electric current for example a resistor is placed in series with a
light-emitting diode (LED) to limit the current passing through the LED
CAPACITORS The capacitors function is to store electricity or electrical energy The capacitor also functions
as a filter passing alternating current (AC) and blocking direct current (DC)
This symbol is used to indicate a capacitor in a circuit diagram The capacitor is
constructed with two electrode plates facing each other but separated by an insulator
When DC voltage is applied to the capacitor an electric charge is stored on each electrode While the capacitor is charging up current flows The current will stop flowing when the capacitor has fully charged
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 7
DIODES
Example Circuit symbol
Function
Diodes allow electricity to flow in only one direction The arrow of the circuit symbol shows the
direction in which the current can flow Diodes are the electrical version of a valve and early
diodes were actually called valves
Light Emitting Diodes (LEDs)
Example Circuit symbol
Function
LEDs emit light when an electric current passes through them
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 8
6 MAJOR COMPONENTS OF CODE LOCK
A Key pad
In access control system circuit keypad is made using 12 pcs Of micro switches sw1 to sw10 is
using for 0-9 numbersw10 is used for code changessw11 is usesd for enter the code When
this all this keys at logic high no key is pressed and when any of pin output goes low the two of
output is made logic high and even then if the input pin remains low then the key of the column
which is not made high is pressed In this way key board is sensed by the microcontroller
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 6
RESISTORS
Example Circuit symbol
Function
Resistors restrict the flow of electric current for example a resistor is placed in series with a
light-emitting diode (LED) to limit the current passing through the LED
CAPACITORS The capacitors function is to store electricity or electrical energy The capacitor also functions
as a filter passing alternating current (AC) and blocking direct current (DC)
This symbol is used to indicate a capacitor in a circuit diagram The capacitor is
constructed with two electrode plates facing each other but separated by an insulator
When DC voltage is applied to the capacitor an electric charge is stored on each electrode While the capacitor is charging up current flows The current will stop flowing when the capacitor has fully charged
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 7
DIODES
Example Circuit symbol
Function
Diodes allow electricity to flow in only one direction The arrow of the circuit symbol shows the
direction in which the current can flow Diodes are the electrical version of a valve and early
diodes were actually called valves
Light Emitting Diodes (LEDs)
Example Circuit symbol
Function
LEDs emit light when an electric current passes through them
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 8
6 MAJOR COMPONENTS OF CODE LOCK
A Key pad
In access control system circuit keypad is made using 12 pcs Of micro switches sw1 to sw10 is
using for 0-9 numbersw10 is used for code changessw11 is usesd for enter the code When
this all this keys at logic high no key is pressed and when any of pin output goes low the two of
output is made logic high and even then if the input pin remains low then the key of the column
which is not made high is pressed In this way key board is sensed by the microcontroller
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 7
DIODES
Example Circuit symbol
Function
Diodes allow electricity to flow in only one direction The arrow of the circuit symbol shows the
direction in which the current can flow Diodes are the electrical version of a valve and early
diodes were actually called valves
Light Emitting Diodes (LEDs)
Example Circuit symbol
Function
LEDs emit light when an electric current passes through them
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 8
6 MAJOR COMPONENTS OF CODE LOCK
A Key pad
In access control system circuit keypad is made using 12 pcs Of micro switches sw1 to sw10 is
using for 0-9 numbersw10 is used for code changessw11 is usesd for enter the code When
this all this keys at logic high no key is pressed and when any of pin output goes low the two of
output is made logic high and even then if the input pin remains low then the key of the column
which is not made high is pressed In this way key board is sensed by the microcontroller
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 8
6 MAJOR COMPONENTS OF CODE LOCK
A Key pad
In access control system circuit keypad is made using 12 pcs Of micro switches sw1 to sw10 is
using for 0-9 numbersw10 is used for code changessw11 is usesd for enter the code When
this all this keys at logic high no key is pressed and when any of pin output goes low the two of
output is made logic high and even then if the input pin remains low then the key of the column
which is not made high is pressed In this way key board is sensed by the microcontroller
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 9
B REGULATOR IC 7805
It is a 3 terminal positive voltages regulator This is used to make the stable voltage of +5v for MCU the lm7805 is three terminal positive regulator are available in the TO220 $ T03 package and with several fixed output voltage making them useful in a wide range of applications Each type of employs internal current limiting thermal shutdown and save operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Al through designed primarily as fixed voltage regulators For more information please refer data sheet of LM7805 PIN DIAGRAM
PIN DISCRIPTION
PIN NO FUNCTION NAME
1 Input voltage (5V-18V) input
2 Ground (0 V) ground
3 Regulated output 5V (48V-52V) output
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 10
C POWER SUPPLY-
Power supply is used to drive the circuit Inappropriate voltage will damage the entire circuitry therefore it constitutes a very important part of the circuit Every electronic circuit requires power for its operation Every function simple or complex is controlled by the power supply Even a little variation in voltage can damage all the circuitry So power supply is of prime importance in all the circuits The power supply which we get is ac operating at 220VoltsBut as our electronic circuits work only on dc therefore we cannot employ direct usage of supply which we get In order to overcome this we require various process namely transformation rectification smoothing or filtering and regulation These entire process using bridge rectifiers are illustrated below
Bridge rectifier is use to convert 12 AC into 12 DC voltage Two supply voltage are for the circuit A 12V AC from transformer is connected to bridge rectifier (D1-D4)All ICs are supplied with a regulator 5v from a LM7805 Fixed voltage regulator The unregulated voltage of approximately 12V is required for the relay driving circuit
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 11
TRANSFORMATION-
As already discussed the supply which we get is 220V AC supply In order to decrease the
magnitude of the voltage we make use of step down transformer This transformer has more
windings in the primary coil than in the secondary coil So the voltage output at the secondary
is an AC supply with magnitude less than 220V as shown below
RECTIFICATION-
As all the electronic circuits work on DC therefore this low voltage AC cannot be directly fed to
our circuit Thus a process of rectification is required In this process AC voltage is converted
into DC voltage using two semiconductor rectifying diodes as shown below
Now as the two diodes D1 and D2 are connected in the opposite manner Therefore one of the
diode gets forward biased during the positive half of the ac input and other gets forward
biased during the negative half of the ac input Thus during the positive half cycle rectification
takes place through diode D1(diode D2 being reverse biased cannot rectify) and during the
negative half cycle the rectification takes place through the diode D2(diode D1 being reverse
biased cannot rectify) But as at least one of the diode always remain in the conducting mode
therefore both the halves of the ac input gets rectified and hence the name full wave rectifier
SMOOTHINGFILTRATION
The output of the rectification process is a varying DC As the DC waveform cannot be varying
so it means that rectification is not 100 efficient due to which there is still some component of
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 12
the input AC present in the DC voltage which is responsible for the variation So in order to
remove this AC component we require filtration or smoothing of the signal This can be done
using an electrolytic capacitor of 2200uf As the capacitor offers infinite impedance to the DC
signal and Zero impedance to the AC signal therefore it allows the AC component to pass
through and blocks the DC component This means it will filter out the DC component from
the input signal Thus the output of the process will be a pure DC supply as shown below
Now there is still some variation indicating that output DC voltage is not having constant
magnitude This is due to the capacitor used for filtration Its time of charging and discharging
are not equal due to which the filtration is not up to the mark For making the output voltage
assume a constant value we need a voltage regulator
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 13
REGULATION-
Voltage regulator is used for this purpose mainly from the series of 78- - of the transistor For
getting the constant output of 5 volts we make use of 7805 voltage regulator This process
takes place as shown below
This completes all the processes Now we have a constant DC supply with us which can be fed
to any electronic circuit without any problem
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 14
D RELAY AND BUZZER CIRCUIT
RELAY-
A relay is an electrically operated switch Many relays use an electromagnet to operate a switching mechanism but other operating principles are also used Relays find applications where it is necessary to control a circuit by a low-power signal or where several circuits must be controlled by one signal The first relays were used in long distance telegraph circuits repeating the signal coming in from one circuit and re-transmitting it to another Relays found extensive use in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly drive an electric motor is called a contactor Solid-state relays control power circuits with no moving parts instead using a semiconductor device triggered by light to perform switching Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults in modern electric power systems these functions are performed by digital instruments still called protection relays
Relay Symbol
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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of solder means it can be melted away from the base metal leaving it mostly intact though the outer layer will be tinned with solder Flux will remain which can easily be removed by abrasive or chemical processes This tinned layer will allow solder to flow
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 33
into a new joint resulting in a new joint as well as making the new solder flow very quickly and easily
Common tools
Hand-soldering tools include the electric soldering iron which has a variety of tips available ranging from blunt to very fine to chisel heads for hot-cutting plastics and the soldering gun which typically provides more power giving faster heat-up and allowing larger parts to be soldered Hot-air guns and pencils allow rework of component packages which cannot easily be performed with irons and guns
Soldering torches are a type of soldering device that uses a flame rather than a soldering iron tip to heat solder Soldering torches are often powered by butane[3] and are available in sizes ranging from very small butaneoxygen units suitable for very fine but high-temperature jewelry work to full-size oxy-fuel torches suitable for much larger work such as copper piping
A soldering copper is a tool with a large copper head and a long handle which is heated in a blacksmiths forge fire and used to apply heat to sheet metal for soldering Soldering coppers are sometimes used in auto bodywork although body solder has been mostly superseded by non-metallic fillers
Toaster ovens and hand held infrared lights have been used to reproduce production processes on a much smaller scale
Bristle brushes are usually used to apply plumbing paste flux For electronic work flux-core solder is generally used but additional flux may be used from a flux pen or dispensed from a small bottle with a syringe-like needle
Wire brush wire wool and emery cloth are commonly used to prepare plumbing joints for connection Electronic joints rarely require mechanical cleaning
For PCB assembly and rework alcohol and acetone are commonly used with cotton swabs or bristle brushes to remove flux residue A heavy rag is usually used to remove flux from a plumbing joint before it cools and hardens A fiberglass brush can also be used
For electronic work solder wick and vacuum-operated solder sucker are used to undo solder connections
A heat sink such as a crocodile clips can also be used to prevent damaging heat-sensitive components while soldering
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 34
SOLDERING TOOLS
The only tools that are essential to solder are a soldering iron and some solder There are however lots of soldering accessories available (see soldering accessories for more information)
Different soldering jobs will need different tools and different temperatures too For circuit board work you will need a finer tip a lower temperature and finer grade solder You may also want to use a magnifying glass Audio connectors such as XLRs will require a larger tip higher temperature and thicker solder Clamps and holders are also handy when soldering audio cables
Soldering Irons
There are several things to consider when choosing a soldering iron
Wattage adjustable or fixed temperature power source (electric or gas) portable or bench use
I do not recommend soldering guns as these have no temperature control and can get too hot This can result in damage to circuit boards melt cable insulation and even damage connectors
Wattage
It is important to realise that higher wattage does not necessarily mean hotter soldering iron Higher wattage irons just have more power available to cope with bigger joints A low wattage iron may not keep its temperature on a big joint as it can loose heat faster than it can reheat itself Therefore smaller joints such as circuit boards require a lesser wattage iron - around 15-30 watts will be fine Audio connectors need something bigger - I recommend 40 watts at least
Temperature
There are a lot of cheap low watt irons with no temperature control available Most of these are fine for basic soldering but if you are going to be doing a lot you may want to consider a variable temperature soldering iron Some of these simply have a boost button on the handle which is useful with larger joints others have a thermostatic control so you can vary the heat of the tip
If you have a temperature controlled iron you should start at about 315-345degC (600-650degF) You may want to increase this however - I prefer about 700-750degF Use a temperature that will allow you to complete a joint in 1 to 3 seconds
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 35
Power
Most soldering irons are mains powered - either 110230v AC or benchtop soldering stations which transform down to low voltage DC Also available are battery and gas powered These are great for the toolbox but youll want a plug in one for your bench Gas soldering irons loose their heat in windy outside conditions more easily that a good high wattage mains powered iron
Portability
Most cheaper soldering irons will need to plug into the mains This is fine a lot of the time but if there is no mains socket around you will need another solution Gas and battery soldering irons are the answer here They are totally portable and can be taken and used almost anywhere They may not be as efficient at heating as a good high wattage iron but they can get you out of a lot of hassle at times If you have a bench setup you should consider using a soldering station These usually have a soldering iron and desoldering iron with heatproof stands variable heat and a place for a cleaning pad A good solder station will be reliable accurate with its temperature and with a range of tips handy it can perform any soldering task you attempt with it
Solder
The most commonly used type of solder is rosin core The rosin is flux which cleans as you solder The other type of solder is acid core and unless you are experienced at soldering you should stick to rosin core solder Acid core solder can be tricky and better avoided for the beginner Rosin core solder comes in three main types - 5050 6040 and 6337 These numbers represent the amount of tin and lead are present in the solderas shown below
Solder Type Tin Lead Melting Temp (degF)
5050 50 50 425
6040 60 40 371
6337 63 37 361
Any general purpose rosin core solder will be fine
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 36
SOLDERING ACCESSORIES
Soldering Iron Tips
Try to use the right size tip whenever you can Smaller wires and circuit boards require small fine tips and mic cable onto an XLR would need a larger tip You can get pointed tips or flat tipped ones (sometimes called spade tips) If you have a solder station with a desolderer you will also want a range of desoldering tips and cleaners
Soldering Iron Stands
These are handy to use if you are doing several or more joints It is a heat resistant cradle for your iron to sit in so you dont have to lie it down on the bench while it is hot It really is essential if you are planning to do a lot of bench soldering as it is only a matter of time before you burn something (probably your elbow resting on the hot tip) if you dont use one
Clamps
I strongly recommend clamps of some sort Trying to hold your soldering iron the solder and the wire is tricky enough but when you have to hold the connector as well it is almost impossible The are however adjustable clamps that can be manipulated to hold both the connector and the wire in place so you still have two free hands to apply the heat and the solder These are cheap items and I know mine have paid for themselves many times over
Magnifying glass
If you are doing work on PCBs (printed circuit boards) you may need to get a magnifying glass This will help you see the tracks on the PCB and unless you have exceptional sight small chip resistors are pretty difficult to solder on well without a magnifying glass Once again they are not expensive and some clamps come with one that can mount on the clamp stand
Solder Wick
Solder wick is a mesh the you lie on a joint and heat When it heats up it also melts the solder which is drawn out of the joint It is usually used for cleaning up solder from tracks on a circuit board but you will need a solder sucker to clean out the holes in the circuit board
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 37
Place the wick on the solder you want to remove then put your soldering iron on top of the wick The wick will heat up then the solder will melt and flow away from the joint and into wick
Solder Suckers
If you dont have a solder station with desolderer and you work on PCBs you are going to need one of these before too long They are spring loaded and suck the melted solder out of the joint They are a bit tricky to use as you have to melt the solder with your iron then quickly position the solder sucker over the melted solder and release the spring to suck up the solder I find solder wick to be easier to use and more effective
Fume Extractors
Solder fumes are poisonous A fume extractor will suck the fumes (smoke) into itself and filter it An absolute must for your health if you are setting up a soldering bench
PREPARATION
Step 1 Preparation
If you are preparing the cable for a connector I strongly suggest you put any connector parts on now (the screw on part of an XLR or casing of a 14 jack for example) Get into the habit of sliding these on before you start on the cable or else you can bet it wont be long before you finish soldering your connector only to discover you forgot to put the connector casing on and have to start all over again
Once you have all the connector parts on that you need you will need to strip your cable This means removing the insulation from the end of the wire and exposing the copper core You can either use a wire stripper side cutters or a knife to do this
The obvious tool to choose to strip a wire would bea wire stripper There are many types of wire stripper and most of them work the same You simply put the wire in and squeeze it and pull the end bit off It will cut to a preset depth and if you have chosen the right depth it will cut the insulation off perfectly It is possible to choose the wrong depth and cut too deeply or too shallow but they are very easy to use
On the other hand some people (myself included) prefer to use a knife or side cutters I use side cutters for small cable and a Stanley knife for bigger cablesand although I have a couple
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 38
of wire strippers I havent used them for years This may seem odd but Ive got my side cutters and knife with me anyway and they do the job fine
If you are using side cutters (as shown here) position them about 10mm (12 inch) from the end and gently squeeze the cutters into the insulation to pierce it but not far enough to cut the copper strands of the core Open the cutters slightly so you can turn the wire and pierce the rest of the insulation You may have to do this a few times to cut through all of the insulation but it is better to cut too shallow and have to turn and cut again rather than cut the core and have to start again Now you should be able to slide the insulation off with your cutters or pull it off with your fingers This may sound a tedious method but in no time at all you will be able to do it in two cuts and a flick of the cutters
I wont explain how I use a knife to do larger cable as Id hate someone to slice a finger or thumb open following my instructions Using a sharp blade like that certainly does have its risks so stick with wire cutters or side cutters if you are at all unsure
If your connector has been used before make sure you remove any remnants of wire and solder from the contacts Do this by putting the tip of your soldering iron into the hole and flicking the solder out when it has melted Common Sense Alert Please be careful when you flick melted solderflick it away from you
TINNING
Step 2 Tinning
Whatever it is you are soldering you should tin both contacts before you attempt to solder them This coats or fills the wires or connector contacts with solder so you can easily melt them together
To tin a wire apply the tip of your iron to the wire for a second or two then apply the solder to the wire The solder should flow freely onto the wire and coat it (if its stranded wire the solder should flow into it and fill the wire) You may need to snip the end off afterwards particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 39
Be careful not to overheat the wire as the insulation will start to melt On cheaper cable the insulation can shrink back if heated too much and expose more copper core that you intended You can cut the wire back after you have tinned it but its best simply not to over heat it
The larger the copper core the longer it will take to heat up enough to draw the solder in so use a higher temperature soldering iron for larger cables if you can
To tin a contact on an audio XLR connector hold the iron on the outside of the the contact for a second or two then apply the solder into the cavity of the contact Once again the solder should flow freely and fill the contact Connectors such as jacks have contacts that are just holes in a flat part of the connector To tin these you put your iron on it and apply the solder to where the iron is touching The solder should flow and cover the hole
Once you have tinned both parts you are ready to solder them together
SOLDERING
Step 3 Soldering
This step can often be the easiest when soldering audio cables
You simply need to place your soldering iron onto the contact to melt the solder
When the solder in the contact melts slide the wire into the contact
Remove the iron and hold the wire still while the solder solidifies again
You will see the solder set as it goes hard
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 40
This should all take around 1-3 seconds
A good solder joint will be smooth and shiny If the joint is dull and crinkly the wire probably moved
during soldering If you have taken too long it will have have solder spikes
If it does not go so well you may find the insulation has melted or there is too much stripped wire showing If this is the case you should desolder the joint and start again
CLEANING YOUR SOLDERING IRON
You should clean your tip after each use There are many cleaning solutions and the cheapest (and some say best) is a damp sponge Just rub the soldering iron tip on it after each solder
Another option is to use tip cleaner This comes in a little pot that you push the tip into This works well if your tip hasnt been cleaned for a while It does create a lot of smoke so it is better not to let the tip get so dirty that you need to use tip cleaner
Some solder stations come with a little pad at the base of the holder If you have one of these you should get into the habit of wiping the tip on the pad each time you apply solder with it
If you need to clean solder off a circuit board solder wick is what you need You place the wick on the joint or track you want to clean up and apply your soldering iron on top The solder melts and is drawn into the wick If there is a lot of solder the wick will fill up so gently pull the wick through the joint and your iron and the solder will flow into it as it passes
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 41
Tips and Tricks
1 Melted solder flows towards heat 2 Most beginning solderers tend to use too much solder and heat the joint for too long 3 Dont move the joint until the solder has cooled 4 Keep your iron tip clean 5 Use the proper type of iron and tip size
TROUBLESHOOTING
If either of the parts you are soldering is dirty or greasy the solder wont take (or stick) to it Desolder the joint and clean the parts before trying again
Another reason the solder wont take is that it may not be the right sort of metal For example you cannot solder aluminium with leadtin solder
If the joint has been moved during soldering it may look grainy or dull It may also look like this if the joint was not heated properly while soldering
If the joint was overheated the solder will have formed a spike and there will be burnt flux residue
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 42
9 PROGRAM
ASM CODE
LJMP labe1 _11
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
MOV R7A
RETI
Labe1_1
LCALL Labe1_2
SJMP FEh
Labe1_2
MOV 1Dh 01h
CLR A
MOV 1BhA
MOV 1AhA
MOV 1Ch00h
CLR A
MOV 1EhA
MOV 17hA
MOV 16hA
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 19hA
MOV 18hA
MOV 0Ch40h
MOV 0DhE2h
MOV 0Eh14h
MOV 0Fh0Ah
SETB A0h
SETB A1h
SETB A2h
SETB A3h
SETB A4h
SETB A5h
SETB A6h
SETB A7h
SETB B0h
SETB B2h
SETB B7h
Labe1_3
LCALL Labe1_4
JB B4h07h
CLR A
MOV 1BhA
MOV 1AhA
SJMP 06h
CLR A
MOV 1BhA
MOV 1Ah01h
JB B3h42h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 0Ah
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 10h
CLR A
MOV 0BhA
MOV 0AhA
LCALL Labe1_5
MOV DPTR07D0h
LCALL Labe1_7
SJMP 06h
CLR A
MOV 19hA
MOV 18h01h
JNB B3h21h
MOV A18h
CJNE
A01h04h
MOV A19h
JZ 02h
SJMP 16h
INC 1Dh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 43
CLR C
MOV A05h
SUBB A1Dh
JNC 03h
LCALL Labe1_6
CLR A
MOV 19hH
MOV 18hA
CLR A
MOV 0BhA
MOV 0AhA
JB B1h6Bh
MOV A16h
JNZ 04h
MOV A17h
JZ 02h
SJMP 61h
MOV A0Ah
CLR C
SUBB A0Ch
MOV 10hA
MOV A0Bh
SUBB A0Dh
MOV 11hA
MOV A0Ah
CLR C
SUBB A0Eh
MOV 12hA
MOV A0Bh
SUBB A0Fh
MOV 13hA
MOV A10h
JNZ 04h
MOV A11h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h01h
CLR 91h
SJMP 29h
MOV A12h
JNZ 04h
MOV A13h
JZ 02h
SJMP 14h
CLR A
MOV 0BhA
MOV 0AhA
CLR A
MOV 15hA
MOV 14hA
CLR A
MOV 17hA
MOV 16h02h
CLR 91h
SJMP 0Bh
CLR A
MOV 0BhA
MOV 0AhA
MOV DPTP2710h
LCALL Labe1_7
JB B3h1Eh
MOV A16h
CJNE A01h04h
MOV A17h
JZ 02h
SJMP 13h
MOV 0Ch14h
MOV 0Dh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
JNB B3h03h
LJMP Labe1_3
MOV A16h
CJNE A02h04h
MOV A17h
JZ 03h
LJMP Labe1_3
MOV 0Eh14h
MOV 0Fh15h
SETB 91h
MOV DPTR7530h
LCALL Labe1_7
CLR A
MOV 17hA
MOV 16hA
LJMP Labe1_3
RET
Labe1_4
JB A0h09h
MOV 1Eh01h
MOV DPTR07D0h
LCALL Labe1_7
JNB A0h2Bh
MOV A1Eh
CJNE A01h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A01h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV14h0Ah
MOV15h0Bh
MOV1Eh00h
JB A1h09h
MOV 1Eh02h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE
A0226h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 44
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A02h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A2h09h
MOV 1Eh03h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A2h 2Bh
MOV A1Eh
CJNE
A03h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL
Labe1_10
MOV A82h
MOV F0h83h
ADD A03h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A3h09h
MOV 1Eh04h
MOV DPTR07D0h
LCALL Labe1_7
JNB A3h2Bh
MOV A1Eh
CJNE A04h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A04h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh05h
MOV DPTR07D0h
LCALL Labe1_7
JNB A1h2Bh
MOV A1Eh
CJNE A05h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A05h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A5h09h
MOV 1Eh06h
MOV DPTR07D0h
LCALL Labe1_7
JNB A5h2Bh
MOV A1Eh
CJNE A06h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A06h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A6h09h
MOV 1Eh07h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A6h2Bh
MOV A1Eh
CJNE A07h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A07h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB A7h09h
MOV 1Eh08h
MOV
DPTR07D0h
LCALL Labe1_7
JNB A7h2Bh
MOV A1Eh
CJNE A08h26h
CLR A
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 45
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B0h09h
MOV 1Eh09h
MOV DPTR07D0h
LCALL Labe1_7
JNB B0h2Bh
MOV A1Eh
CJNE A09h26h
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV A82h
MOV F0h83h
ADD A09h
MOV 0AhA
CLR A
ADDC AF0h
MOV 0BhA
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
JB B2h09h
MOV 1Eh0Ah
MOV DPTR07D0h
LCALL Labe1_7
JNB B2h23h
MOV A1Eh
CJNE A0Ah1Eh
CLR A
MOV 34hA
MOV 33h0Ah
MOV 82h0Ah
MOV 83h0Bh
LCALL Labe1_10
MOV 0Ah82h
MOV 0Bh83h
MOV 14h0Ah
MOV 15h0Bh
MOV 1Eh00h
RET
Labe1_5
INC 1Ch
MOV A1Ch
CJNE A01h06h
MOV DPTR7530h
LCALL Labe1_7
MOV A1Ah
JNZ 04h
MOV A1Bh
JZ 02h
SJMP 04h
CLR 90h
CLR B5h
MOV A1Ah
A01h04h
MOV A1Bh
JZ 02h
SJMP 3Dh
CLR 90h
CLR B5h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A06h
MOV A2Ch
SUBB A00h
MOV A2Eh
SUBB A00h
JNZ 1Ah
MOVPTR 7530h
LCALL lable-8
INC 2Bh
CLR A
A2BhE1h
INC 2Ch
A2ChDCh
INC 2Dh
CJNE
A2DhD7h
INC 2Eh
SJMP D3h
MOV 1Ch02h
MOV 1Dh01h
MOV A1Ch
CJNE
A02h0Dh
SETB 90h
SETB B5h
MOV
DPTR7530h
LCALL lable 7
MOV 1Ch00h
RET
Lable 6
CLR 92h
CLR B7h
MOV
DPTR61A8h
LCALL lable 7
MOV
DPTR3A98h
LCALL lable 8
MOV
DPTR61A8h
LCALL lable-7
MOV
DPTR3A98h
LCALL lable-8
Mov dptr61A8h
LCALL lable 7
MOV DPTR3A98h
LCALL lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 46
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
MOV DPTR3A98h
LCALL Lable 8
MOV DPTR61A8h
LCALL Lable 7
SETB B7h
CLR A
MOV 2EhA
MOV 2DhA
MOV 2ChA
MOV 2BhA
CLR C
MOV A2Bh
SUBB A02h
MOV A2Ch
SUBB A00h
MOV A2Dh
SUBB A00h
MOV A2Eh
SUBB A00h
JNC 4Ah
CLR A
MOV 32hA
MOV 31hA
MOV 30hA
MOV 2FhA
CLR C
MOV A2Fh
SUBB A3Ch
MOV A30h
SUBB A00h
MOV A31h
SUBB A32h
MOVA32h
SUBB A00h
JNC 1Ah
MOV DPTR7530h
LCALL Lable 8
INC 2Fh
CLR A
CJNE A2FhE1h
INC 30h
CJNE A30hDCh
INC 31h
A31hD7h
INC 32h
SJMP D3h
INC 2Bh
CLR A
A2Bh0ch
INC 2Ch
A2Ch07h
INC 2Dh
A2DhA7h
INC 2Eh
SJMP A3h
SETB 92h
MOV 1Dh01h
RET
Lable 7
CLR B6h
LCALL Lable 8
SETB B6h
RET
Lable 8
MOV R282h
MOV R383h
CLR A
MOV 22hA
MOV 21hA
MOV 20hA
MOV 1FhA
MOV 04hR2
MOV 05hR3
MOV AR3
RLC A
SUBB AE0h
MOV R6A
MOV R7A
CLR C
MOV A1Fh
SUBB AR4
MOV A20h
SUBB AR5
MOV A21h
SUBB AR6
MOV A22h
SUBB AR7
JNC 14h
INC 1Fh
CLR A
A1FhE1h
INC 20h
A20hDCh
INC 21h
A21hD7h
INC 22h
SJMP D3h
RET
Lable 9
MOV 32h00h
RET
Lable 10
MOV A82h
MOV F0h33h
MUL AB
XCH A82h
PUSH Fun
MOV F0h34h
MUL AB
POP F0h
XCH A83h
MOV F0h33h
MUL AB
ADD A83h
MOV 83hA
RET
Lable 11
MOV 81h34h
LCALL Lable 9
MOV A82h
JZ 03h
LJMP Lable 1
MOV R100h
MOV AR1
ORL A00h
JZ 1Bh
MOV R200h
MOV DPTR05D1h
MOV R000h
MOV A0h00h
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 47
CLR A
MOVC AA+DPTR
MOVX R0A
INC DPTR
INC R0
CJNE R000h02Hh
INC A0h
DJNZ R1F4h
DJNZ R2F2h
MOV A0h3FFh
MOV R000h
MOV AR0
ORL A00h
JZ 0Ch
MOV R100h
MOV DPTR0000h
CLR A
MOVX DPTRA
INC DPTR
DJNZ R0FCh
DJNZ R1FAh
MOV R0A
DJNZ R0FDh
LJMP Lable1-1
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 48
10 CONCLUSION
By making the project ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo in major project for final year I
conclude that In this project we put our greatest effort to understand amp explore more amp more
about the project
This project has many useful applications in industries and security systems for all types of
applications also we try our best to make this project successful
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 49
11 BIBLIOGRAPHY
I developed my this project report of ldquoPROGRAMMABLE SECURITY CODE LOCKrdquo from following
books and web sites
Electronics and Circuits by Allen Mottershead
Basic Electronics by Miami AK
wwwelectronicsforucom
wwwwikipediacom
wwwatmelCom
wwwelectroschematicscom
wwwdatasheetarchivecom

PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 15
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 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
Relay inner view of coil and switch contacts
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 suppliers catalogue
should show you the relays 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 animated picture shows a working 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 There is one set of contacts (SPDT) in the
foreground and another behind them making the relay DPDT
The relays switch connections are usually labeled 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
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 16
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off
RELAY AND BUZZER DRIVER CIRCUIT
A SPDT relay is connected to pin 22 of the microcontroller through a driver transistor and
buffer IC The relay required 12volt at a current of the around 50mA which cannot provide by
the micro controller so the driver transistors are added the relay is used to operate the
external siren or for operating any other electrical device Normally the relay remains off As
soon as pin 22 of the micro controller goes high the transistors turn on and the relay operates
FIGURE FROM XEROX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 17
E AT89C5152 MICRO CONTROLLER
Features
bull Compatible with MCS-51trade Products
bull 4K Bytes of In-System Reprogrammable Flash Memory
ndash Endurance 1000 WriteErase Cycles
bull Fully Static Operation 0 Hz to 24 MHz
bull Three-Level Program Memory Lock
bull 128 x 8-Bit Internal RAM
bull 32 Programmable IO Lines
bull Two 16-Bit TimerCounters
bull Six Interrupt Sources
bull Programmable Serial Channel
bull Low Power Idle and Power Down Modes
Description
The AT89C51 is a low-power high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash Programmable and Erasable Read Only Memory (PEROM) The device is manufactured
using Atmelrsquos high density nonvolatile memory technology and is compatible with the industry
standard MCS-51trade instruction set and pin out The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer By
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 18
combining a versatile 8-bit CPU with Flash on a monolithic chip the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications
PIN CONFIGURATION
FIGURE FROM XEREX
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 19
BLOCK DIAGRAM
The AT89C51 provides the following standard features 4K bytes of Flash 128 bytes of RAM 32
IO lines two 16-bit timercounters a five vector two-level interrupt architecture a full duplex
serial port on-chip oscillator and clock circuitry In addition the AT89C51 is designed with static
logic for operation down to zero frequency and supports two software selectable power saving
modes The Idle Mode stops the CPU while allowing the RAM timercounters serial port and
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 20
interrupt system to continue functioning The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next hardware reset
PIN DESCRIPTION
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bidirectional IO 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 may also be configured to be the multiplexed loworder addressdata bus during accesses to
external program and data memory In this mode P0 has internal pullups Port 0 also receives
the code bytes during Flash programming and outputs the code bytes during program
verification External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional IO port with internal pull ups The Port 1 output buffers can
sinksource four TTL inputs When 1s are written to Port 1 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 1 also receives the low-
order address bytes during Flash programming and verification
Port 2
Port 2 is an 8-bit bidirectional IO port with internal pull ups The Port 2 output buffers can
sinksource four TTL inputs When 1s are written to Port 2 pins they are pulled high by the
internal pull ups and can be used as inputs As inputs Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull ups Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX DPTR) In this application it uses strong
internal pull ups when emitting 1s During accesses to external data memory that use 8-bit
addresses (MOVX RI) Port 2 emits the contents of the P2 Special Function Register Port 2
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 21
also receives the high-order address bits and some control signals during Flash programming
and verification
Port 3
Port 3 is an 8-bit bidirectional IO port with internal pullups The Port 3 output buffers can
sinksource four TTL inputs When 1s are written to Port 3 pins they are pulled high by the
internal pullups and can be used as inputs As inputs Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups
Port 3 also serves the functions of various special features of the AT89C51 as listed below
RST
Reset input A high on this pin for two machine cycles while the oscillator is running resets the
device
ALEPROG
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 In
normal operation ALE is emitted at a constant rate of 16 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 22
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
EAVPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH Note however that if
lock bit 1 is programmed EA will be internally latched on reset EA should be strapped to VCC
for internal program executions This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming for parts that require 12-volt VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit
XTAL2
Output from the inverting oscillator amplifier
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier which can be
configured for use as an on-chip oscillator as shown in Figure 1 Either a quartz crystal or
ceramic resonator may be used To drive the device from an external clock source XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2 There are no
requirements on the duty cycle of the external 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
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 23
Idle Mode
In idle mode the CPU puts itself to sleep while all the on chip peripherals remain active The
mode is invoked by software The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode The idle mode can be terminated by any enabled
interrupt or by a hardware reset It should be noted that when idle is terminated by a hard
ware reset the device normally resumes program execution from where it left off up to two
machine cycles before the internal reset algorithm takes control On-chip hardware inhibits
access to internal RAM in this event but access to the port pins is not inhibited To eliminate
the possibility of an unexpected write to a port pin when Idle is terminated by
Reset the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 24
7 SN74LS373 IC
The SN74LS373 consists of eight latches with 3-state outputs for bus organized system applications The flip-flops appear transparent to the data (data changes asynchronously) when Latch Enable (LE) is HIGH When LE is LOW the data that meets the setup times is latched Data appears on the bus when the Output Enable (OE) is LOW When OE is HIGH the bus output is in the high impedance state The SN74LS374 is a high-speed low-power Octal D-type Flip-Flop featuring separate D-type inputs for each flip-flop and 3-state outputs for bus oriented applications A buffered Clock (CP) and Output Enable (OE) is common to all flip-flops The SN74LS374 is manufactured using advanced Low Power Schottky technology and is compatible with all ON Semiconductor TTL families
-State Outputs for Bus Interfacing
-Triggered D-Type Inputs
-Triggered Clock
igh Speed Termination Effects
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 25
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 26
8 FABRICATION OF PCB
The PCB must be fabricated first Then the components are soldered carefully to PCB We should keep in mind that the quality of soldering affects the quality of output The procedure for fabricating the PCB for setting up the circuit of any multi purpose project is described below PCB LAYOUT
PCB MAKING Making of Printed Circuits Boards (PCBs) is as much as art on a technique particularly so when they are to fabricated in very small numbers There are several ways of drawing PCB patterns and making the final boards The making of PCB patterns and making PCB essentially involves two steps
1 Preparing the PCB drawing and 2 Fabricating the PCB itself from the drawing
The traditional method of drawing with complete placement of parts taking a photographic negative of the drawing developing the image of negative formed on photo sensitized copper plate and dissolving the excess copper by itching is a standard practice being followed in large scale operations However for small-scale operations where large numbers of copies are not required the cost saving procedure presented here may be adopted
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 27
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as placement of components on a piece of paper Locating holes deciding the diameters of various holes the optimum area of each components should occupy the shape and location lands for connecting two or more components at a place full space utilization and prevention of over crowding of components at a particular place There is no other way to arrive at the conclusion than by trial and error For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm diameter holes can be made Following these hints a sketch of PCB is made PCB FABRICATION The copper clad PCB laminate is now prepared by rubbing away the oxide grease etc With fine emery paper or sand paper on this the final PCB drawing may be traced by using a carbon paper Clips are used to prevent the carbon paper from slipping while PCB pattern is being traced on the laminate Only the connecting lines in PCBs slants and holes should be traced The components position can be marked on the PCBs reverse side if desired
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 28
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the traced PCB pattern created with black quick drilling enamel paint using a thin brush or a small metal case In case if there is any shorting of lines due to spilling of paint there may be removed by scrapping with a blade or knife after the paint has dried
After drying 20-30gms of Ferric chloride in 75ml of water may be heated to about 60deg and over the PCBs placed with its copper side upwards in a plastic tray Stirring the solution helps speedy etching The dissolution of unwanted copper would take about 45 minutes
If etching takes longer the solution may be heated again and the process is repeated The paint on the pattern can be removed by rubbing with a rag soaked in thinner turpentine or acetone The PCB may then be washed and dried
Depending on the wiring diagram the resistors are taken care at first and then the ICs are soldered
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 29
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal into the joint the filler metal having a relatively low melting point Soft soldering is characterized by the melting point of the filler metal which is below 400 degC (800 degF) The filler metal used in the process is called solder
Soldering is distinguished from brazing by use of a lower melting-temperature filler metal it is distinguished from welding by the base metals not being melted during the joining process In a soldering process heat is applied to the parts to be joined causing the solder to melt and be drawn into the joint by capillary action and to bond to the materials to be joined by wetting action After the metal cools the resulting joints are not as strong as the base metal but have adequate strength electrical conductivity and water-tightness for many uses Soldering is an ancient technique mentioned in the Bible and there is evidence that it was employed up to 5000 years ago in Mesopotamia
Applications
One of the most frequent applications of soldering is assembling electronic components to printed circuit boards (PCBs) Another common application is making permanent but reversible connections between copper pipes in plumbing systems Joints in sheet metal objects such as food cans roof flashing rain gutters and automobile radiators have also historically been
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 30
soldered and occasionally still are Jewelry components are assembled and repaired by soldering Small mechanical parts are often soldered as well Soldering is also used to join lead came and copper foil in stained glass work Soldering can also be used to affect a semi-permanent patch for a leak in a container cooking vessel
Solders
Soldering filler materials are available in many different alloys for differing applications In electronics assembly the eutectic alloy of 63 tin and 37 lead (or 6040 which is almost identical in performance to the eutectic) has been the alloy of choice Other alloys are used for plumbing mechanical assembly and other applications
A eutectic formulation has several advantages for soldering chief among these is the coincidence of the liquidus and solidus temperatures ie the absence of a plastic phase This allows for quicker wetting out as the solder heats up and quicker setup as the solder cools A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures Any differential movement during the plastic phase may result in cracks giving an unreliable joint Additionally a eutectic formulation has the lowest possible melting point which minimizes heat stress on electronic components during soldering
Lead-free solders are suggested anywhere children may come into contact (since children are likely to place things into their mouths) or for outdoor use where rain and other precipitation may wash the lead into the groundwater Common solder alloys are mixtures of tin and lead respectively
6337 melts at 183 degC (3614 degF) (eutectic the only mixture that melts at a point instead of over a range)
6040 melts between 183ndash190 degC (361ndash374 degF) 5050 melts between 185ndash215 degC (365ndash419 degF)
Lead-free solder alloys melt around 250 degC (482 degF) depending on their composition
For environmental reasons no-lead solders are becoming more widely used Unfortunately most no-lead solders are not eutectic formulations making it more difficult to create reliable joints with them See complete discussion below see also RoHS
Other common solders include low-temperature formulations (often containing bismuth) which are often used to join previously-soldered assemblies without un-soldering earlier connections and high-temperature formulations (usually containing silver) which are used for high-temperature operation or for first assembly of items which must not become unsoldered during subsequent operations Specialty alloys are available with properties such as higher strength better electrical conductivity and higher corrosion resistance
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 31
Flux
In high-temperature metal joining processes (welding brazing and soldering) the primary purpose of flux is to prevent oxidation of the base and filler materials Tin-lead solder for example attaches very well to copper but poorly to the various oxides of copper which form quickly at soldering temperatures Flux is a substance which is nearly inert at room temperature but which becomes strongly reducing at elevated temperatures preventing the formation of metal oxides Secondarily flux acts as a wetting agent in the soldering process reducing the surface tension of the molten solder and causing it to better wet out the parts to be joined
Fluxes currently available include water-soluble fluxes (no VOCs required for removal) and no-clean fluxes which are mild enough to not require removal at all Performance of the flux needs to be carefully evaluated a very mild no-clean flux might be perfectly acceptable for production equipment but not give adequate performance for a poorly-controlled hand-soldering operation
Traditional rosin fluxes are available in non-activated (R) mildly activated (RMA) and activated (RA) formulations RA and RMA fluxes contain rosin combined with an activating agent typically an acid which increases the wettability of metals to which it is applied by removing existing oxides The residue resulting from the use of RA flux is corrosive and must be cleaned off the piece being soldered RMA flux is formulated to result in a residue which is not significantly corrosive with cleaning being preferred but optional
BASIC SOLDERING TECHNIQUES
Methods
Soldering operations can be performed with hand tools one joint at a time or en masse on a production line Hand soldering is typically performed with a soldering iron soldering gun or a torch or occasionally a hot-air pencil Sheetmetal work was traditionally done with soldering coppers directly heated by a flame with sufficient stored heat in the mass of the soldering copper to complete a joint torches or electrically-heated soldering irons are more convenient All soldered joints require the same elements of cleaning of the metal parts to be joined fitting up the joint heating the parts applying flux applying the filler removing heat and holding the assembly still until the filler metal has completely solidified Depending on the nature of flux material used cleaning of the joints may be required after they have cooled
The distinction between soldering and brazing is arbitrary based on the melting temperature of the filler material A temperature of 450 degC is usually used as a practical cut-off Different equipment andor fixturing is usually required since (for instance) a soldering iron generally cannot achieve high enough temperatures for brazing Practically speaking there is a significant difference between the two processesmdashbrazing fillers have far more structural strength than solders and are formulated for this as opposed to maximum electrical conductivity Brazed
PROGRAMMABLE SECURITY CODE LOCK
MARUDHAR ENGINEERING COLLEGE BIKANER Page 32
connections are often as strong or nearly as strong as the parts they connect even at elevated temperatures
Hard soldering or silver soldering (performed with high-temperature solder containing up to 40 silver) is also often a form of brazing since it involves filler materials with melting points in the vicinity of or in excess of 450 degC Although the term silver soldering is used much more often than silver brazing it may be technically incorrect depending on the exact melting point of the filler in use In silver soldering (hard soldering) the goal is generally to give a beautiful structurally sound joint especially in the field of jewelry Thus the temperatures involved and the usual use of a torch rather than an iron would seem to indicate that the process should be referred to as brazing rather than soldering but the endurance of the soldering apellation serves to indicate the arbitrary nature of the distinction (and the level of confusion) between the two processes
Induction soldering is a process which is similar to brazing The source of heat in induction soldering is induction heating by high-frequency AC current Generally copper coils are used for the induction heating This induces currents in the part being soldered The coils are usually made of copper or a copper base alloy The copper rings can be made to fit the part needed to be soldered for precision in the work piece Induction soldering is a process in which a filler metal (solder) is placed between the faying surfaces of (to be joined) metals The filler metal in this process is melted at a fairly low temperature Fluxes are a common use in induction soldering This is a process which is particularly suitable for soldering continuously The process is usually done with coils that wrap around a cylinderpipe that needs to be soldered Some metals are easier to solder than others Copper silver and gold are easy Iron and nickel are found to be more difficult Because of their thin strong oxide films stainless steel and aluminum are a little more difficult Titanium magnesium cast irons steels ceramics and graphites can be soldered but it involves a process similar to joining carbides They are first plated with a suitable metallic element that induces interfacial bonding
DESOLDERING AND RESOLDERING
Used solder contains some of the dissolved base metals and is unsuitable for reuse in making new joints Once the solders capacity for the base metal has been achieved it will no longer properly bond with the base metal usually resulting in a brittle cold solder joint with a crystalline appearance
It is good practice to remove solder from a joint prior to resolderingmdashdesoldering braids or vacuum desoldering equipment (solder suckers) can be used Desoldering wicks contain plenty of flux that will lift the contamination from the copper trace and any device leads that are present This will leave a bright shiny clean junction to be resoldered
The lower melting point of so