There are several electronic devices which require a security lock for their protection. This article describes a way to build an electronic lock with a four-digit [[wysiwyg_imageupload::]]password. A keypad, interfaced with 8051 microcontroller (AT89C51), is used to enter the password. The password and its status are displayed on an LCD screen.A 4×3 matrix keypad and a 16×2 LCD have been used here. Keypad and LCD are very commonly used input & output devices, respectively. A four digit predefined password is specified in the microcontroller AT89C51’s program. If the entered password from keypad matches with this password, then the lock opens and a message is displayed on LCD. Also an output pin is made high to be used for further purpose. The connections in the circuit are as following: port P2 of microcontroller is used as data input port which is connected to data pins (7-14) of LCD. Read more to find out how does the circuit works.