Here is a modified and improved electronic lock design .It is largely based on Digital Lock article, however this time in order to demonstrate circuit operation a real electronic lock was used instead of a solenoid. The code is a 4 digit number and is stored in PIC16F876A memory. In order to open the lock all 4 digits must be entered in correct order. These digits are also shown in 7-Segment LED Display. BD139 NPN transistor and 5V relay were used to energize the lock. In the next figure you can see an actual lock that was implemented in current design.
I don’t know the manufacturer of the lock the only marking available is its voltage rating between 6-12V .This lock requires about 300mA to properly open as was measured at 12V supply voltage. Enter correct code, default is 1-2-3-4 and the lock will open for about 4 sec, you can increase this time by adding additional delay, see attached assembly code at the bottom of the page.