This electronic circuit turns on a relay by pressing four keys in the correct order. The circuit works by a CD4017 and a combination of logic gates.
At the start condition the CD4017 turns on the first output, which is connected to the first gate of the CD4081. By pressing the correct key (P1) both inputs of that gate take the high level. Pin 3 of the CD4081, then pin 1 of the CD4072 turns on and activates the clock relay K1, which keeps on for about 0,5 seconds due to the capacitir (the key should not be pressed for a longer time).
Once the last key is pressed the relay K3 turns on. The counter backs to the start condition by pressing any key.
The CD4030 consists of 4 EXOR gates. Each of them has two inputs: the first one is connected to a key, the second one is connected to an output of the CD4081. If a wrong key is pressed the inputs of the related EXOR gate take a different level, so the output turns on and activates the reset relay K2 by pin 13 of the CD4072.
The circuit has been tested with a 9Volts battery. If you use a power supply a debounce filter may be required on the clock pin of the counter.