While developing a robotic camera rig for panoramas, the need for a photodetector mounted above the camera Print button arose.
The sensor had to allow the button to be operated and be unaffected by bright, ambient light.
The solution is shown below.
A surface-mount photo-transistor is mounted in an aluminium tube that fits inside an O-ring.
The O-ring attaches to the camera with double-sided tape.
The tube is connected to the O-ring with resilient black vinyl material so that the Print button may be operated.
The electrical connections are to two gold-plated sockets spaced 2.54mm apart.