Electronic Lock

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.

Electronic Lock Unit

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.

Electronic Lock Schematic

A short video showing electronic lock prototype design is available in a link below. Compiled Hex file can be downloaded here. Click this link for assembly source file.

Posted in PIC16F87X Projects

Leave a Reply

Your email address will not be published. Required fields are marked *