Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Bank Security System

By Nayan Trivedi, Bhavnagar, India July 4, 2011

[[wysiwyg_imageupload:1549:]]Mr. Nayan Trivedi is an Electronics & Communication Engineer. He studied at Shantilal Shah Engineering College, Sidsar Campus,Bhavnagar.


BACKGROUND

One day at the evening time I was talking with my uncle on telephone. He asked me some question base on my learning means what are you learning? which type of engineering are you doing? He ask me that have you made something new during your engineering? That time I don’t have any answer. But the time comes in final year. He is officer in bank . once he told me that because of one rap our security system break and because of that I have to go there at night. Can u prevent this and can make the system batter than this?.that day I have decided to make security system of bank which is more reliable than this one. We have combine all type of security system in this one. You can secure all type of security which is useful for one organization. Simply anyone can say that project of 50$ can prevent more than 50000$..!!!!
 
INTRODUCTION
We are going to make a that project which every one required. Now days it is very important to prevent bank from thief. We are saving our money in bank so it is equally important to save bank from thief. Now, day by day the number of larceny is increasing so it is very important to prevent bank from burglar. This BSS saves your bank from burglar. This circuit can prevent bank from thief. MSG automatically sent when any thief came into your bank or they try to break lock of your Locker. Can you ever imagine that you are getting MSG about your bank security!!
 
 

 

Description                                                                             

MICROCONROLLER

Basically used for control actions.It is used to control the operation of machine using fixed program that is stored in ROM/EPROM and that does not change over the life time. 

BSS
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 Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications
BSS2
 The 3310 is a compact but somewhat heavy (133 g) phone featuring an 84 x 48 monochrome display. It has a lighter 115 g battery variant which has fewer features; for example the 133g battery version has the start-up image of two hands touching while the 115 g version doesn’t. It is a slightly rounded rectangular unit that is typically held in the palm of a hand, with the buttons operated with the thumb. The blue button is the main button for selecting options, with “C” button as a “back” or “undo” button. Up and down buttons are used for navigation purposes. The on/off/profile button is a stiff black button located on the top of the phone. It has a very sturdy design which was a big contribution for its success. However, radiation is high with SAR = 0.96 W/kg.

 

Sensor

1.      Infrared sensor       

BSS5

Infrared (IR) radiation is part of the electromagnetic spectrum,which includes radio waves, microwaves, visible light, and ultraviolet light, as well as gamma rays and X-rays. The IR range falls between the visible portion of the spectrum and radio waves. IR wavelengths are usually expressed in microns, with the lR spectrum extending from 0.7 to 1000 microns. Only the 0.7-14 micron band is used for IR temperature measurement. Using advanced optic systems and detectors, noncontact IR thermometers can focus on nearly any portion or portions of the0.7-14 micron band. Because every object (with the exception of a blackbody) emits an optimum amount of IR energy at a specific point along the IR band, each process may require unique sensor models with specific optics and detector types.
Working of IR Sensor:
The basic idea is to send infra red light through IR-LEDs, which is then reflected by any object in front of the sensor.
Then all you have to do is to pick-up the reflected IR light. For detecting the reflected IR light, we are going to use a very original technique: we are going to use another IR-LED, to detect the IR light that was emitted from another led of the exact same type!
This is an electrical property of Light Emitting Diodes (LEDs) which is the fact that a led Produce a voltage difference across its leads when it is subjected to light. As if it was a photo-cell, but with much lower output current. In other words, the voltage generated by the leds can’t be – in any way – used to generate electrical power from light, It can barely be detected. that’s why Opams are mostly used for accurately detection of low voltages.
BSS6how the receiver of the sensor measures the distance of the intruding object:
As you know This is an electrical property of Photo Voltaic Cells(Light Emitting Diodes (LEDs)) which is the fact that a led Produce a voltage difference across its leads when it is subjected to light. So By using this property you can measure the distance of an object
The output of these sensor is in Analog voltage format. It varies from Distance from Object. So you can interface it with an ADC and then read this analog voltage by using micro controller and calibrate it into any scale.
for more details visit the link given bellow which can five you an idea how to interface sharp sensor with Micro controller.
Advantages of IR Sensor:
1. Easily available in Market.
2. Easy to interface.
Disadvantages of IR Sensor:
1. Higly influenced by Environmental Noises like Ambient light, radiations etc.

 

2.      Audio sensor BSS7

 

Audio sensor
 
The sound level channel works over the 55dB to 100dB range (approximately from quiet conversation to a loud motorcycle). The human ear does does not respond equally to all frequencies (it peaks at about 3kHz which corresponds to a baby crying). To allow for this non linearity, sound level has been ‘A-Law’ weighted to approximately match the response of the human ear. Typical uses for this channel include.
3. LDR:- BSS7
A or light dependent resistor or cadmium sulphide (CdS) cell is a resistor whose resistance decreases with increasing incident light intensity. It can also be referred to as a photoconductor.
A photo resistor is made of a high resistance semiconductor. If light falling on the device is of high enough frequency, photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band. The resulting free electron (and its hole partner) conduct electricity, thereby lowering resistance.
A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor has its own charge carriers and is not an efficient semiconductor, e.g. silicon. In intrinsic devices the only available electrons are in the valence band, and hence the photon must have enough energy to excite the electron across the entire band gap. Extrinsic devices have impurities, also called do pants, added whose ground state energy is closer to the conduction band; since the electrons do not have as far to jump, lower energy photons (i.e., longer wavelengths and lower frequencies) are sufficient to trigger the device. If a sample of silicon has some of its atoms replaced by phosphorus atoms (impurities), there will be extra electrons available for conduction. This is an example of an extrinsic semiconductor.
 

 

 

