• No results found

ACCESS-CONTROL SYSTEM

In document Electronics for You Projects 2001 (Page 82-86)

T

he easy-to-construct access control (code lock) circuit presented here incorporates the following unique features:

(a) Many people can use the same sys-tem with their own unique 6-digit code.

(b) A single-digit system code has been included, which is common to all users of the system. It can be easily changed with the help of DIP switches.

Description

The block diagram of the system shown in Fig. 1 provides an overall view of its composition and working. A 16-digit key-pad is used for sequentially entering six Hex numbers, which are decoded by the keyboard encoder into their equivalent bi-nary numbers and stored in separate data latches in binary form.

The first three Hex numbers are used as an address for an EPROM, which stores a predetermined code at prefixed addresses allocated to separate users or used for separate purposes. The code data output from EPROM (one byte/two nibbles) at a specified address is compared with the next two keyboard entries in two 4-bit comparators that are cascaded together.

The resultant outputs of these two comparators are connected to the next comparator stage, in which the last key-board digit (i.e. sixth Hex digit) is com-pared with the system code selected by

Data latches. There are six data latches formed from three CD4508 ICs (IC2 through IC4). Each CD4508 contains two completely independent 4-bit data latches having a common power supply.

The 6-digit code is stored in these latches.

The 4-bit data bus originating from the output of IC1 is connected to data input pins of all the six latches in paral-lel. For example, pin 17 (QA) of IC1 is connected to the corresponding pins 4 and 16 of all the latches as the LSB of 4-bit binary output from IC1. Initially, pin 3 of DIP switch.

If any one or more of the six consecu-tive keyboard-entered digits do not con-form to the predetermined code, an alarm generator sounds the alarm to indicate wrong code. If the result of final compari-son of all the six digits is correct, a mono multivibrator, serving as lock driver for opening/closing a lock, gets activated for a fixed preset duration.

The detailed description of individual units, as shown in Fig. 2, is as follows:

Keyboard and keyboard encoder.

The keyboard consists of 16 push-to-on type keys in a 4x4 matrix format. It can be made using data switches or one can use membrane-type keyboard at some ex-tra cost. The keys should be numbered in Hex as shown in the figure.

The encoder is built around 74C922 (IC1), which is a 16-key keyboard encoder.

It generates a 4-bit binary number corre-sponding to the key pressed; for example, shorting pin 1 (R1) with pin 11 (C1) gen-erates the binary equivalent of digit ‘0’.

Whenever a key is pressed, the signal generated by this encoder IC is available as logic ‘high’ output at pin 12 and is used to activate a piezo-buzzer (PZ1) via transistor T1 (BC547). The continuous tone of PZ1 indicates that a key is pressed.

The key-pressed signal is also used to store data in the latches.

The output from pin 12 is connected to pin 13 of IC5 (CD4017 counter) for clocking at its trailing edge.

On each clock-ing, counter IC5 advances by one count and thereby stores data in separate data latches one after the other.

IC1 also holds the last number at its output pins.

BHASKAR BANERJEE

Fig. 1: Block diagram of the access-control system

PARTS LIST Semiconductors:

IC1 - 74C922 16-key encoder IC2-IC4 - CD4508 dual 4-bit latch IC5 - CD4017 decade counter

IC6 - 27C32 EPROM

IC7-IC9 - CD4063 4-bit magnitude comparator

IC10 - CD4528 dual retriggerable monostable

IC11 - NE555 timer IC12 - CD4069 Hex inverter T1-T4 - BC547 npn transistor T5 - SL100 npn transistor

T6 - 2P4M SCR

D1, D2, D4 - 1N4148 switching diode D3 - 1N4007 rectifier diode LED1-LED3 - Red LED

LED4 - Green LED

Resistors (¼-watt ±5% carbon, unless stated otherwise)

R1, R3, R4,

R15, - 10-kilo-ohm R2, R5, R8,

R21, R22 - 4.7-kilo-ohm

R6 - 18-kilo-ohm

R7 - 10-mega-ohm

R9 - 2.2-mega-ohm

R10, R11,

R17-R20 - 1-kilo-ohm R12-R14 - 470-ohm R16 - 47-kilo-ohm

R23 - 47-ohm

Capacitors:

C1, C7, C8,

C12 - 0.1µF ceramic disc C2 - 2.2µF, 25V electrolytic C3, C5, C6,

