During simulation in Proteus ISIS, i simulated the inductive proximity sensor as a switch. the circuit didn't work, and i get always 0V at the uC input, what could be wrong with my drawing?
I think you may be missing a resistor from Q3's collector to Vcc. Also the MCU input needs a pull-up resistor.
All other questions are contingent on your circuit being correct which it cannot be as mentioned above. However I will say this, if the contact is attached to 24V and you fed that to a micro then micro = dead.