SWITCH: 

 

In electronics, a switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another.[1][2] The most familiar form of switch is a manually operated electromechanical device with one or more sets of electrical contacts. Each set of contacts can be in one of two states: either ‘closed’ meaning the contacts are touching and electricity can flow between them, or ‘open’, meaning the contacts are separated and nonconducting.
A switch may be directly manipulated by a human as a control signal to a system, such as a computer keyboard button, or to control power flow in a circuit, such as a light switch. Automatically-operated switches can be used to control the motions of machines, for example, to indicate that a garage door has reached its full open position or that a machine tool is in a position to accept another workpiece. Switches may be operated by process variables such as pressure, temperature, flow, current, voltage, and force, acting as sensors in a process and used to automatically control a system. For example, a thermostat is a temperature-operated switch used to control a heating process. A switch that is operated by another electrical circuit is called a relay. Large switches may be remotely operated by a motor drive mechanism. Some switches are used to isolate electric power from a system, providing a visible point of isolation that can be pad-locked if necessary to prevent accidental operation of a machine during maintenance, or to prevent electric shock.
In the simplest case, a switch has two conductive pieces, often metal, called contacts that touch to complete (make) a circuit, and separate to open (break) the circuit. The contact material is chosen for its resistance to corrosion, because most metals form insulating oxides that would prevent the switch from working. Contact materials are also chosen on the basis of electrical conductivity, hardness (resistance to abrasive wear), mechanical strength, low cost and low toxicity.
Sometimes the contacts are plated with noble metals. They may be designed to wipe against each other to clean off any contamination. Nonmetallic conductors, such as conductive plastic, are sometimes used.

 

Toggle switch
A toggle switch is a class of electrical switches that are manually actuated by a mechanical lever, handle, or rocking mechanism.

 

Toggle switches are available in many different styles and sizes, and are used in countless applications. Many are designed to provide, e.g., the simultaneous actuation of multiple sets of electrical contacts, or the control of large amounts of electric current or mains voltages.
The word “toggle” is a reference to a kind of mechanism or joint consisting of two arms, which are almost in line with each other, connected with an elbow-like pivot. However, the phrase “toggle switch” is applied to a switch with a short handle and a positive snap-action, whether it actually contains a toggle mechanism or not.

 

Toggle switch: 

 

 

A toggle switch is a class of electrical switches that are manually actuated by a mechanical lever, handle, or rocking mechanism.
Toggle switches are available in many different styles and sizes, and are used in countless applications. Many are designed to provide, e.g., the simultaneous actuation of multiple sets of electricalcontacts, or the control of large amounts of electric current or  mains voltages. 

 

·         Max 232

 

BSS8

 

DESCRIPTION
MAX232 is compatible with RS-232 standard, and consists of dual transceiver. Each receiver converts TIA/EIA-232-E levels into 5V TTL/CMOS levels. Each driver converts TTL/COMS levels into TIA/EIA-232-E levels. The MAX232 is characterized for operation from -40C to +85C for all packages.
MAX232 is purposed for application in high-performance information processing systems and control devices of wide  application.
APPLICATION: 
Battery-Powered RS232 Systems
Terminals
Modems  
Computers
 
·         POWER SUPPLY:
BSS9 
This circuit is a small +5V power supply.The circuit will provide a regulated voltage to the external circuit which may also I am required in any part of the external circuit or the whole external circuit.The best part is that you can also use it to convert AC voltage to DC and then regulate it ,simlpy You need a transformer to make the AC main drop down to a safe value i.e 12-15 volts and then us a rectifier to convert AC into DC.
This circuit can give +5V output at about 150 mA current, but it can be increased to 1 A when good cooling is added to 7805 regulator chip. The circuit has over overload and therminal protection. The capacitors must have enough high voltage rating to safely handle the input voltage feed to circuit. The circuit is very easy to build for example into a piece of veroboard.
If you need other voltages than +5V, you can modify the circuit by replacing the 7805 chips with another regulator with different output voltage from regulator 78xx chip family. The last numbers in the the chip code tells the output voltage. Remember that the input voltage muts be at least 3V greater than regulator output voltage ot otherwise the regulator does not work well.
Dont forget to check the pin diagram before connecting the IC.

Working of the system

 

WORKING
 Most Nokia phones have F-Bus and M-Bus connections that can be used to connect a phone to a PC or in our case a microcontroller. The connection can be used for controlling just about all functions of the phone, as well as uploading new firmware etc. This bus will allow us to send and receive SMS messages.

 

