At the shop of my uncle, there is an old elevator that has an entrance at street level. Practically, anyone could walk in through this door and bypass the bell, so some form of elemental security in the form of a keycode lock to avoid such situation would be nice.
The elevator is made by Daelemans, and is controlled completely by electromechanical switches. I tried to take a picture of the 'machine room'. Because the space is very small, I tried stitching together multiple pictures with "hugin", but was not entirely succesful:
To call the elevator, every door has a button. When pressed, a 80V voltage is passed to one of the contactors shown on the board on the right. Originally, the idea came up to use this 80V to supply the microcontroller (and avoid putting more wires in the elevator shaft) and short circuit its power supply with a relay when the call button is pressed. This did not work in practice, the relay could not completely close. A separate power supply is necessary, but an 48V AC line is available in the machine room.
This 48V is used to make 24V (directly usable by the relay) and then finally 5V with an 7805:
All this is mounted on a separate "support board", that can be hidden inside the shaft, close to the call button:
Finally, a simple box houses a standard keypad and the STM8S Discovery board:
The pincode is stored in the internal EEPROM, and when entering a wrong code, there is a 8-sec delay before a new attempt can be made.