Do yourself a favour and use an optocoupler.
If no galvanic isolation is needed: 1x PNP + 2 Rs ?
But the basic question is WHY do you need to convert it?
Sensor out (OK, open collector?)
Thank you for your answer!
I was thinking of a relay because I have some here already in the drawer. I am not concerned about life of the component due to the number of ON/OFF cycles.
The reason I need to convert my NPN (open collector) sensor is because my DAQ card has sinking inputs. I cannot buy the same sensors but PNP unfortunately.
Hope it helps!
Sinking input... how about a simple pull up resistor?
Relays are bouncing, have back EMF ...
I have tried already to put a resistor (see the picture attached), but the DAQ is always seeing the DI0 input at "high".
When I unplug the resistor from the 24VDC+ source, the input goes to 0.
When I "run" the sensor, nothing happens.
Maybe I am not doing it right?
It would be helpful if you tell us the type of DAQ.
link to spec?
(while at it, for the sensor too?)
Seems that the OC output can't sink the current, together with the DAQ input signal levels one could find a solution BUT we (I) need the specs!
Try a voltage divider with 2x 10k where the resistor to COM is 'short cutted' by the OC output.
The FT-210 sensors generates a variable frequency according to the flow and not only an ON/OFF output.
How do you plan to read this signal with the NI-USB 9241 ?
I would use :
1) A frequency to voltage converter IC and a DAQ interface with an analog input.
2) Or a DAQ interface with a counter input to measure the frequency.
I would like to retain the NI9421 that I have, but I thought its digital input was capable of measuring frequencies using the chassis counter (cDAQ).
A simple 10k to 20k pull up resistor should work ... the 2.2k you used results in a 11mA current that run the 9421 into current limit.
Do you have an oscilloscope (or know someone, who ... ) to monitor the voltage at the DI?
If you poll the input, you need to know the minimum pulse length, to choose at least half sample time.
(with a 50% duty cycle and 915Hz pulse frequency, at least 2kHz , with 25% duty cycle you need 4kHz)