12-03-2012, 03:04 PM
MICROCONTROLLER-BASED CODE LOCK
MC CODE LOCK.doc (Size: 240.5 KB / Downloads: 160)
INTRODUCTION
Code locks can be constructed using digital and timer ICs employing pushbuttons or keypads for entering the code for authentication and operation of the code lock. However, such circuits would require a large number of ICs.
On the other hand, a microcontroller-based code lock will require very few peripheral components. With the cost of microcontrollers now dropping to be equivalent cost of approximately four digital ICs, it makes sense to design simple logic circuits using microcontrollers and free version of programming language code length is normally limited to around 2 kB, but that is adequate for small projects like this one.
This simple code lock project is based on a 20-pin ATMEL microcontroller AT89C2051. It employs a 4-digit sequential code with time-out security feature. In addition to the microcontroller, the circuit uses a single additional IC (CD4050) and a transistor to drive a relay. Although the project uses a liquid-crystal display (LCD), it is useful for design and developmental purpose only and is not really an essential part of the circuit.
THE SOFTWARE
The software is written using BASCOM-51. The source code file ‘EFYCLOCK BAS’ for the project in BASCOM-51 is given in the article. Although the program is self-explanatory, you need to be aware of BASCOM51 compiler directives and syntax of statements, which are available with in the help menu of BASCOM compiler. BASCOM contains a lot of statements to control various a lot of statements to control various peripherals including the LCD.
The BOSCOM compiler /IDE can be used to generate a hex file, which should be ‘burnt’ into the chip using any universal programmer. The hex code of the program is only 1.5k long, while AT89C2051 microcontroller can take up to 2k of code. This program may be modified to suit your specific requirement.
MC CODE LOCK.doc (Size: 240.5 KB / Downloads: 160)
INTRODUCTION
Code locks can be constructed using digital and timer ICs employing pushbuttons or keypads for entering the code for authentication and operation of the code lock. However, such circuits would require a large number of ICs.
On the other hand, a microcontroller-based code lock will require very few peripheral components. With the cost of microcontrollers now dropping to be equivalent cost of approximately four digital ICs, it makes sense to design simple logic circuits using microcontrollers and free version of programming language code length is normally limited to around 2 kB, but that is adequate for small projects like this one.
This simple code lock project is based on a 20-pin ATMEL microcontroller AT89C2051. It employs a 4-digit sequential code with time-out security feature. In addition to the microcontroller, the circuit uses a single additional IC (CD4050) and a transistor to drive a relay. Although the project uses a liquid-crystal display (LCD), it is useful for design and developmental purpose only and is not really an essential part of the circuit.
THE SOFTWARE
The software is written using BASCOM-51. The source code file ‘EFYCLOCK BAS’ for the project in BASCOM-51 is given in the article. Although the program is self-explanatory, you need to be aware of BASCOM51 compiler directives and syntax of statements, which are available with in the help menu of BASCOM compiler. BASCOM contains a lot of statements to control various a lot of statements to control various peripherals including the LCD.
The BOSCOM compiler /IDE can be used to generate a hex file, which should be ‘burnt’ into the chip using any universal programmer. The hex code of the program is only 1.5k long, while AT89C2051 microcontroller can take up to 2k of code. This program may be modified to suit your specific requirement.