In the previous Redstone for beginners tutorial we’ve covered the piston door. But why not lock your room with a passcode? There are many ways in which you can create a passcode for your door, let’s focus on a lever lock here.
A lever lock is not that hard to build or understand. You can make them as big or as small as you want. I have an example of a small lever lock first, with only two levers.
Here you can see a small lever lock. The redstone lamp turns on when someone submits the correct code (of course you can hook up the redstone torch to a piston door instead of a lamp).
How does it work? The goal is to turn on the redstone torch going to the lamp. For that, we need the redstone going into it to be off. This can only be done by using a certain combination of the levers: some of the levers have a regular redstone behind them (so to turn their signal off, the lever must be turned off). Other levers have a redstone torch behind them (so to turn their signal off, the lever must be turned on).
The point is that people don’t know which levers have redstone torches behind them and which levers have a regular redstone behind them. Apart from you obviously, because you know the code. You can expand this design by simply placing new levers with redstone or redstone torches behind them. There doesn’t need to be a space in between the levers like in my example, that was just so it’d look nice 🙂