I have a control board which uses relays to control electromagnetic door locks and also processes inputs from locks microswitch (to detect open door) and some PIR sensors via optocoupler to a MCU. Those inputs are dry contacts - which means I provide 12v to the COMMON contact of microswitch. NO contact of microswitch goes to the input of 817 optocoupler and GND to the 817 GND.
This works fine, however I need to also process contact from a LD2410 presence sensor, which gives just 3.3v TTL output. I have modified the board to not feed 12v on some channels, however I have tested it, and 3.3v is not sufficient to drive the 817 (even on breadboard, not considering 50m of cable), therefore I need to either convert the 3.3v output to ideally 12V or to convert it to dry contact.
What would you recommend? The connection between control board and the sensor is about 50m of cat5e cable, I will put 12v via cable to local breakout PCB where it will be converted to 5v (which is working voltage of the sensor). Current over the loop to 817 is only about 5mA.
Should I use transistor(s)? As all 817 inputs on my board have common GND, I would need to use a high-side switching. NPN+PNP or MOSFET? If MOSFET, is one N-channel enough, or do I also need 2?
Or use some kind of level shifter? Can it shift from 3.3v up to 12v?
Or SSR? That would convert it to dry output and allow me to use the same channels on the control board instead of the need to customize them.