C9, C10 - 22µF, 25V electrolytic C4, C13 - 47µF, 25V electrolytic C11 - 470µF, 25V electrolytic Miscellaneous:

S1 - Push-to-on switch S2 - Push-to-off switch

- 4x4 keyboard matrix PZ1 - Continuous tone-type

piezo-buzzer

RL1 - 9V, 200-ohm, 1 C/O relay S3 - 4-way DIP switch

- Regulated 5V power supply etc

IC5 provides a high output to ‘clear’ and

‘store’ pins 1 and 2 of IC2A, thereby clear-ing its 4-bit register.

When a key is pressed, the equivalent bi-nary code is present at data input pins of all the latches. On releasing the key, pin 12 of IC1 changes its state from

‘high’ to ‘low’, thereby gen-erating the required clock pulse for IC5.

This clocking makes pins 3 and 2 of IC5 low and high, respectively, causing the binary data corresponding to the first Hex digit key-board entry to be stored and available at the output of IC2A.

Similarly, when the sec-ond key is pressed, new data is stored in IC2B with-out affecting the previously stored data in IC2A. The outputs from first three data latches are connected to address pins of E P R O M 27C32 (IC6).

The outputs

Fig. 2: Schematic diagram of access-control system

from fourth and fifth data latches are con-nected to two 4-bit magnitude compara-tors IC7 and IC8 (CD4063), and the out-put from sixth data latch is connected to a similar 4-bit magnitude comparator IC9 for further processing.

The memory. All 8-bit codes, except the 4-bit system code, are stored at dif-ferent locations (addresses) in the EPROM (IC6). Out of the six Hex digits, first five digits are used as personalised code, and out of these five digits, the first three are used to form an address for EPROM.

The leftmost digit of the code is the MSD (most significant digit) and the third digit from left is the LSD (least

signifi-cant digit) of the 12-bit wide address for IC6. The fourth and fifth digits from left are to be the same as the data stored in IC6 (beforehand) at that particular ad-dress. Thus, when a code is entered via the keyboard, the fourth and fifth digits are compared with the data stored at the address formed by the first three digits.

(The EPROM can be programmed with the help of ‘Manual EPROM Programmer’, and may be replaced by an EEPROM for better reliability.)

Code comparator. There are three 4-bit comparators (IC7 through IC9) used in the circuit, which are cascaded together to form a 12-bit comparator. Comparators Fig. 3: Actual-size, single-sided PCB layout for access-control system

IC7 and IC8 compare the 8-bit data out-put of EPROM with the corresponding fourth and fifth digits entered via the key-board and stored in latches IC3B and IC4A.

While IC7 compares the upper 4-bit output of IC6 with the contents of IC3B (i.e. the fourth digit from left), IC8 com-pares the lower 4-bit output of IC6 with the contents of IC4A (i.e. the fifth digit from left). Similarly, IC9 compares the last digit (i.e. the contents of IC4B) with the code entered/formed by 4-way DIP switch S3 (marked A through D), which is referred to here as the system code.

This system code digit can be changed from time to time.

The result of the comparison by the three comparators is finally available from IC9. If the entered code matches with the stored data, pin 6 of IC9 goes high, indi-cating a correct code. Otherwise, either of pins 5 and 7 goes high depending upon the magnitude of the data. Pins 5 and 7 are connected together via diodes D1 and D2 and used as the trigger for alarm cir-cuit. The outputs from IC9 are available only after entering the last digit.

Alarm generator. The alarm genera-tor is built around a 555 timer (IC11).

The logic ‘high’ output from pin 5 or pin 7 of IC9 triggers the SCR and applies Vcc supply to IC 555 to make it oscillate. The

output from pin 3 of IC11 is used to drive transistor T2 (BC547) to generate a long-duration alarm tone from PZ1.

A common buzzer is used for key-press audio indicator and alarm generator to keep the cost low. The output from pin 3 of timer also drives LED2, which flashes at the output frequency of the astable os-cillator.

MMV and lock driver. When a valid code is entered, pin 6 of IC9 becomes high and triggers monostable multivibrator CD4528 (IC10) via transistor T3. On trig-gering, pin 6 of IC10 becomes high and remains in that state for a predetermined time period. The output at pin 6 of IC10 drives transistor T5 (SL100) to operate relay RL1. When the system is locked, red LED1 glows, and when it is unlocked, green LED4 glows.

The other half of IC10 is used to keep the keyboard activated for a predeter-mined time. The keyboard is activated by pressing switch S1. This feature improves the security of the system.

