Microcontroller Based Password Verification System
To simulate a circuit using microcontroller 8051 for verifying password.
The block diagram for microcontroller based password verifying system is shown. The purpose of the circuit is to verify the password entered by the user.
An 8-bit password is the input to this system (A simple example has purposely been dealt with here for the convenience of an average student. The student may modify the circuit and program to try 16 or higher bit password input as an intellectual exercise). In the first section of the circuit the password entered by the user (user-password) is compared with the actual password (password set in the microcontroller using the microprogram) by the microcontroller. The result of the comparison process is an 8-bit output at the output port, which is fed to a logic circuit. If the user-password is correct, the output of the logic circuit will be high. The high output of the logic circuit enables the AND gate in the next section, which has an asynchronous counter as its second input. The digital output of the AND gate is converted to the corresponding analog voltage using a 12-bit DAC.
A microcontroller is a single chip microcomputer, which contains CPU, ROM/ EPROM, RAM and I/O ports. The main features of 8051 microcontroller are: –
- 8-bit CPU optimized for control applications,
- extensive Boolean processing capabilities,
- 64K Program Memory address space,
- 64K Data Memory address space,
- 4K bytes of on-chip Program memory,
- 128 bytes of on-chip Data RAM,
- 32 bi-directional and individually addressable I/O lines,
- two 16 bit timers/ counters- Timer 0 and Timer 1,
- Full Duplex serial port,
- 6-source/ 5-vector interrupt structure with two priority levels and
- On-chip clock oscillator.
Memory can be extended using external EPROM and RAM. 8051 contains an ALU, Timing and Control Unit, Accumulator, B register, PSW (Program Status Word), Stack Pointer, Data Pointer, Timer Registers, Serial Buffer, Program Counter, RAM Address Register, Program Address Register, Instruction Register, Control Registers etc. 8051 is a 40-pin chip operating with 12MHz clock and a single +5V supply. The 8051 has 111 instructions: 49 single byte, 45 two-byte and 17 three-byte.
The comparison operation within the microcontroller is performed by means of instructions fed to it known as microprogram. The microprogram constitutes instructions called microinstructions. Our microprogram has microinstructions for setting the password as 0x21 and comparing it with the user-password. If the user-password is correct, the port- P0 gives 8-bit digital output equivalent to 0x0F. If not, the output will be 0xFF and the user again has the option to enter the password. The output of the microcontroller (8-bit digital output) is fed to a logic circuit, which consists of a four input AND gate and a four input NOR gate and an AND gate. The lower order four bits of port- P0 of the microcontroller are fed to the AND gate so that its output is high only when all the four lower order bits are high. The higher order four bits of port- P0 are connected to the NOR gate so that its output is high only when all the four higher order bits of P0 are low. These two outputs are fed to the AND gate which produces a high output only when both its inputs are high. In other words, the output of the logic circuit is high only when the user-password is correct.
The high output of the logic circuit enables the AND gate in the next section. The asynchronous counter is realized using D-Flip-flops, inverters, four-input NAND gates and XOR gate as shown in the circuit diagram. The asynchronous counter output is passed to the Digital to Analog Converter (DAC) through the AND gate only when the password entered is correct. As the counter counts, an equivalent analog voltage is generated using the DAC.
The Digital to Analog Converter used here is LTC1450CG. This device has 12 input data pins. This DAC has an output buffer amplifier, reference (voltage) and a double buffered parallel digital interface. The digital data is fed to twelve data lines. The analog output voltage is obtained from the Vout pin. Depending upon the logic state of the CLR, WR, CSLSB, CSMSB and the LDAC pins, the input data is loaded and latched into the 12 bit DAC latch present within the DAC. The output buffer is configured such that the gain is 2 by setting the Gain/Gain2 pin to ground. The analog voltage from the DAC (i.e. the output of the whole system) indicates the correct entry of password. Otherwise, the DAC output is null. Thus the microcontroller performs the password verification.
For more detail: Microcontroller Based Password Verification System