What would be a sensor that I could use to detect if my desktop's CD tray has opened?
There are so many sensors to choose from in the Digikey catalog.
Should I use a mechanical component?
A light beam interference component?
Which one would allow me to detect if my CD tray is open such that the information can be fed into a PIC MCU?
I know I can do a system call for this sort of question, but I would prefer some sort of external sensor.