|
Re: PNP versus NPN sensors
RoboRio DIOs have a pullup resistor, which is why connecting an NPN directly to them can work. To make a PNP output to it, you basically need to reverse this situation. Connect a pull-down resistor from the signal pin to ground, then you can connect your PNP output to the signal pin as well. Your pull-down resistor will have to be low enough resistance to overcome the pullup resistor, but high enough resistance that your PNP output will still drive the volts high enough to register as a high level on the DIO.
For DIO 0-9 and DIO 0-13 on the MXP with the 40kohm resistors, a pull down of 10k would barely be enough, 5k pulldown would be safer.
An important caveat is that this only works with 5V PNP sensors. A 12V PNP output is going to blow up your DIO port unless you use a more complicated circuit.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|