Use a bidirectional optocoupler for attached any PNP & NPN sensor type

I have 2 different 12v PNP & NPN proximity sensors, my first design was for each sensor type, have an identical PCB design with a normal optocoupler with a dedicated wiring arrangement my question is can use a bidirectional optocoupler for attached any PNP & NPN sensor type to the single PCB? is so how can add VSS VDD of input sensor to such bidirectional optocoupler?

I cannot imagine a "bidirectional" optocoupler as you understand it. You can use a single optocoupler if the output is generated only if both sensors are ON and the current flows from the PNP output through the optocoupler into the NPN output.

Otherwise each output requires its own optocoupler and resistor, to GND(-) from the PNP output and to Vcc(+) from the NPN output. On a PCB you can provide paths to both + and - and fit the right path with the required components.

Schematics please.

@DrDiettrich @anon57585045
how can convert 1 input signal to 1 output signal
from


to this

The optocouplers will release the magic smoke from their LEDs.

@DrDiettrich how come?!!
the input signal sensor can go through either of the diodes in opt, depending on sink or sourcing mode?

Follow the path from +12V, second diagram. Current goes through one diode, then another diode, to ground. So poooooooffff!

Other than that, I have no idea what you're up to.

@anon57585045 how about this schematic

It appears you're trying to re-create a photoMOS relay.

image

@dlloyd actually I am looking which components most be suitable if want to read any NPN-PNP proximity sensor with one connection

Hi,
I'm not exactly sure what you want.
But if you want a simple circuit to detect an ACTIVE output from an NPN or PNP output sensor, then just a simple opto-coupler circuit will work.
It just depends on how you connect it to the sensor.


If you want to make a PCB that you connect to an NPN or PNP output sensor, then put jumpers on the PCB to switch from NPN to PNP.
Tom.. :grinning: :+1: :coffee: :australia:

@TomGeorge and that's the whole idea, that how can get rid of two sensor connection or jumper for switch between sensors,

If you are not going to need to switch back and forth, on a single PCB, between PNP and NPN, use solder pads to bridge instead of jumpers.

Tom... :grinning: :+1: :coffee: :australia:
PS, You don't want to have a PNP and an NPN sensor connected to the same PCB at the same time?

He wants to provide a PCB that works off the shelf with both kinds of outputs. In so far#8 provides such a circuit. I only wonder about the diodes.

@TomGeorge sold pads or jumpers it's not an option for my small PCB, I was thinking I could sense the pulling down or up any sensor type by some pull-push circuit instead of using 2 different opts with different wiring

You can add a bridge rectifier around the optocoupler or use a bidirectional optocoupler.

@DrDiettrich bidirectional optocoupler has 2 pins, and I have 3 fix sensor pins (12v, GND, Signal), so it's not working with opt that way, that's why I'm thinking maybe can use MOSFET pull-push and Schmitt trigger to sense the pull-up or pull-down the signal

What we need is a short mini post, avoiding schematics and talk of different components, instead explaining the input and output parameters of the circuit, "what it must perform" as concisely and accurately as possible.

You have described some aspects of the system, but it is not completely clear which functions are internal, and which are external, to the particular circuit that you are asking about. Some detailed examples of the device circuits that you are connecting to, would help me understand how the circuit could be made to operate with two different kinds of outputs.

Once that is clearer, let the schematics fly.

One is for the signal and the other one goes to the resistors to the + and - supply.

I think you should call it a "BiPolar Interface", for both polarities of sensor.

If there was one, the industrial/commercial world would have it.

For PLC inputs to connect to NPN or PNP there are specific input modules for NPN or PNP or , usually jumpers or a program parameter to change the input type. Nothing automatic.

Post #12 is the most logical, one input module, 2 connections to the two relevant connections on the sensor.
If you want to make it fool proof, then fools should not be play with this gear.

Tom... :grinning: :+1: :coffee: :australia: