Everything is controlled using the CLOCK, RESET, and input pins. The first step after starting the simulation is pressing RESET.
To set a passcode, IN0 will need to be set to HIGH for the duration of the setup. Then, create a combination of IN1, IN2, IN3, and IN4. This will be your passcode after setting IN0 back to LOW. The passcode can be reset anytime with IN0. OUT 0~3 represent the current password of the lock.
To unlock the combination lock, you will set IN1, IN2, IN3, and IN4 to
the previous combination in Setting a Passcode
. To verify, set IN5
to HIGH. If correct, the LED at OUT4 will go HIGH.
The lock will only be in an unlocked state if IN5 is held at HIGH.
Returning IN5 back to LOW will lock the combination lock again.
The user will only have 3 tries to get the right combination before the input pins IN1, IN2, IN3, and IN4 become pin-locked (unusable). Once the lock become unusable, OUT5 will go LOW. A press of the RESET button will turn it back to normal.
The normal flow of using the design is to first set a password of your liking (assuming you are the admin). Then, the lock would be free to use. If in a case where the user failed three times to unlock the lock, it is up to the admin to reset the pin-lock for continued use.
A microcontroller (or other hardware of sorts) that allows only the admin to be able to reset the pin-lock is reccomended. Buttons, switches, or other forms of input are necessary for physical operation of the lock.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | Set | CurrPswd[0] | |
1 | Pswd[0] | CurrPswd[0] | |
2 | Pswd[1] | CurrPswd[0] | |
3 | Pswd[2] | CurrPswd[0] | |
4 | Pswd[3] | Unlocked | |
5 | Enter | PinLocked | |
6 | |||
7 |