First build this contraption with a piston and an observer facing the same way and a redstone line the leads into a repeater and then the piston.
Move five blocks from the front of the piston. From there move one block back and repeat the first contraption faction a different direction.
Repeat those steps until you get four of the contraption facing in these directions.
Pick two colored glass blocks, in my case I used brown red, this will be my combination, yours can be any color. All it has to be is glass.
Fill in the rest of the square with various colors. Remember not to repeat your combination anywhere else on the square. Also do not put any glass in front of the observers, that will kickstart it.
Dig out these holes and place levers underneath both glass parts of the contraption. Then place redstone repeaters in this pattern with redstone coming out of them.
Dig a trench under the glass connecting the lever on the right to the piston and observer on the right of it.
Place a line of redstone coming out of the left lever that leads to a repeater on one side of the glass and one on the other side. Then on the same side place a sticky piston facing a glass block.
Dig a two deep trench all the way around the outside of the lock and place redstone in it eventually leading to a sticky piston.
In the trench break two pieces of redstone next to each other and place a stone block with a redstone torch on one side of it. Have the signal going towards the sticky piston.
Where the two repeaters are that are next to the glass, replace that glass with any color of clay block. (Most blocks in the game will work instead of glass. But just to be safe start with clay.)
Place any block of glass in front of one of the observers. This will start the cycling the system.
The left lever will stop the system's movement and when on the right combination it will allow the signal to travel to the piston and open your underground base.
The right lever is used to restart the system and continue the cycling. The lever will only work if it's flipped on and off in a second and if the left lever is in the off position.
You can fancy the levers up and you can expand the system exponentially up to 12 blocks away. The system however will work without anything extra added to it.