I have just finished my prototype for my combination lock. It is unique in several ways.
1. It is order sensitive. You must press the buttons in the proper order to open the door.
2. It is musical. Note blocks behind the buttons make it so the combo can be a tune. I think this is a nice touch.
3. It can have a lot of buttons. There is a theoretical maximum of 27 buttons in a straight line.
4. The combination is fairly easily configurable during construction.
5. The combination can be of any length. The size increases downward for longer combinations, but the footprint remains the same. Each button in the sequence increases the depth of the circuit by 4 blocks.
6. It is fairly easy to understand.
My prototype has 11 buttons and a combination of length 4. Maybe some pictures would describe it best:
Here's my button array and the door:
Here's the entire circuit:
Here's a better view of the circuit on each layer. It is basically and and gate and an RS latch. Pretty simple.
Here's the tower that transmits the state of the final latch back up to the door:
The circuit is really quite simple, just a pain to actually build. I used the depth extenders from this thread:http://www.minecraftforum.net/viewtopic.php?f=35&t=60816 since they can be placed down indefinitely, and only take 4 blocks for each layer. There are two versions that can be placed alternately to make a really compact set of buttons.
Each layer has a simple circuit. There is an RS latch that is reset by any button except the proper one for that digit of the combination. The set end is connected to an and of the layer above it and the input for that layer.
So if my combination is 1,4 I connect the first layer's set input directly to button 1, and the second layer's set input to (button 4 AND the output of layer 1) and so forth.
The hardest part was connecting the output of the latch to the next layer's input and gate. I found I needed a delay of about 6 inverters in order to ensure the signal would not reset before it reached to set the layer below.
All this may seem rather confusing, but it is really quite simple once you get the hang of it.
I made my circuit with 12 buttons, but then took out the rightmost button to make a reset line when I walk in the door.
The lock unfortunately does have a few limitations:
1. the reset will only work reliably with 27 buttons in a row maximum.
2. I would not recommend making a combination with repeated buttons in a row. It can lead to multiple active states and unpredictable behavior. It may be safe, but it may not be.
I would love any input for how to:
1. Improve the circuit to a smaller footprint, or a more compact button arrangement.
2. Describe it better. If anybody would like to make a picture of the circuit I would hug you.
3. I would like to have a reset timer so that the door will only be open for a few seconds before automatically locking again. Just not sure where or how to integrate that.
i have discovered that if i use the compass then it changes directions while i am trying to use it!
not that helpful really because it depends on the way you face and you dont always face the same way lol