The very popular Nokia 3310/3315 has the F/M Bus connection under the battery holder. This is a bit of a pain to get to and requires a special cable to make the connection. The left picture above shows the 4 gold pads used for the F and M Bus. The right picture shows the F-Bus cable connected to my Nokia 3310.
BSS10
Nokia download cables are available from most mobile phone shops and some electronics stores. The cable contains electronics to level convert 3V signals to RS232 type signals.
M-Bus is a one pin bi-directional bus for both transmitting and receiving data from the phone. It is slow (9600bps) and only half-duplex. Only two pins on the phone are used. One ground and one data. M-Bus runs at 9600bps, 8 data bits, odd parity, one stop bit. The data terminal ready (DTR) pin must be cleared with the request to send (RTS). This powers the electronics in the cable and I think it sets it for M-Bus operation.
F-Bus is the later high-speed full-duplex bus. It uses one pin for transmitting data and one pin for receiving data plus the ground pin. Very much like a standard serial port. It is fast 115,200bps, 8 data bits, no parity, one stop bit. For F-Bus the data terminal ready (DTR) pin must be set and the request to send (RTS) pin cleared.
The F-Bus is bi-directional serial type bus running at 115,200bps, 8 data bits. The serial cable contains electronics for level conversion and therefore requires power. The first thing to do is supply power to the cable electronics and this is done by setting the DTR (Data Terminal Ready) pin and clearing the RTS (Request to Send) pin.
whenever anyone try to get into your home you will get SMS in your mobile like “someone is trying to open your door (or window or locker)”.we have put IR sensor And 4 different sensors at different place(in prototype) and it will send command to Microcontroller. Microcontroller will send command to Mobile and that mobile will send SMS to your mobile, msg contain exact location of thief and msg would be continues tracking location of thief and send SMS to user. In “SAFE mode” when thieves will break your locker at that time police officer will get location of your Home. When you will reply with “LOCK” your home will became locked (In smart home) and thieves will be trap in your home. You also you reset whole security system by one SMS from remote place

 

 

How to send a SMS message with F-Bus?

Now that we know how to send frames on the bus, we should look at sending an SMS message. It is not a hard process, once you can pack the message into 7-bit characters!
 
Let’s say we want to decode the string ‘hello’. First I have displayed ‘hello’ in hexadecimal using the character map provided in GSM 03.38. For A to Z and numbers its just the standard ASCII conversion.
 
h            e             l             l             o             (ASCII characters)
68           65           6C           6C           6F           (In hexadecimal)
1101000 1100101 1101100 1101100 1101111 (In Binary)
When dealing with binary, it makes life easier to write everything backwards. The first byte in the string is on the right. The least significant bit is then displayed on the left with the most significant bit on the left. Shown below is the same string of ‘hello’ just displayed backwards. Then it’s just a matter to dividing the binary values into bytes starting with the first character in the string. (Start from right and go to left.) The first decoded byte is simply the first 7 bits of the first character with the first bit of the second character added to the end as shown below. The next decoded byte in then the remaining 6 bits from the second character with two bits of the third byte added to the end. This process just keeps going until all characters are decoded. The last decoded byte is the remaining bits from the last character with the most significant bits packed with zeros.
6F           6C           6C           65           68
1101111 1101100 1101100 1100101 1101000 (The ASCII characters shown in binary)
 
110 11111101 10011011 00110010 11101000 (The above binary just split into 8 bit segments)
06          FD          9B           32           E8           (The 8 bit segments decoded into hex)
The message hello is therefore E8 32 9B FD 06 when packed.
When playing with sending SMS messages a lot of decoding is required. Therefore I wrote a few small programs to automatically pack and unpack the data for me. The first program allows me to input the string to be packed in the top memo box and when the button ‘Pack’ is pressed the top string is packed ready to go!
 BSS11
This program below, will both unpack and then pack the message. It was used to read the packed messages from my serial protocol analyzer. It also tests my subroutines in C for both pack and unpack. Already for my AT90S8535 microcontroller!
 BSS12

 

frame sent to my Nokia 3310 (showed as a Hex dump) 98 Bytes:

1E 00 0C 02 00 21 00 01 00 01 02 00 0A 91 89 25 00 01 20 00 00 00 15 00 00 00 24 0A 91 49 62 95 22 68 00 00 00 00 A7 00 00 00 00 00 00

 

41 66 51 4A 05 E9 40 49 29 68 5A 1C 56 A5 49 6A 16 84 0C 4E 41 C2 62 D1 09 12 4A 8B C1 65 91 D8 50 00 43 00 xx xx

 

F-Bus Frame Header
Byte 0: F-Bus Frame ID. We are on Cable (0x1E)
Byte 1: Destination address.
Byte 2: Source address.
Byte 3: Message Type or ‘command’. 0x02 (SMS Handling).
Byte 4 & 5: Message length. In our case it is 0x0021 bytes long or 83 bytes in decimal.
(SMS) Short Message Service Frame Header
Byte 6 to 8: Start of the SMS Frame Header. 0x00, 0x01, 0x00
Byte 9 to 11: 0x01, 0x02, 0x00 = Send SMS Message

 

(SMSC) Short Message Service Centre (12 Bytes)
Byte 12: SMS Centre number length. 0x07 is 7 bytes long. This includes SMSC Number Type and SMS Centre Phone Number
Byte 13: SMSC number type e.g. 0x81-unknown 0x91-international 0xa1-national

Byte 14 to 23: (Octet format) SMS Centre Phone Number In this case +9825001002

(TPDU) Transfer Protocol Data Unit
Byte 24: Message Type

