8/10/2019 Electronic Safe2
1/50
ABSTRACT
The safety of life and properties is a very important part of our
everyday life. Bandits and burglars have designed various means
with which they do away with important belongings in the
absence of the owners. One way of guiding against this menace is
the security code locking system which can be mounted on doors
or even electrically operated metal boxes referred to as safes. The
design of electronics to control any automated system is
generally referred to as a code lock mechanism. An application of
code lock mechanism is design of electronic safe using themicrocontroller as an interface as described in this work. The front
panel of the safe is kept as simple as possible for the
understanding of the user. A code locking mechanism that
transmits information between a key and a locking mechanism
secured against interception misuse, but exible with respect to
original euipment, replacement parts, and emergency functions,
is obtained if the key code is, in each case, cryptographically
encoded through a hardware encoder. !hen the locking
mechanism is "rst operated, a control element inductively
coupled to a locking mechanism read#write unit with a new key
once and in a non#over writable manner, transmits an indent
number to the ob$ect memory. The lock used in the
microcontroller based electronic safe is basically a electronic
lock. A electronic lock is a lock that reuires the entering of a
speci"c seuence of symbols to dislodge and open. Though the
8/10/2019 Electronic Safe2
2/50
symbols are typically numerical, letters and other types of
symbols may also be used to formulate a seuence.
CHAPTER ONE
INTRODUCTION
Background of the project:
The new %ncyclopaedia Britannica, &'() de"nes code lock as *amechanical device for securing a safe or receptacle so that it
cannot be opened except by the key or a series of manipulations
that can be carried out only by a person knowing the secret or
code+. At this time locks are perceived as mechanical devices that
can be classi"ed into key#operated or electronic lock.
%lectronic safe is simply a mechanism for locking and unlocking
an electronically operated safe with a complicated lock used for
storing valuable things like money, ewels for security purposes. -t
makes use of *code lock+ as a mechanical device. -t is simple and
secure method of locking safe without having to resort to the use
of keys. This is used to secure money and valuables in the sense
that an authoried person in that section will only know the code
lock number.
8/10/2019 Electronic Safe2
3/50
The electronic safe is a practical and code locking solution, ideal
for commercial or residential premises. -t removes the need for
keys, taking away the hassle and cost of copying or replacing lost
ones
The microcontroller electronic safe is a secure, lockable box used
for securing valuable ob$ects against theft or damage. -f so, then,
an electronic safe is an electro#mechanical safe operated by
electronics. !hile designing the electronics for the ubiuitous safe
may sound straightforward, it is fraught with its own challenges.This article describes a simple electronics safe design and
discusses design techniues for dealing with challenges range
from preventing an intruder to break into the safe to power
management techniues for consuming the least power. This
article also discusses technological advances that can be used to
move this simple product concept beyond its original traditional
design.
Oject!"e# and I$portance of the De#!gn
-n recent years, a new type of lock, called an /electronic safe
lock/, has been developed for use on safes and vaults. The
electronic safe lock uses a programmable electronic circuit in
addition to mechanical components to control the safe locking
mechanism. The use of a programmable circuit gives the
electronic safe lock the ability to provide a large number of
8/10/2019 Electronic Safe2
4/50
features not available in the traditional mechanical safe lock.
These features include0
The ability to provide each user of the safe with a di1erent
electronic . -f an employee who has a electronic to the safe
leaves the company, only his electronic needs to be
changed # no need to change the electronic of the other
users.
%lectronic s can be uickly changed by the owner or
manager of the facility # no need to call in a locksmith tochange the electronic .
2peci"c electronic s can be programmed to only work on
certain days and at certain times. 3or example, an employee
who worked during the day could be given a electronic that
would only open the safe during day shift # her electronic
wouldn4t work during night shift.
An /audit trail/ record is kept in the lock. A report telling who
opened the safe and at what time can easily be created.
The lock can be programmed to provide a time#delay period
between the time when the electronic is entered and the
time when the safe unlocks. This is commonly done to
discourage robberies.
The lock can be programmed to reuire two separate
electronic s be entered in order to open the safe. This is
useful when your company policy reuires that two people
be present any time that the safe is opened.
8/10/2019 Electronic Safe2
5/50
%lectronic safe locks are designed as /drop#in/ replacements for
mechanical safe locks. This means that most existing safes can be
euipped with electronic safe locks without reuiring that ma$or
modi"cations be made to the safe. %xtensive e1ort has been put
into the design of electronic safe locks so that they are $ust as
reliable as their mechanical counterparts.
E%ECTRONIC SA&E %OC'S
%lectronic safe locks work by punching a certain electronic intoan electronic keypad which triggers the locking mechanism to
open. 5any prefer these safes since the electronic can be easily
changed, as opposed to key locking mechanisms that are more
di6cult and less secure in the event a key is lost.
!ith electronic safe locks, it makes it easy for a business to
change the electronic if a key employee is terminated, or you
have reason to believe that security may have been breached. -t
can o1er peace of mind, and some business owners change the
electronic safe locks freuently for security purposes.
%lectronic safe locks are great for storing keys, as a matter of
fact, and some people choose electronic safe locks for safes
where they store their laptops, which even have an access to plug
in the electric cord to the laptop, to keep it fully charged.
8/10/2019 Electronic Safe2
6/50
There are also electronic safe locks that are "ngerprint activated
and some may have the added security of a seven#day repeating
time lock schedule using secure, encrypted communication
protocol to give direct control over the lock bolt extension and
retraction which is controlled through the electronic safe locks
keypad or touchpad.
They typically have a battery for power and many of them o1er
secure and highly sophisticated features to make them more
desirable and convenient than key lock safes.
%lectronic safe locks o1er the ability to change your electronic s
without paying a locksmith, they might have a time delay, time
delay override, wrong try penalty, duress and alarm feature7 they
are also capable of high technology choices such as management
reset codes, a master code and several user codes and may have
over a million di1erent codes you can choose from.
5ost users prefer them because they allow you to program
di1erent features to "t the purpose you need it for. 2ome of them
have a hold#up alarm, a bolt sensor which tells you when the door
is opened, penalty lockouts for failed attempts and other features
that make them secure and easily programmable. This is why
they are often chosen for small retail businesses or multiple
employee access locations.
8/10/2019 Electronic Safe2
7/50
Because they o1er more features that can be set or changed by
the home or business owner, electronic safes are often preferred
for security purposes and ease of programming.
%lectronic safe locks are more secure in the event you lose your
keys, such as car and house keys. -t would at least make it
di6cult for an intruder to break into your house and "nd the key
that would give them access to your valuables such as $ewelry
and cash or important papers.
8ou can easily change the electronic s on electronic safe locks,
which is the primary reason many people prefer them. Besides
the additional features that they are capable of that key safe
locks are not, this ease of control and security falls on the owner4s
freedom to change electronic s or features whenever they choose.
This can save the expense and hassle of a locksmith as well as
the security breach of lost safe keys, which are the primary
reasons people prefer electronic safe safes.
Ho( to )ake a Cheap Safe
There are almost endless ways to make a cheap safe. The
materials you choose vary depending on the items that you want
to keep safe, how large the items are and whether you want the
safe to be portable. -n addition, you can make a sort of a safe that
doesn4t look like a safe.
8/10/2019 Electronic Safe2
8/50
9et some sort of metal box if you want to make a safe that
you will likely keep in your house. 9enerally, a metal box is
your best choice. :epending on the sie of the valuables,
look for a metal candy tin, tackle box or other type of box
with a hinged lid. ;inges on the inside of the box rather than
the outside will be the safest choice.
Take the box to a welding service and have them weld a lock
onto the box. This will make it more di6cult for a thief to
break into the safe. 8ou can choose between locks that
reuire a key or use a electronic . This is entirely up to you. -t
will probably depend on whether you are more likely to lose
a key or forget a string of numbers.
:rill at least six holes in the bottom of the box. :rill one hole
in each corner, and two near the middle.
8/10/2019 Electronic Safe2
9/50
5ost safe locks that are installed on the safes are actually
mechanical electronic locks. This means that you turn a dial in a
particular way, left and right, matching up numbers, in order for
the safe to open up. The electronic use using a mechanism that
has remained relatively changed since their invention many years
ago.
A key component of the traditional electronic lock is the wheel
pack. There are a number of notched wheels on a spindle. The
spindle is connected on one end to the drive cam. !hen you turnthe dial, you are actually turning the drive cam. This drive cam
has a kind of know that also matches the knob on the last wheel,
called the y wheel. All the wheels correspond with each other
through the drive cam.
The fence that is placed over the wheels is actually a metal bar.
!hen the notches on the wheels line up, this fence >that stopped
the lock from being opened? falls in the gap created by the
alignments of all the wheels. This is what allows the lock to open.
!hile the mechanical electronic lock has severed us well for
many years, it does have its disadvantages. -t is hard to change
and over time dust and wear can make it more di6cult to open
the lock. 3or these reasons, many manufactures and many
customers how look for electronic safe locks.
8/10/2019 Electronic Safe2
10/50
The electronic has a digital keypad. The manufacturer sets the
initial electronic for the digital keypad at the factory. !hen you
type in the matching numbers into the keypad the electronic
mechanism unlocks the safe.
There are many reasons why consumers prefer electronic safes
over the manual electronic safes and safes that use metal key0
A critical advantage is that the password is easy to change.
3ollowing simple instructions and using the current password, youcan change the safe to use a new password at any time. This is
especially useful when you want to temporarily give someone
access to the safe. 8ou can set the new password and give it to
the new person. !hen they no longer should have access, you
can change it to something new.
There is typically a backup key to use with electronic safes.
;owever, the key is used only as a back up and is not designed to
be the primary means of opening and closing the safe. 8ou should
store the key in a safe place. @ormally you will use a key
password to open the safe.
8/10/2019 Electronic Safe2
11/50
2ome of todays more advance safes allows you to use your
"ngerprint to open the safe. This is a similar technology to the
one build into many laptop computers today.
%lectronic safes o1er great exibility and allow the user to change
the electronic without the expense and hassle of calling a
locksmith. The next time you are looking for a new safe, consider
an electronic safe.
CHAPTER T+O
,-. %ITERATURE RE*IE+
An electronic safe is a type of lock in which a seuence of
numbers or symbols is used to open the lock. The seuence may
be entered using a single rotating dial which interacts with
several discs or cams, by using a set of several rotating discs with
inscribed numerals which directly interact with the locking
mechanism, or through an electronic or mechanical keypad.
3our digit code lock using mobile phone is a type of electronic
lock in which seuence of members are used to open the lock.
The seuence keyed in interacts with the mechanism through
the digital and electronic keypad.
8/10/2019 Electronic Safe2
12/50
,-/ HISTOR0
,-, E1ectron!c %ock
%lectronic locks have existed for centuries, but it was not until the
&)CCs that ma$or advancements in this technology were made.
@ow, electronic locks can be purchased at any hardware store or
mass merchandiser. ;owever, it should be remembered that the
locks we take for granted today were developed over centuries of
trial and error.
The earliest electronic safe was excavated in a =oman period
tomb on the Derameikos, Athens. Attached to a small box, itfeatured several dials instead of keyholes.E-n &FC(, the 5uslim
engineer Al#aari documented an electronic lock in his book al#
-lm !al#Amal al#@a" 3i 2ina4at al#;iyal >The Book of Dnowledge of
-ngenious 5echanical :evices?. 5uhammad al#Astrulabi >ca.
&FCC? also made electronic locks, two of which are kept in
Gopenhagen and Boston 5useums.
Ear12 E"!dence of E1ectron!c %ock#
/-The Eureka %ock3 The %ureka lock was patented in &)(F.
The device consisted of an electronic safe with "ve tumblers, and
was once used to lock up a vault in the
8/10/2019 Electronic Safe2
13/50
introduced the 5onitor Bank Jock. This lock is historically
signi"cant because it soon became the standard bank lock,
e1ectively replacing locks with keys and making electronic locks
the preferred bank lock. The company is still in operation today.
4- )a#ter %ock3 5aster Jocks are instantly recogniable to
any person who attended high school in the
8/10/2019 Electronic Safe2
14/50
But most of the times a land line phone is being used. -f a land
line phone is used then a separate ring detector circuit is reuired
for detecting the number of rings and then picking up the phone.
-t uses an extra relay and we have to enter inside the mechanism
of phone.
-n this report an auto answer facility which is present in many of
the cell phones today has been used, this eliminated the
designing of a ring detector circuit.
The aim of the proposed system is to develop a cost e1ective
solution that will provide controlling of security and to enable
home security against intrusion in the absence of owner. This
system is highly feasible due to development of a low cost
system. This control system with an a1ordable cost was thought
to be built that should be able to provide access via an onboard
keypad in other to automate the conventional electronic lock
system thus allowing for home security.
Pre#ent Scenar!o:
Nossible customers for this product would be home improvement
contractors, and supply stores. The bene"t of this, is that the end#
product can be sold in large uantities and it can be incorporated
into the construction of modernie homeso6cesindustries. The
end#product will not be sold in retails stores because recon"guring
it for proper control will be complicated and should only be
8/10/2019 Electronic Safe2
15/50
attempted by trained technicians. =etail stores would also not be
a good target for commercialiation due to the system reuiring a
mobile phone plan in order to operate. Advertising through mobile
phoneproviders would be a more feasible option.
Pre#ent and &uture Scope:
This product is aimed toward average consumers who wish to
control household security out"t remotely from their mobile
phones provided that it is electrically controllable. %xample of
feasible applications under consideration includes7 enabledisablesecurity systems, fans, lights, kitchen appliances, and
heatingventilationair conditioning system.
8/10/2019 Electronic Safe2
16/50
CHAPTER THREE
RESEARCH AND DESI9N )ETHODO%O90
RESEARCH )ETHOD
Basically, research on this pro$ect was done both on the internet
and on various %lectrical%lectronic textbooks. 3inally, we arrived
at designing with polished wood and leather applied all round for
proper "nishing. The circuit was built around discrete electronics
components including resistors, capacitors, transistors and as themicrocontroller as the core.
B%OC' DIA9RA) O& THE S0STE)
8/10/2019 Electronic Safe2
17/50
B%OC' DIA9RA) DESCRIPTION
'E0 ENCODERS: The key encoders provide all the necessary
logic to fully encode an array of 2N2T switches. The keyboard scan
is implemented internally by the microcontroller which constantly
monitors the individual key that makes up the entire keyboard.
These encoders also have on#chip pull#up devices which permit
switches with up to MCk on resistance to be used.
A :ata Available output goes to a high level when a valid
keyboard entry has been made. The :ata Available output returns
to a low level when the entered key is released, even if another
key is depressed. The :ata Available will return high to indicate
acceptance of the new key after a normal debounce period7 this
two#key roll#over is provided between any two switches. An
internal register remembers the last key pressed even after the
key is released.
8/10/2019 Electronic Safe2
18/50
PO+ER SUPP%0 UNIT:the power supply ection is built around a
conventional components and also run directly from a (P:G that
is stabilised down to MP:G for proper operation of the
microcontroller. Below is the power supply circuit when
running from the utility supply.
8/10/2019 Electronic Safe2
19/50
As seen on the above "gure, in order to enable microcontroller to
operate properly it is necessary to provide0
Nower supply
=eset signal
Glock signal
Obviously, all this is about very simple circuits, but it does not
have to be always like that. -f device is used for handling
expensive machines or for maintaining vital functions, everything
becomes more and more complicatedQ This kind of solution is
uite enough for the time being. The circuit, shown on the
"gure above, uses cheap voltage stabilisator J5')CM and
provides high#uality voltage level and uite enough current to
enable microcontroller and *peripheral electronics+ to operate
>su6cient current in this case amounts to &A?Q
8/10/2019 Electronic Safe2
20/50
*ISUA% DISP%A0 UNIT:The visual display unit is used to show
the current values of number of times attended work by the
workers. -t is built around the microcontroller which serves as the
core for the system by outputting the desired values of
information unto the display.
DC )OTOR UNIT: -n general, :G motors are similar to :G
generators in construction. They may, in fact, be described as
generators *run backwards.+ !hen current is passed through thearmature of a :G motor, a torue is generated by magnetic
reaction, and the armature revolves. The action of the
commutator and the connections of the "eld coils of motors are
precisely the same as those used for generators. The revolution of
the armature induces a voltage in the armature windings. This
induced voltage is opposite in direction to the outside voltage
applied to the armature, and hence is called back voltage or
counter electromotive force >emf?. As the motor rotates more
rapidly, the back voltage rises until it is almost eual to the
applied voltage. The current is then small, and the speed of the
motor will remain constant as long as the motor is not under load
and is performing no mechanical work except that reuired to
turn the armature.
8/10/2019 Electronic Safe2
21/50
power from the source supplying it and to do more mechanical
work.
Because the speed of rotation controls the ow of current in the
armature, special devices must be used for starting :G motors.
!hen the armature is at rest, it has virtually no resistance, and if
the normal working voltage is applied, a large current will ow,
which may damage the commutator or the armature windings.
The usual means of preventing such damage is the use of a
starting resistance in series with the armature to lower the
current until the motor begins to develop an adeuate backvoltage. As the motor picks up speed, the resistance is gradually
reduced, either manually or automatically.
The speed at which a :G motor operates depends on the strength
of the magnetic "eld acting on the armature, as well as on the
armature current. The stronger the "eld, the slower is the rate of
rotation needed to generate a back voltage large enough to
counteract the applied voltage. 3or this reason the speed of :G
motors can be controlled by varying the "eld current. -n this
pro$ect, the motor is used to control the sliding gate of the safe so
that it can be controlled via the microcontroller.
)ICROCONTRO%%ER UNT: A microprocessor is not a complete
computer. -t does not contain large amounts of memory or have
the ability to communicate with input devicesRsuch as
keyboards, $oysticks, and miceRor with output devices, such as
monitors and printers. A di1erent kind of integrated circuit, a
8/10/2019 Electronic Safe2
22/50
microcontroller, is a complete computer on a chip, containing all
of the elements of the basic microprocessor along with other
specialied functions. 5icrocontrollers are used in video games,
videocassette recorders >PG=s?, automobiles, and other
machines.-n this design the microcontroller unit forms the core of
the system meaning that all necessary mathematical and logical
operation of the system is executed here. -ts function spans
from7 checking the keyboard in order to ascertain if there is a
valid data, outputs the current state of the internal database unto
the display, checks for error, checks for multiple entry, verify userpasswords and functions that panders to the function of the
system.
;ow does microcontroller operateS
%ven though there is a great number of various microcontrollers
and even greater number of programs designed for the
microcontrollers use only, all of them have many things in
common. That means that if you learn to handle one of them you
will be able to handle them all. A typical scenario on whose basis
it all functions is as follows0
&. Nower supply is turned o1 and everything is so stillchip is
programmed, everything is in place, and nothing indicates
what is to come
F. Nower supply connectors are connected to the power supply
source and everything starts to happen at high speedQ The
control logic registers what is going on "rst. -t enables only
8/10/2019 Electronic Safe2
23/50
uart oscillator to operate. !hile the "rst preparations are
in progress and parasite capacities are being charged, the
"rst milliseconds go by.
H. Poltage level has reached its full value and freuency of
oscillator has become stable. The bits are being written to
the 23=s, showing the state of all peripherals and all pins are
con"gured as outputs. %verything occurs in harmony to the
pulses rhythm and the overall electronic starts operating.
2ince this moment the time is measured in micro and
nanoseconds.I. Nrogram Gounter is reset to ero address of the program
memory. -nstruction from that address is sent to instruction
decoder where its meaning is recognied and it is executed
with immediate e1ect.
M. The value of the Nrogram Gounter is being incremented by &
and the whole process is being repeated...several million
times per second.
8/10/2019 Electronic Safe2
24/50
DECRETE CO)PONENTS DESCRIPTION
RESISTOR
=esistors are one of the most common components in an
electronic circuit. The basic operation is to limit the ow of current
in the circuit. 5any resistor values were used in this pro$ect. 2ome
of them include &DU, &CkU, &CCU and the HHCU used to limit the
current that ows to the seven segment display.
Ho( to read Re#!#tor Co1or Code#
B1ac
k
Bro(
n
Re
d
Orang
e
0e11o
(
9ree
n
B1u
e
*!o1e
t
9re
2
+h!t
e
. / , 4 5 7 ; 6
8/10/2019 Electronic Safe2
25/50
3irst "nd the tolerance band, it will typically be gold >MV? and
sometimes silver >&CV?. 2tarting from the other end, identify the
"rst band # write down the number associated with that color7 in
this case Brown is &. @ow 4read4 the next color, here it is Black so
write down a 4C4 next to the six. >you should have 4&C4 so far.? @ow
read the third or 4multiplier exponent4 band and write down that
as the number of eros. -n this example it is two so we get 4&CCC4.
-f the 4multiplier exponent4 band is Black >for ero? don4t write any
eros down.
-f the 4multiplier exponent4 band is 9old move the decimal point
one to the left. -f the 4multiplier exponent4 band is 2ilver move the
decimal point two places to the left. -f the resistor has one more
band past the tolerance band it is a uality band.
BS /6, Cod!ng for re#!#tor "a1ue#
British 2tandard &)MF?. The letter = is used for
Ohms and D for Dohms 5 for 5egohms and placed where the
decimal point would go.
At the end is a letter that represents tolerance !here 5WFCV,
DW&CV, WMV, 9WFV, and 3W&V :W.MV GW.FM BW.&V
&!g /-5=esistor color code
8/10/2019 Electronic Safe2
26/50
CAPACITOR
Gapacitors store electric charge. They are used with resistors in
timing circuits because it takes time for a capacitor to "ll with
charge. They are used to smooth varying :G supplies by acting as
a reservoir of charge. They are also used in "lter circuits because
capacitors easily pass AG >changing? signals but they block :G
>constant? signals. There are many types of capacitor but they
can be split into two groups, polaried and unpolarised. %ach
group has its own circuit symbol.
E1ectro12t!c Capac!tor#
%lectrolytic capacitors are polaried and they must be connectedthe correct way round, at least one of their leads will be marked X
or #. They are not damaged by heat when soldering.
There are two designs of electrolytic capacitors7 axial where the
leads are attached to each end >FFCY3 in picture? and radial
where both leads are at the same end >&CY3 in picture?. =adial
capacitors tend to be a little smaller and they stand upright on
the circuit board. -t is easy to "nd the value of electrolytic
capacitors because they are clearly printed with their capacitance
and voltage rating. The voltage rating can be uite low >(P for
&!g /-%lectrolytic
8/10/2019 Electronic Safe2
27/50
example? and it should always be checked when selecting an
electrolytic capacitor.
Nonpo1ar!=ed capac!tor#
2mall value capacitors are nonpolaried and may be connected
either way round. They are not damaged by heat when soldering,
except for one unusual type >polystyrene?. They have high
voltage ratings of at least MCP, usually FMCP or so. -t can be
di6cult to "nd the values of these small capacitors because there
are many types of them and several di1erent labeling systemsQ
5any small value capacitors have their value printed but without
a multiplier, so you need to use experience to work out what the
multiplier should be. 3or example C.& means C.&Y3
TRANSISTORS
Transistors are made from semiconductors. These are materials,
such as silicon or germanium, that are *doped+ >have minute
amounts of foreign elements added? so that either an abundance
or a lack of free electrons exists. -n the former case, thesemiconductor is called n#type, and in the latter case, p#type. By
combining n#type and p#type materials, a diode can be produced.
!hen this diode is connected to a battery so that the p#type
material is positive and the n#type negative, electrons are
&!g /-7 @onpolaried Gapacitors
8/10/2019 Electronic Safe2
28/50
repelled from the negative battery terminal and pass unimpeded
to the p#region, which lacks electrons. !ith battery reversed, the
electrons arriving in the p#material can pass only with di6culty to
the n#material, which is already "lled with free electrons, and the
current is almost ero.
The bipolar transistor was invented in &KI) as a replacement for
the triode vacuum tube. -t consists of three layers of doped
material, forming two p#n >bipolar? $unctions with con"gurations of
p#n#p or n#p#n. One $unction is connected to a battery so as to
allow current ow >forward bias?, and the other $unction has abattery connected in the opposite direction >reverse bias?. -f the
current in the forward#biased $unction is varied by the addition of
a signal, the current in the reverse#biased $unction of the
transistor will vary accordingly. The principle can be used to
construct ampli"ers in which a small signal applied to the forward#
biased $unction causes a large change in current in the reverse#
biased $unction.
Another type of transistor is the "eld#e1ect transistor >3%T?. 2uch
a transistor operates on the principle of repulsion or attraction of
charges due to a superimposed electric "eld. Ampli"cation of
current is accomplished in a manner similar to the grid control of
a vacuum tube. 3ield#e1ect transistors operate more e6ciently
than bipolar types, because a large signal can be controlled by a
very small amount of energy.
8/10/2019 Electronic Safe2
29/50
Transistors function ma$orly as switch or ampli"ers. To function as
a switch, the transistor has to be biased into saturation i.e. the
base voltage exceeds C.'v for silicon type and C.Hv for
germanium type. On the other hand, the base voltage can be
varied continually by an input signal for the transistor to function
as an ampli"er. The transistors in this circuit are all 3ield %1ect
Transistors >3%T? and they function as high speed switches.
DIODE
This is an electronic device that allows the passage of current in
only one direction. The "rst such devices were vacuum#tube
diodes, consisting of an evacuated glass or steel envelope
containing two electrodesRa cathode and an anode. Because
electrons can ow in only one direction, from cathode to anode,
the vacuum#tube diode could be used as a recti"er. The diodes
most commonly used in electronic circuits today are
semiconductor diodes. The simplest of these, the germanium
point#contact diode, dates from the early days of radio, when the
received radio signal was detected by means of a germanium
crystal and a "ne, pointed wire that rested on it. -n modern
germanium >or silicon? point#contact diodes, the wire and a tiny
crystal plate are mounted inside a small glass tube and connected
to two wires that are fused into the ends of the tube.
8/10/2019 Electronic Safe2
30/50
S+ITCHES AND PUSHBUTTONS
There is nothing simpler than thisQ This is the simplest way of
controlling appearance of some voltage on microcontrollers input
pin. There is also no need for additional explanation of how these
components operate.
@evertheless, it is not so simple in practice... This is about
something commonly unnoticeable when using these components
in everyday life. -t is about contact bounce# a common problem
with mechanical switches. -f contact switching does not happen so
uickly, several consecutive bounces can be noticed prior to
maintain stable state. The reasons for this are0 vibrations, slight
rough spots and dirt. Anyway, whole this process does not last
long >a few micro# or milliseconds?, but long enough to be
registered by the microcontroller. Goncerning pulse counter, error
occurs in almost &CCV of casesQ
8/10/2019 Electronic Safe2
31/50
The simplest solution is to connect simple =G circuit which will
*suppress+ each uick voltage change. 2ince the bouncing time is
not de"ned, the values of elements are not strictly determined. -n
the most cases, the values shown on "gure are su6cient.
*EROBOARD
This work completed by using a Peroboard to assemble the above
explained electronic components. The process described below
was taken, to prepare the Peroboard.
9rab a very sharp craft knife and a ruler. On the track side of theboard, count IC complete holes along a track, then place the ruler
perpendicular to the tracks on the next hole.
@ow turn the board over, and repeat the operation in exactly the
same place on the component side. Nick up the board and snap it
with both hands, keeping your "ngers close to the score mark oneither side # it should break evenly, leaving you with two
rectangular pieces. @ow >if the board is too wide? do the same
thing again, but along the tracks. Gount HK tracks from the edge
then lay your ruler along the ICth track and score through the
8/10/2019 Electronic Safe2
32/50
holes on that track. :o the same on the other side, then snap. -f
all went well, you should now have a piece of Peroboard of the
correct sie # HK tracks by IC holes.
In#pect the track#
Pery occasionally, a piece of Peroboard will have defects such as
small splashes of copper bridging ad$acent tracks. -nspect the
board carefully to make sure there are no such bridges. -f you do
"nd one, run your knife between the tracks in order to cut it.
%I9HT>E)ITTIN9 DIODE ?%ED@Jight#emitting diodes are elements for light signaliation in
electronics. They are manufactured in di1erent shapes, colors and
sies. 3or their low price, low consumption and simple use, they
have almost completely pushed aside other light sources# bulbs at
"rst place. They perform similar to common diodes with the
di1erence that they emit light when current ows through them.
-t is important to know that each diode will be immediately
destroyed unless its current is limited. This means that a
conductor must be connected in parallel to a diode. -n order to
correctly determine value of this conductor, it is necessary to
8/10/2019 Electronic Safe2
33/50
know diodes voltage drop in forward direction, which depends on
what material a diode is made of and what colour it is. Palues
typical for the most freuently used diodes are shown in table
below0 As seen, there are three main types of J%:s. 2tandard
ones get full brightness at current of FCmA. Jow Gurrent diodes
get full brightness at ten times lower current while 2uper Bright
diodes produce more intensive light than 2tandard ones.
Co1or T2peT2p!ca1current Id?$A@
)a8!$a1current If ?$A@
*o1tage dropUd ?*@
-nfrared # HC MC &.I
=ed 2tandard FC HC &.'
=ed 2uper Bright FC HC &.)M
=ed Jow Gurrent F HC &.'
Orange # &C HC F.C
9reen Jow Gurrent F FC F.&
8ellow # FC HC F.&
Blue # FC HC I.M
!hite # FM HM I.I
2ince the )CM& microcontrollers can provide only low input current
and since their pins are con"gured as outputs when voltage level
on them is eual to C, direct connecting to J%:s is carried out as
8/10/2019 Electronic Safe2
34/50
it is shown on "gure >Jow current J%:, cathode is connected to
output pin?.
CHAPTER &OUR
DESI9NIN9 AND I)P%E)ENTATION O& E%ECTRONIC SA&E
The basic feature of any electronic safe is its ability to read an
input information via a medium such as a keypad, then operate
an electronic door to grant access to a particular environment. A
simple circuit to achieve this is illustrated below7
8/10/2019 Electronic Safe2
35/50
This circuit is designed to operate an electrical door#release
mechanism which can be incorporated to an electronic safe. To
open or release the door, %nter the four#digit code of your choice #
and the relay will energie for the period of time set by GI Z =I.
8/10/2019 Electronic Safe2
36/50
8/10/2019 Electronic Safe2
37/50
Any keys not wired to /A B G Z :/ are connected to the base of
LF. !henever one of these /!rong/ keys is pressed # LF takes pin
& low and the code entry fails. 2imilarly, if /G/ or /:/ is pressed
out of seuence # LI or LH will take pin & low and the code entry
will fail. -f you make a mistake while entering the code # simply
start again.
The Deypad must be the kind with a common terminal and a
separate connection for each key. On a &F#key pad, look for &H
terminals. The matrix type with ' or ) terminals will @OT do. A &F#key pad has eight /!rong/ keys connected to /%/. -f you need a
more secure code # use a bigger keypad with more /!rong/ keys.
Below is a veroboard layout of the above circuit diagram7
8/10/2019 Electronic Safe2
38/50
THE )ICROCONTRO%%ER E%ECTRONIC SA&E5icrocontroller based electronic safe is considered as one of the
best security that you can use for keeping your valuables. An
electronic safe in its basic form is a thick steel box with a thickersteel door. The door closes on to the box with a solid steel bolt.
The bolt may be operated by a knob. A sample electronic safe
interface is shown in 3ig & below.
A keypad is reuired to enter the unlocking code as are a couple
of J%:s to display output and serve as the -O interface. A
mechanical key is provided with many safes for emergency
access when the electronic code is forgotten.
Additional features provided on most electronic safes are low
battery warning, freee on repeated wrong electronic code entry,
and long bu on entering the wrong electronic code. %lectronic
safes are common in hotels as they provide the ability to set and
reset the electronic code for each new guest.
&!g /- E%ock U#er Interface
U#age Scenar!o#
2imple scenarios to describe the operation of an electronic safe
are given below0
8/10/2019 Electronic Safe2
39/50
%ock the E1ectron!c Safe-The mechanical knob turned to put
the steel bolt into position and lock the door. The cam mechanism
would be such that turning the knob in the opposite direction is
not going to engage the electronic safe>&!g , e1o(@.
&!g ,- %ock!ng the E1ectron!c Safe
Un1ock the E1ectron!c Safe-The user shall input the electronic
code on the keypad to unlock the electronic safe. On every key
press, a short beep is generated to provide audio feedback to the
user to con"rm that the key was accepted.
-f the user enters a wrong electronic code, then the *%==+ J%:
will light#up to indicate that the code was wrong. A sharp bu is
generated to make this evident to the end user. =epeated wrong
entry will lock the keypad and the electronic safe. The emergency
key must be used to unlock the safe and the electronic code has
to be reset as described below.
8/10/2019 Electronic Safe2
40/50
Batter2 D!#charge Cond!t!on- -n case the battery is discharged
completely, the bolt will lock permanently and the emergency key
has to be used to unlock the safe. The *BAT+ J%: will switch on
when the battery is less than a particular level to alert the user to
change the battery.
E1ectron!c Code %o#t- -n case the electronic code is lost, then
the emergency key can be used to unlock the safe.
SetRe>#et E1ectron!c Code- The feature to set or reset the
electronic code will be available only when the safe is open. A
seuence of key presses can open up the microcontroller to set
the new electronic code. The microcontroller saves the electronic
code into its nonvolatile memory.
I$p1e$entat!on of a #afe de#!gn
%arly electronic safe designs used hardware circuits employing
counters to determine the right electronic code. Jater designs
have been based on microcontrollers because of the exibility
o1ered by microcontrollers and software programming.
A block diagram of a microcontroller#based design is shown in 3ig
H below. -t consists of a microcontroller and a motor that is
8/10/2019 Electronic Safe2
41/50
powered by the battery. The microcontroller takes inputs via the
keypad and, depending upon the code, will trigger the motor and
the door lock mechanism to move the cam and turn the bolt.
J%:s are triggered based on microcontroller status, battery
condition, and any error while reading the code. An optical ob$ect
sensor is used to detect the condition of the door.
)echan!ca1 Con#truct!on-
Although this is an article on electronics for electronic safe, thesingle biggest consideration for a good and reliable safe is its
mechanical construction. The electronics Nrinted Gircuit Assembly
>NGA? should be behind the solid steel structure.
Any attempt to force open via the front panel through the keypad
should make the contents of the safe accessible. One possible
option is to separate the NGA from the keypad. The NGA should be
behind a solid steel structure while the keypad should be on the
front of the door.
Po(er Ec!enc2-
Nower consumption is the second most important aspect of an
electronic safe. Parious designs can be implemented to save
power such as the use of deep sleep if there is no input from the
keypad for a speci"ed period of time.
8/10/2019 Electronic Safe2
42/50
A microcontroller that operates in a wide operating range will help
to sustain long operation across battery discharges.
8/10/2019 Electronic Safe2
43/50
One T!$e Progra$$a1e ?OTP@ )CU- -t is advantageous to
choose a microcontroller with OTN features to prevent reverse
engineering of the "rmware by competitors and hackers.
Hard(are Re1!a!1!t2
2teps to control and be immune to electromagnetic interference
should be implemented as in any embedded system where
sensitive electronics are next to a potential noise source such as a
motor. ;ardware that is not reliable may reset and result in a
vulnerable safe.
The less hardware components there are, the fewer components
that can fail and the greater the system reliability. 3ewer
components will also lower power consumption. 2ystem on Ghip
>2oG? microcontrollers can be used to integrate many hardware
functions to reduce component count, which in turn increases
reliability, decreases power consumption, and reduces cost.
A Nrogrammable 2ystem on Ghip >PSoC? can do power
measurement using internal comparators and Analog to :igital
Gonverters >A:G?. A buer can be controlled using Nulse !idth
5odulation >N!5? integrated on the 2oG.
Detect!ng Open Safe- 5any of the use scenarios reuire that
the "rmware detect whether the safe is open. An optical sensor
http://www.cypress.com/?id=1353http://www.cypress.com/?id=13538/10/2019 Electronic Safe2
44/50
can be used to detect that the door is open. The optical sensor is
controlled by the microcontroller to determine this condition.
U#er procedure# and u!1t>!n #e1f>te#t ?BIST@-
A clear procedure for changing batteries is needed as the user
may have to change batteries during the lifetime of the safe and
may not have access to the safe manual. Built#in 2elf Test
capabilities can run through all the interfaces of the board to
ensure there is no fault after the replacement of the battery.
)anufactur!ng.
Jast but not the least is the challenge to program the electronic
safe with "rmware and later run manufacturing test to ensure that
all the blocks operate as expected and the unit is free of any
manufacturing defects.
To ensure that there is no fraud by the contract manufacturer, a
programming $ig with authentication may have to be
implemented. The manufacturing test procedure should ensure it
covers &CCV of the hardware.
%!$!tat!on# and (hat cou1d e !$pro"ed-
&a!1ure Ana12#!# on Returned )ater!a1-
-ncreasing the number of interfaces on the board is going to
increase the number of ways that an intruder can create havoc on
8/10/2019 Electronic Safe2
45/50
8/10/2019 Electronic Safe2
46/50
CIRCUIT DIA9RA) &OR A )ICROCONTRO%%ER BASEDE%ECTRONIC SA&E
U1
LM555CN
9@:
&
:- 2'
O
8/10/2019 Electronic Safe2
47/50
The keypad comprises of eleven >&&? bottoms
*&,F,H,I,M,(,',),K enter, =eset+ micro switches are used in
the keypad for soft press execution, total wires from the
keypad are &F in numbers *&,F,H,I,M,(,',),K %nter, =eset
and ground >earthing?, -c& >'I&I)? is an encoder which
encode every key that is been pressed in the keypad, ) lines
to H lines are A,B,G -GF >'I&C? is an decoder which decodes
every data from the ) to H line encoder into & bit, the output
from -GF is forward bias into LF, =M limit the excess current
from -GF, -GH is an astable multivibrator which oscillates at afreuency H(D;\ of transmission. =H =I and G& form the
freuency of oscillation whereby oscillating at H(D;\, pin is
the outputted oscillation, =& limits the amount of current
owing into L& at that instance the infra#red goes into
conduction thereby transmitting waves at higher freuency,
-GH is a carrier wave, the voltage from the keypad to -G& and
-GF are the modulating signal wave.
!hen the keypad at the actual code is been keyed the data
modulates through LF, -GH carrier the modulating signal
down to the infra#red receiver at a freuency of H(D;\,
when transmission is been done the infra#red receiver act as
a photo transistor thereby going into conduction acting as a
sink or an ampli"er, =' is a load resistance that act as a
load to the infra#red receiver from the PGG, -GI is a
processor which decode the input transmission data from the
infra#red transmitter crystal oscillator is connected to -cI pin
8/10/2019 Electronic Safe2
48/50
&M and &( causing oscillation in the processor, at the
instance pin ) and && goes into conduction LH and LI are
forward bias, which also act as a sink or an ampli"er thereby
"ring the relay & and relay F at this point the motor turns
clockwise thereby opening the electronic safe, when the
keypad is pressed again the same process ow into the
transmitter and the receiver, -GF decodes the button from
the keypad LH and LI are forward bias "ring the relay into
conduction, the motor turns anti#clockwise the door of the
safe is closed. The opening and closing of the safe depends on the actual
key or code that is being press in the keypad which is being
decoded by -GI, that makes the motor to turn clockwise or
anti#clockwise. !hen the wrong code is pressed transmission
of data takes place, -GI decodes the wrong transmission
which is being transmitted from the transmitter, LH and LI
are reverse bias thereby the motor of the safe remains still
>there is no conduction?
8/10/2019 Electronic Safe2
49/50
CHAPTER &I*E
CONC%USION AND RECO))ENDATION
-n conclusion we can be say that the microcontroller based
electronic safe ensures safety in a particular area where it is
applied. The main brain of this circuit which is the micro controller
reduces the number of component reuired to carryout complex
functions in the construction of this pro$ect. -f a right code is
keyed in, it will grant the access and the safe will automatically
open. But if wrong, it will deny the access and the safe will not
open.
RECO))ENDATION
-t is hereby recommended that this design be employed in
carrying out electronic safe pro$ects including banking safe,
temporarily store cash, industrial places, in a hotel rooms for safe
8/10/2019 Electronic Safe2
50/50
keeping and auditorium o6ces. -t provides users with a secure,
convenient and cost e1ective way of locking safe. -t is further
suggested that the department should allocate pro$ects at the
beginning of the semester to enable the students source for fund
and other things that can help them carry out their pro$ects.