Construction

Data input/output pins are to be connected with utmost care because improper con-nection will force the system to work un-predictably. Also, care should be taken while using IC1, as it is quite costly. The points marked Vcc should be connected to the power supply directly.

The system can be built on a general-purpose PCB or a veroboard. A single-sided PCB layout for the circuit is, how-ever, shown in Fig. 3, with its component layout shown in Fig. 4.

Operation

Initially, when IC1 is disabled by IC10, no code can be entered. To activate the keyboard, press switch S1 momentarily.

This will activate the keyboard for a predetermined time. The code should be entered within this time. Using the 4-way DIP switch S3, the system code can be changed at any time for extra se-curity.

If wrong code is entered, the buzzer sounds alarm and the red LED starts flashing. In this case, you can reset the circuit by a momentary depression of switch S2. It is to be noted that no dis-play unit is used, to keep the code secret.

But if you still prefer to have one, the same could be included. ❏ Fig. 4: Component layout for the PCB

S.C. DWIVEDI

Q

uite a few projects using DTMF-to-BCD decoder ASIC MT 8870/

KT 3170 have appeared in EFY during the past few years. The project presented here also uses the same ASIC, but it is used here as part of a circuit in which a fairly advanced switching logic with adequate foolproofing and authenti-cation is implemented. The major features of this circuit are:

• Programmable password protection over a public network

• Foolproof mechanisms for events such as time-out delays, incorrect pass-word, and power-on initialisation

• Expandable design

The primary objective of this circuit is to make a fairly low-cost device for con-trolling up to a hundred household switches remotely over any public/private telephone network.

Description

The block diagram of the system is shown in Fig. 1. It consists of the following three units:

1. The interface and control unit 2. The authentication unit

3. The main device selection and switching circuit

The interface and control unit pro-vides control signals and BCD data to the other two units. It handles interfacing with the telephone line and also gener-ates control signals for hanging up (HUP) and a universal reset pulse, which is used by the authentication circuit for its op-eration. Its design may be altered to achieve connectivity to another network, which is capable of providing certain con-trol and data signal sequences.

The authentication unit stores four presettable digits of code data and compares the same against the 4-digit DTMF code sent via the telephone lines before the time-out occurs. If the 4-digit code is found valid, the authentication unit issues an authorisation signal to the main device selection and switching unit. However if an incorrect password is entered, the device terminates the call by returning to the off-hook condi-tion.

The fifth DTMF digit determines the address of the group to be selected, while the sixth digit determines the device num-ber that is to be selected within that group. The selected device can be switched on or switched off by a momentary de-pression of the telephone keypad switches marked * (code1011 binary) and # (code

1100 binary), respectively. Thus you can select any one of the hundred devices, divided into ten groups, to be switched on/off, as desired—one at a time.

The interface and control unit (Fig. 2). This unit performs the following functions:

• Detects an incoming call. Counts up to a programmable number of rings and then simulates handset off-cradle condi-tion.

• Once off-hook, it must decode DTMF signals on the telephone line within a fixed time and generate appropriate BCD data and StD pulse for indicating a valid data condition. The positive edge of this StD pulse is used for subsequent opera-tions.

• Generates a universal Reset signal that includes a time-out and a power-on-reset. This Reset signal is an active low pulse of programmable duration.

• Generates a hang-up (HUP) signal on expiry of the time-out and uses this signal internally to take the device off-line.

When a call arrives, a 75-80V AC ring signal is available on the lines. This ring signal is coupled to optocoupler Opto-1 (MCT2E) via DC blocking capacitor C1 and current-limiting resistor R1. LED1 serves as a ring indicator and as an anti-parallel diode to the in-built LED of the optocoupler for working with AC ring sig-nal. The output of optocoupler triggers timer IC1, which is configured as a monostable retriggerable flip-flop to pro-vide a pulse output to be used as a clock for decade counter IC2 (CD4017) with de-coded outputs.

The pulse-width of monostable should be slightly greater than 0.6 second to en-sure that the pulse does not terminate during the 0.2-second pause between a pair of ring signals of 0.4-second

dura-Fig. 1: Block diagram of telephone line-interfaced generic switching system

AJAY SUBRAMANIAN AND NAYANTARA BHATNAGAR

TELEPHONE LINE-INTERFACED

In document Electronics for You Projects 2001 (Page 82-86)