XXXX XXX1 = SMS Submit – The short message is transmitted from the Mobile Station (MS) to the Service Centre (SC).
XXXX XXX0 = SMS Deliver – The short message is transmitted from the SC to the MS.
 

In our case it is 0x15 = 0001 0101 in binary. The message is SMS Submit, Reject Duplicates, and Validity Indicator present.

Byte 25: Message Reference if SMS Deliver & Validity Indicator used (Not used in this case).
Byte 26: Protocol ID. Refer to GSM 3.40 – 9.2.3.9 TP-Protocol-Identifier (TP-PID)
Byte 27: Data Coding Scheme.
Byte 28: Message Size is 0x33 in hex or 51 bytes long in decimal. This is the size of the unpacked message.

 
Destination’s Phone Number (12 Bytes)
Byte 29: Destination’s number length.
Byte 30: Number type e.g. 0x81-unknown 0x91-international 0xa1-national
Byte 31 to 40: (Octet format) Destination’s Phone Number
 
Validity Period (VP)
Byte 41: Validity-Period Code. Time period during which the originator considers the short message to be valid.
Byte 42 to 47: Service Centre Time Stamp 

 

The SMS Message (SMS-SUBMIT)

Byte 46 to78 : This is the SMS message packed into 7 bit characters. SMS Point-to-Point Character Packing .

 ("ALERT : IR SECURITY HAS BEEN BREAKED"
41 66 51 4A 05 E9 40 49 29 68 5A 1C 56 A5 49 6A 16 84 0C 4E 41 C2 62 D1 09 12 4A 8B C1 65 91 D8 50) 

Byte 79: Always 0x00
The F-Bus usual ending
Byte 80: Packet Sequence Number
Byte 81: Padding Byte – String is old and requires to be even!
Byte 82 & 83: Odd & even checksum bytes.

 

APPLICATION
·         It can be useful in every place where higher security is required.
·         It will provide high security in Bank, Our home.
·         Thief detection is very easy.
·         Simply this Project of $50 save your millions of $.  

 

 

 

Project Source Code

 

Project Source Code

###

PROGRAM

;-------------------------------------------------------------
;--------------------DECLARATION------------------------------

SEN_IR                      EQU P1.0                               ;IR input
SEN_LDR        EQU P1.1                                ;LDR input
SEN_AUD       EQU P1.2                                ;AUDIO input
SEN_FIRE       EQU P1.3                                ;TEMPERATURE SENSER input

SEL_SC                       EQU P1.4                                ;EN/DES serial communication
SEL_PORP      EQU P1.5                                ;selection Phone/PC
SEL_LED        EQU P1.6                                ;EN/DES LED
SEL_CHEAKMC EQU P1.7                            ;cheak microcontroller

LED_IR                       EQU P0.1                                ;IR output
LED_LDR       EQU P0.2                               ;LDR output
LED_AUD       EQU P0.3                                ;AUDIO output
LED_FIRE       EQU P0.4                                ;FIRE output

P1_BITS     EQU 20H
BIT_IR                        EQU    00                                            ;0 = IR OFF , 1 = IR ON
BIT_LDR                     EQU    01                                            ;0 = LDR OFF , 1 = LDR ON
BIT_AUD                    EQU    02                                            ;0 = AUD OFF , 1 = AUD ON
BIT_FIRE        EQU    03                                            ;0 = FIRE OFF , 1 = FIRE ON
BIT_SC                        EQU    04                                            ;0 = Serial Communication ON, 1 = Serial Communication OFF
BIT_PORP       EQU    05                                            ;0 = Phone in USE , 1 = PC in USE
BIT_LED                     EQU 06                                               ;0 = LED in USE , 1 = LED not in USE
BIT_CHEAKMC         EQU    07                                            ;0 = Do not CHEAK Microcontroller , 1 = CHEAK Microcontroller

BIT_PW                       EQU    08

PW_BITS                     EQU 22H                                          
;My actual idea is to set/reset bit after comparing pressed key and offset password.
;so at end of the routine i just need to cheak PW_BITS.if it's zero then pw is
;correct otherwise not.initially i set PW_BITS to FFH and then reset individual
;bits according to password.
                                                                                                                        
SIZE                EQU R0                                                                       
PW_REG_SEL             EQU    R1
D1                               EQU    R2
D2                               EQU R3
D3                               EQU R4
D4                               EQU    R5
;-------------------------------------------------------------
;----------------------PROGRAM-------------------------------
    ORG 0000H
            LJMP 05FFH

            ORG 0013H
            LJMP INT_ACCOR                 ;INT1 by Lead Per Key Keypad
;----------------------------------------------------------------
;--------------------DATA SECTION-------------------------------

                                    ORG 0039H
SIZE_PW:        DB       08H                 ;Size of DATA_PW
                                    ORG 0040H
DATA_PW:     DB  '1','7','2','9','2','5','1','9'        ;Predefined Password

                                    ORG 00FFH
SIZEC_IR:       DB       53H                 ;Size of DATAC_IR
                                    ORG 0100H
