I have a big wardrobe in a dark room, I put leds inside and I want to light them up when the door (sliding door) opens. What's the cheapest and more robust way to detect door opening, with less damage to the door itself.
- IR detection, emitter and receiver in the frame and mirror in the door.
- hall sensor, adding some magnet in the door and sensor in the frame
- capacitive sensor, adding some metal in the door and sensor in the frame
so, cheap easy and robust?
What about this: http://www.dx.com/p/reed-switch-magnetically-controlled-switch-golden-5-pcs-306815#.U8fLU_mSx8E so I just glue a magnet in the door and set this guy in the frame as a switch between +3.3V and a reading gpio and .. that's all, isn't it ?