• No results found

Access-control system

In document PROJETOS ELETRONICOS (Page 51-55)

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

Resistors (¼-watt ±5% carbon, unless stated otherwise) C11 - 470µF, 25V electrolytic Miscellaneous:

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

- 4x4 keyboard matrix PZ1 - Continuous tone-type

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 binary 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

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 extra 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) gener-ates 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 tran-sistor 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 clock-ing at its trailclock-ing edge. On each clockclock-ing, counter IC5 advances by one count and

IC4). Each CD4508 contains two complete-ly 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

Fig. 2: Schematic diagram of access-control system

input pins of all the six latches in parallel.

For example, pin 17 (QA) of IC1 is con-nected 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 IC5 provides a high output to ‘clear’ and ‘store’

pins 1 and 2 of IC2A, thereby clearing its 4-bit register.

When a key is pressed, the equivalent binary 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 generating the required clock pulse for IC5. This clocking makes pins 3 and 2 of IC5 low and high, respec-tively, causing the binary data correspond-ing to the first Hex digit keyboard entry

to be stored and available at the output of IC2A.

Similarly, when the second 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 EPROM 27C32 (IC6). The outputs from fourth and fifth data latches are connected to two 4-bit magnitude comparators IC7 and IC8 (CD4063), and the output from sixth data latch is connected to a similar 4-bit magnitude comparator IC9 for fur-ther processing.

The memory. All 8-bit codes, except the 4-bit system code, are stored at differ-ent 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 IC7 and IC8 compare the 8-bit data output of EPROM with the cor-responding fourth and fifth digits entered via the keyboard 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 circuit.

The outputs from IC9 are available only after entering the last digit.

Alarm generator. The alarm gen-erator 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 Fig. 3: Actual-size, single-sided PCB layout for access-control system

gering, pin 6 of IC10 becomes high and remains in that state for a predeter-mined 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 im-proves the security of the system.

construction

Data input/output pins are to be con-nected with utmost care because im-proper connection will force the system to work unpredictably. 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 momentar-ily. 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 security.

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

keep the cost low. The output from pin 3 of timer also drives LED2, which flashes at the output frequency of the astable oscillator.

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-Readers’ comments:

Q1. The construction project is very inter-esting and useful. However, how memory dump is to be programmed in EPROM IC6 is not given. Though different people would like to program different codes, at least one example should have been given to illustrate this.

Praveen Shanker, Haridwar a1. EFY: Though programming of EPROM is well explained by the author, here is an example of coding. Let us say address of the EPROM where a specific code is stored is 41A (Hex). It is equiv-atent to 0100 0001 1010, which is used as address All through AO of the EPROM.

Now assume data stored is B5 (Hex), i.e.

1110 0101 at the above mentioned ad-dresses. Let the system code be E (Hex), i.e. 1010. For getting this system code close DIP switches B, C, D, and leave A open (in S3).Thus access code=41A B5E (Hex) or MSB...LSB 0100 0001 1010 1011 0101 1110 (Binary).

ajay subramanian and nayantara bhatnagar

telephone line-interfAceD

In document PROJETOS ELETRONICOS (Page 51-55)