DATAC_IR:    DB            1EH,00H,0CH,02H,00H,21H,00H,01H,00H,01H,02H,00H,0AH,91H,89H,25H,00H,01H,20H,00H,00H,00H,15H,00H,00H,00H,24H,0AH,91H,49H,62H,95H,22H,68H,00H,00H,00H,00H,0A7H,00H,00H,00H,00H,00H,00H,41H,66H,51H,4AH,05H,0E9H,40H,49H,29H,68H,5AH,1CH,56H,0A5H,49H,6AH,16H,84H,0CH,4EH,41H,0C2H,62H,0D1H,09H,12H,4AH,8BH,0C1H,65H,91H,0D8H,50H,00H,43H,00H,3EH,28H  ;DATA_IR for Cellphone
                                    ORG 019FH
SIZEP_IR:        DB       25H                 ;Size of DATAP_IR = 37 Desimal
                                    ORG 01A0H
DATAP_IR:     DB       'A','L','E','R','T',' ',':',' ','I','R',' ','S','E','C','U','R','I','T','Y',' ','H','A','S',' ','B','E','E','N',' ','B','R','E','A','K','E','D',' '                     ;DATA_IR for PC

                                    ORG 01FFH
SIZEC_LDR:   DB       53H                 ;Size of DATAC_LDR
                                    ORG 0200H
DATAC_LDR: DB            1EH,00H,0CH,02H,00H,21H,00H,01H,00H,01H,02H,00H,0AH,91H,89H,25H,00H,01H,20H,00H,00H,00H,15H,00H,00H,00H,25H,0AH,91H,49H,62H,95H,22H,68H,00H,00H,00H,00H,0A7H,00H,00H,00H,00H,00H,00H,41H,66H,51H,4AH,05H,0E9H,40H,4CH,0A2H,14H,34H,2DH,0EH,0ABH,0D2H,24H,35H,0BH,42H,06H,0A7H,20H,61H,0B1H,0E8H,04H,09H,0A5H,0C5H,0E0H,0B2H,48H,04H,00H,43H,00H,5FH,57H                ;DATA_LDR for Cellphone
                                    ORG 029FH
SIZEP_LDR:    DB       26H                 ;Size of DATAP_LDR = 38     Desimal
                                    ORG 02A0H
DATAP_LDR: DB       'A','L','E','R','T',' ',':',' ','L','D','R',' ','S','E','C','U','R','I','T','Y',' ','H','A','S',' ','B','E','E','N',' ','B','R','E','A','K','E','D',' '                     ;DATA_LDR for PC

                                    ORG 02FFH
SIZEC_AUD:   DB       55H                 ;Size of DATAC_AUD
                                    ORG 0300H
DATAC_AUD:            DB            1EH,00H,0CH,02H,00H,23H,00H,01H,00H,01H,02H,00H,0AH,91H,89H,25H,00H,01H,20H,00H,00H,00H,15H,00H,00H,00H,27H,0AH,91H,49H,62H,95H,22H,68H,00H,00H,00H,00H,0A7H,00H,00H,00H,00H,00H,00H,41H,66H,51H,4AH,05H,0E9H,40H,0C1H,2AH,31H,0F9H,04H,4DH,8BH,0C3H,0AAH,34H,49H,0CDH,82H,90H,0C1H,29H,48H,58H,2CH,3AH,41H,42H,69H,31H,0B8H,2CH,12H,01H,00H,43H,00H,0BH,1DH                   ;DATA_AUDIO          for Cellphone
                                    ORG 039FH
SIZEP_AUD:   DB       28H                 ;Size of DATAP_AUD = 40 Desimal
                                    ORG 03A0H
DATAP_AUD:            DB       'A','L','E','R','T',' ',':',' ','A','U','D','I','O',' ','S','E','C','U','R','I','T','Y',' ','H','A','S',' ','B','E','E','N',' ','B','R','E','A','K','E','D',' '                     ;DATA_AUDIO for PC

                                    ORG 03FFH
SIZEC_FIRE:   DB       54H                 ;Size of DATAC_FIRE
                                    ORG 0400H
DATAC_FIRE:            DB            1EH,00H,0CH,02H,00H,22H,00H,01H,00H,01H,02H,00H,0AH,91H,89H,25H,00H,01H,20H,00H,00H,00H,15H,00H,00H,00H,26H,0AH,91H,49H,62H,95H,22H,68H,00H,00H,00H,00H,0A7H,00H,00H,00H,00H,00H,00H,41H,66H,51H,4AH,05H,0E9H,40H,0C6H,0A4H,0B4H,08H,9AH,16H,87H,55H,69H,92H,9AH,05H,21H,83H,53H,90H,0B0H,58H,74H,82H,84H,0D2H,62H,70H,59H,24H,02H,00H,43H,00H,0E7H,49H                     ;DATA_FIRE for Cellphone
                                    ORG 049FH
SIZEP_FIRE:   DB       27H                 ;Size of DATAP_FIRE = 39 Desimal
                                    ORG 04A0H
DATAP_FIRE: DB       'A','L','E','R','T',' ',':',' ','F','I','R','E',' ','S','E','C','U','R','I','T','Y',' ','H','A','S',' ','B','E','E','N',' ','B','R','E','A','K','E','D',' '                     ;DATA_FIRE for PC

                                    ORG 04FFH
SIZEC_PW:     DB       52H                 ;Size of DATAC_PW
                                    ORG 0500H
