A system for controlling access to a secure area includes a lock and an electronic access device for controlling access to a secure area. The lock includes pins for locking and unlocking the lock. The access device communicates with the pins for electrically measuring movement of the pins. The access device stores an unlock pin code for the predetermined position of the pins for unlocking the lock. The electronic access device electrically measures pin movement by a key and determines a key code for the key from the pin movement. A control device electrically communicates with the electronic access device for identifying the key code and determining when the key code matches the unlock pin code.