As you already, we need some mechanical detection mechanism too (project and concept). We would recommend you to use micro switches for this job. Micro switches are very simple and robust components that don't need a lot of complicated electronics.
A micro switch can have either 2 or 3 pins. A 3 pin micro switch consists of 2 power lines and 1 signal line. In this case, the switch will always have a stable output, namely the power line voltage. Use a 0V and a 5V power line. This will allow you to send the output signal straight to the micro controller. If you use a 2 pin micro switch, you only have 1 power line and 1 signal line. This is actually just a regular switch that is either connected or not. If not connected, the voltage on that line is random and will be "floating". In this case, you will need a pull down resistor in between the signal line and the ground to keep the voltage from floating when the switch is open.