I have a precision tool post height gauge made by BIG Daishawa.
https://www.big-daishowa.co.jp/product_page/data_15_base-master.phpIt works based on a simple completion of a circuit, and it lights a small red LED on the body. It has no outputs and is a sealed enclosure that I do not want to open as it is calibrated and accurate to a micron, it is highly probable that attempting disassembly will render it inaccurate. What I want to do is to make an external fitting with a sensor on it that will detect when the light is on (with as little latency as possible) so that I can integrate it electrically into a CNC.
Basically the way these work is you put it on the bed of your machine and lower the tool until it completes the circuit, at that very first touch you know the tool is within a micron of exactly 50mm from the bed. Doing this manually isn't hard, but automating the procedure is very helpful, especially when using quick change tool holders or checking for tool breakage during long job runs.
Not wanting to reinvent the wheel I bought a 3 pack of Chinese made Uxcell 'adjustable' LM393 based light sensors that claim to use "Photo diodes" (but they look just like normal LEDs) and tried to use them.
https://www.amazon.co.jp/gp/product/B07X6CFKMT/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1I'm sure it will come as no surprise that they worked like crap, with a ton of unit to unit variation, none of which worked very effectively. Very hard to set a threshold that wouldn't false trigger and that would reliably indicate when the LED was on. I honestly didn't think detecting an LED would be much of a challenge, but when you have an expensive CNC with an expensive Carbide end mill moving on its own to depress the sensor of an expensive height gauge, you start reconsidering the quality of your hacks. I will protect the unit with a secondary switch, but I'd really like a reliable solution.
So what I'm wondering is, the LM393 (if it is really what it is, who knows with CN stuff) seems like a reasonable device. The photo diode they are using is completely suspect though. Since the LED outputs such a narrow spectrum of light, is there some issue using a photodiode? Should I buy a more reputable photo diode or a different type of sensor and replace it? Is there an alternative part or solution I should be trying instead?