I am working on a microcontroller project for a garage door opener. Rather than supply additional magnet+reed switches or other kind of detectors for sensing whether the door is full-open or full-closed, I would prefer to make use of the existing physical limit switches.
In the open state, there is 6.5V across the terminals of the limit switches, and in the closed state, there is about 5mA flowing through. Clearly there is already some current-limiting circuitry in the machine.
In order to provide protection/isolation for my microcontroller, I have been working with an MCT9001 dual opto-isolator chip. With a 1k-ohm resistor in the emitter (input) side of the opto-isolator, I am able to regularly detect the state of the limit switches. However, the garage door opener won't operate when both switches are closed, and with that 1k-ohm resistor, apparently there is sufficient voltage drop that the opener detects that the open switch is closed.
When I increase the resistor to 220k-ohm, the opener operates correctly, but now my opto-isolator isn't operating in saturation mode and so my microcontroller isn't able to reliably determine a clear logic-level signal.
I will continue to try different resistor values, but my question is: Is there a better way to detect whether a voltage is present without drawing any more than a miniscule amount of current?
I see examples of op-amp comparators, but if I power an op-amp with my project power supply, I would have to tie the grounds of the project board and limit switches together and would lose my isolation provided by the opto-isolators. But if I power the op-amp with the switch leads themselves, I (a) will draw too much current to run the op-amp and (b) will not have any power to operate the op-amp when the limit switch is closed.
Is the better solution to find the right resistor value tolerable by the garage door opener, yet which is not so high that the op-amp source emitter is too dim?