DATAC_PW:   DB            1EH,00H,0CH,02H,00H,20H,00H,01H,00H,01H,02H,00H,0AH,91H,89H,25H,00H,01H,20H,00H,00H,00H,15H,00H,00H,00H,24H,0AH,91H,49H,62H,95H,22H,68H,00H,00H,00H,00H,0A7H,00H,00H,00H,00H,00H,00H,41H,66H,51H,4AH,05H,0E9H,40H,0D0H,2BH,68H,5AH,1CH,56H,0A5H,49H,6AH,16H,84H,0CH,4EH,41H,0C2H,62H,0D1H,09H,12H,4AH,8BH,0C1H,65H,91H,08H,00H,43H,00H,34H,38H                      ;DATA_PW for Cellphone
                                    ORG 059FH
SIZEP_PW:      DB       25H                 ;Size of DATAP_PW   = 37 Desimal
                                    ORG 05A0H
DATAP_PW:   DB       'A','L','E','R','T',' ',':',' ','P','W',' ','S','E','C','U','R','I','T','Y',' ','H','A','S',' ','B','E','E','N',' ','B','R','E','A','K','E','D',' '                     ;DATA_PW for PC
;---------------------------------------------------------------
;------------------------PROGRAM RETURNS------------------------
            ORG 05FFH
            MOV SP,#30H    ;appx 30h to 50h is expected for stack(allow stack to scrach the scrach)

                                                                                                                                                                                                                                                 ;cheaked
            LCALL INITIALIZATION
            LCALL CHEAK_SELECTION

MAIN: LCALL CHEAK_MC
                        LCALL CHEAK_INPUT
                        LCALL UPDATION
                        LCALL OUTPUT
                        JMP MAIN
;-----------------------------------------------------------
INITIALIZATION:                                          ;to make sure 00h to 7fh(accept 33H to 2FH,cause of stack) is clear                                                              ;cheaked
            MOV PSW,#00H
            MOV R0,#7FH
            LOOP_I1:        MOV @R0,#00H
                                                DEC R0
                                                CJNE R0,#33H,LOOP_I1
                                                DEC R0
                                                DEC R0
                                                DEC R0
                                                DEC R0
            LOOP_I2:                    MOV @R0,#00H
                                                DEC R0
                                                CJNE R0,#00H,LOOP_I2

            MOV IE,#10000100B             ;Enable INTERRUPT,Enable INT1 for LPK

            MOV P0,#00H             ;making p0 an output port
            MOV P1,#0FFH           ;making p1 an input port
            MOV A,#0FFH
            MOV P0,A                   ;that's why LEDs SETs at startup
            RET
;-----------------------------------------------------------       
CHEAK_SELECTION:                                                                                                                                                                                                            ;cheaked
            MOV A,P1
            ANL A,#0F0H
            MOV P1_BITS,A     ;20H is Bit-Addressible (Starting)
            RET
;-----------------------------------------------------------
CHEAK_MC:
            JNB BIT_CHEAKMC,NO_MC
            MOV A,#55H
CHK_MC:     
            LCALL DELAY_500mS
            RR A
            MOV P0,A
            JMP CHK_MC
            NO_MC:
            RET
;--------------------------------------------------------------
CHEAK_INPUT:         ;No CLR A instruction so LED Activated by just Push baton                                                                                                                                                                                                  ;cheaked
LOOP_CI:        MOV A,P1
                                    ANL A,#0FH
                                    JZ LOOP_CI
            RET   
;-----------------------------------------------------------
UPDATION:                ;to merge the old SELECTION data(on P1_DATA) and new SENSER data(on A) to P1_BITS
            ANL P1_BITS,#0F0H  ;to cheak continouse input update
            ORL A,P1_BITS                      ;to put current selection and current input data
            MOV P1_BITS,A                     ;after this instruction P1_BITS having full data of Port 1
            RET
;-----------------------------------------------------------
OUTPUT:                                                                                                                                                                                                                                            ;cheaked

            JB        BIT_SC,SKIP_OP1
            CALL SERIAL_COMM
            SKIP_OP1:
            JB BIT_LED,SKIP_OP2
            CALL START_LED
            SKIP_OP2:

            RET
;-----------------------------------------------------------
;-------------SERIAL COMMUNICATION ROUTINE------------------
SERIAL_COMM:
            LCALL INITIALISE_SERIAL
            LCALL CHEAK_SERIAL
            LCALL SEND_SERIAL
            RET
;-----------------------------------------------------------
INITIALISE_SERIAL:
            MOV TMOD,#20H                  ;TIME 1 ,MODE 2
            MOV TH1,#0FDH                               ;9600 Boudrate
            MOV SCON,#50H                   ;8 Bit,1 Stop Bit,Recive Enable
            RET
;-----------------------------------------------------------
CHEAK_SERIAL:                                                                                                                                                                                                          ;cheaked
            JB BIT_PORP,SKIP_CELLPHONE
            LCALL CHEAK_SERIALC
            SKIP_CELLPHONE:
            JNB BIT_PORP,SKIP_PC
            LCALL CHEAK_SERIALP
            SKIP_PC:
            RET
;----------------------------------------------------------------
CHEAK_SERIALC:                                                                                                                                                                                                       ;cheaked
            JNB BIT_IR,SKIP_IRC
            CLR A
            MOV DPTR,#SIZEC_IR
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAC_IR
            RET
            SKIP_IRC:
            JNB BIT_LDR,SKIP_LDRC
            CLR A
            MOV DPTR,#SIZEC_LDR
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAC_LDR
            RET
            SKIP_LDRC:
            JNB BIT_AUD,SKIP_AUDC
            CLR A
            MOV DPTR,#SIZEC_AUD
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAC_AUD
            RET
            SKIP_AUDC:
            JNB BIT_FIRE,SKIP_FIREC
            CLR A
            MOV DPTR,#SIZEC_FIRE
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAC_FIRE
            RET
            SKIP_FIREC:
            JNB BIT_PW,SKIP_PWC
            CLR A
            MOV DPTR,#SIZEC_PW
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAC_PW
            RET
            SKIP_PWC:
            RET
;------------------------------------------------------------
CHEAK_SERIALP:                                                                                                                                                                   ;cheaked
            JNB BIT_IR,SKIP_IRP
            CLR A
            MOV DPTR,#SIZEP_IR
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAP_IR
            RET
            SKIP_IRP:
            JNB BIT_LDR,SKIP_LDRP
            CLR A
            MOV DPTR,#SIZEP_LDR
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAP_LDR
            RET
            SKIP_LDRP:
            JNB BIT_AUD,SKIP_AUDP
            CLR A
            MOV DPTR,#SIZEP_AUD
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAP_AUD
            RET
            SKIP_AUDP:
            JNB BIT_FIRE,SKIP_FIREP
            CLR A
            MOV DPTR,#SIZEP_FIRE
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAP_FIRE
            RET
            SKIP_FIREP:
            JNB BIT_PW,SKIP_PWP
            CLR A
            MOV DPTR,#SIZEP_PW
            MOVC A,@A+DPTR
            MOV SIZE,A
            MOV DPTR,#DATAP_PW
            RET
            SKIP_PWP:
            RET
;-------------------------------------------------------------
SEND_SERIAL:                                  ;simply send data loaded from DPTR location of size SIZE      ;cheaked
            LOOP_SS:       CLR A
                                                MOVC A,@A+DPTR
                                                SETB TR1
                                                MOV SBUF,A
             REPEAT:        JNB TI,REPEAT
                                                CLR TI
                                                INC DPTR
                                                DJNZ SIZE,LOOP_SS
;--------------------------------------------------------------
;------------------------LED ROUTINE----------------------------
START_LED:     ;inverse logic,due to low power output
          
            MOV A,#0FH
            ANL A,P1_BITS          ;after this ACC having only senser data
            XRL A,#0FFH             ;to invert
            MOV P0,A

            RET
;-------------------------------------------------------------------
;-------------------"LEAD PER KEY" KEYPAD ROUTINE-------------------
INT_ACCOR:

            LCALL INITIALIZE
            LCALL GET_KEY                                                      ;ENTER and EN_DES_SEC is merged with GET_KEY
          
RETI
;-------------------------------------------------------------------
INITIALIZE:
            MOV P0,#00H                                     ;making OUTPUT port
            MOV P2,#0FFH                                   ;making INPUT port
            MOV PW_REG_SEL,#08H                 ;whole REG BANK 2 is dedicated to store 8 byte PW
            MOV PW_BITS,#0FFH                       ;by prog going to make it 00h if pw is true
          
            SETB P0.0                                           ;
            SETB P0.1                                           ;
            SETB P0.2                                           ;
            SETB P0.3                                           ;
            CLR P0.4                                             ;blue LED ON              (Keypad is active)
            SETB P0.5                                           ;yellow LED OFF                     (you have pressed a key)
            SETB P0.6                                           ;green LED OFF                       (right Password)
            SETB P0.7                                           ;red LED OFF              (wrong password)
            RET
;-------------------------------------------------------------------
GET_KEY:NOP                                               ;as Expert Programmer Writes

              MOV D3,#07H                                  ;This 14 lines have dissipate 6 hours of my peak efficient time.
LOOP2:DEC D3                                              ;but when i got it ,it feels like god...
              MOV D2,#0FFH                                ;My actual idea was to use timer as interrupt ,so that if user dint
LOOP1:DEC D2                                              ;press any key in 5 second then program say getout .
              MOV D1,#0FFH                                ;but the problem arise when i come to know that in one interrupt
CHEAK:MOV A,D1                                        ;routine(INT1) i cant use other interrupt(TIMER0)(RETI is must b4 other imterrupt)...
              JZ LOOP1                                          ;so that i need to create a applet(small program) in such a way that
              MOV A,D2                                        ;actes as VIRTUAL TIMER,mean to say i want to cheak input continuasly
              JZ LOOP2                                          ;any continue cheaking time and when reach to 5 second virtual interrupt
              MOV A,D3                                        ;can be generated and come out of infinite loop.
              JZ TIMES_UP                                    ;
              DEC D1                                             ;"Nohing could be Possible ,Untill Tried"
              MOV A,P2                                         ;                                                                       -this's also orignal once..
              JZ CHEAK                                        ;

            CLR P0.5
            LCALL DELAY_1S                              ;to indicate key press(as programmer view,to set delay to prevent double key press)
            SETB P0.5

            CJNE A,#01H,GOTO2
            MOV @PW_REG_SEL,#31H                ;key-1 ('1')
            GOTO2:
            CJNE A,#02H,GOTO3
            MOV @PW_REG_SEL,#32H                ;key-2 ('2')
            GOTO3:
            CJNE A,#04H,GOTO4
            MOV @PW_REG_SEL,#33H                ;key-3,4,6 ('3','4','6')
            GOTO4:
            CJNE A,#08H,GOTO5
            MOV @PW_REG_SEL,#35H                ;key-5 ('5')
            GOTO5:
            CJNE A,#10H,GOTO6
            MOV @PW_REG_SEL,#37H                 ;key-7 ('7')
            GOTO6:
            CJNE A,#20H,GOTO7
            MOV @PW_REG_SEL,#39H                 ;key-9  ('9')
            GOTO7:
            CJNE A,#40H,GOTO8
            MOV @PW_REG_SEL,#30H                          ;key-0,8 ('0','8')
            GOTO8:
            CJNE A,#80H,GOTO9
            CALL ENTER                ;ENTER key has been pressed(the only way to come out of loop,accept "times up")
            GOTO9:

            INC PW_REG_SEL
            CJNE PW_REG_SEL,#10H,GET_KEY
            MOV PW_REG_SEL,#08H
            JMP GET_KEY

TIMES_UP:                                                                             ;the prog never suppose to come here in regular routine !!
                        ;MAKE RESET HERE                                                             ;if time will be up then and only it force to come here...
            RET
;-------------------------------------------------------------------
ENTER:

MOV PW_REG_SEL,#08H
MOV DPTR,#DATA_PW
;MOV BIT_SETTER,#0FEH       ;it'll be used for setting PW_BITS by use of rotation

LOOPE:                       CLR A
                                    MOVC A,@A+DPTR
                                    XRL A,@PW_REG_SEL
                                    JNZ AS_IT_IS
                                    MOV A,PW_BITS
                                    ANL A,#0FEH
                                    MOV PW_BITS,A
                                    AS_IT_IS:
                                    INC PW_REG_SEL
                                    INC DPTR
                                    MOV A,PW_BITS
                                    RR A
                                    MOV PW_BITS,A
                                    CJNE PW_REG_SEL,#10H,LOOPE


;EN_DES_SEC:
            MOV A,PW_BITS
            JZ OK  ;if the pw bits(PW_BITS) is 00h then pw is right o/w wrong
            LCALL WRONG_PW
            JMP WAY_OUT
            OK:
            LCALL RIGHT_PW       ;not expected to return

WAY_OUT:
            POP B  ;hahaha...this may be considered as my favourite two
            POP B  ;lines in the whole code i've developed..
                                    ;footnote:-i've skipped orignal RET by popping two times..

            RET
;----------------------DELAY HANDLERS-----------------------
;Crystal Used : 11.0592 MHz (hard to find at my City)
;Using serial comm so No Option At All.......

DELAY_10mS:                         ;Actuly ((256*2)+1)*19*1.085 uS = 10.57 mS
            MOV D1,#19H
            DLOOP1A:MOV D2,#0FFH
            DLOOP2A:DJNZ D2,DLOOP2A
            DJNZ D1,DLOOP1A
            RET

DELAY_500mS:           ;creates delay for 0.5S
            MOV D3,#04H
            DLOOP3B:MOV D2,#0FFH
            DLOOP2B:MOV D1,#0FFH
            DLOOP1B:DJNZ D1,DLOOP1B
            DJNZ D2,DLOOP2B
            DJNZ D3,DLOOP3B
            RET

DELAY_1S:                            ;creates delay for 1S
            MOV D3,#07H
            DLOOP3C:MOV D2,#0FFH
            DLOOP2C:MOV D1,#0FFH
            DLOOP1C:DJNZ D1,DLOOP1C
            DJNZ D2,DLOOP2C
            DJNZ D3,DLOOP3C
            RET
;-----------------------------------------------------------

 

END      

###

 


Circuit Diagrams

Bank-Security-System-Circuit


Filed Under: Electronic Projects
Tagged With: alarm, bank, Infra Red, ir, microcontroller, security system
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • 12VAC to 12VDC 5A on 250ft 12AWG
  • Is it possible to improve accuarcy of ad633
  • Battery sensing circuitry for coin cell application
  • Copper Pour Support in Altium Softwarez
  • Input impedance matching network

RSS Electro-Tech-Online.com Discussions

  • Chinese Tarrifs – 104%!?!
  • An Update On Tarrifs
  • Tariff Updates from JLCPCB as of Today
  • Solar lighting motion detector
  • Telegram Based Alarm - Sensor cable protection

Featured – Designing of Audio Amplifiers part 9 series

  • Basics of Audio Amplifier – 1/9
  • Designing 250 Milli Watt Audio Power Amplifier – 2/9
  • Designing 1 Watt Audio Power Amplifier – 3/9
  • Designing a Bass Boost Amplifier – 4/9
  • Designing a 6 Watt Car Audio Amplifier – 5/9
  • Design a low power amplifier for headphones- 6/9

Recent Articles

  • Renesas launches 64-bit RZ/A3M with built-in 12 8MB memory
  • Hexagon’s Septentrio introduces 23 mm x 16 mm GNSS modules compatible with PX4 and ArduPilot
  • ITG Electronics releases gate drive transformers with 200 – 450 V DC capability
  • Stackpole introduces HCJ jumpers with 70.7 amp continuous current capability
  • Infineon releases MCU with 128K flash and multi-sense capabilities

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe