Roborio Digital inputs 12V tolerant?

I have an industrial NPN sensor that I’d like to wire to a digital input on the Roborio. I suspect this sensor is actually a push/pull, not an open collector. I’m powering the sensor from 12V. When the sensor is off, I get 11.3V on the signal line. When the sensor is on, I get 0.6V.

Is this going to be a problem to wire directly to the Roborio? Do I need to level shift or opto-isolated it?

It seems like you will need to limit the voltage going back into the system. This is a RoboRio 2.0 document but the same I think applies to a 1.0

https://www.ni.com/docs/en-US/bundle/roborio-20-umanual/page/umanual.html

1 Like

I’m aware of this document, but it doesn’t answer the question of what happens if you put 12V to one of those input pins.

We’ve only ever used open collector sensors because we don’t know what’s in the black box we call a RoboRIO and would prefer not to find out the hard way.

It says specifically 3.3v/5v compatible input. Id stick to the listed specs and not gamble on $400 worth of equipment for the cost of a level shifter. If it was meant to handle a higher range it would list it.

If something says it is 5V tolerant and you put 12V on it, you’ll be lucky if you only brick the GPIO. Use a resistor divider or a transistor/level shifter to be safe. A mosfet would work fine if you are ok wiring the pins on one, or a 10k ohm lower 20k ohm upper resistor divider on the output.

The expectation of an NPN digital switch for the roboRIO is open circuit (high resistance) between S and G or short circuit (low resistance) between S and G.

You might be seeing such a weak 11.3 V that it would be pulled down by the roboRIO to its safe limit of below 5.2 V. Maybe you could try putting a resistor like the roboRIO has access the sensor and measure the voltage.

I’m not much of an electrical engineer so don’t burn out the roboRIO on my say so. And now I have an interesting experiment to perform. I’m going to measure the voltage across some sensors we use.

Violating a published spec, such as for the roboRIO, is a bad idea. Not just because you may damage it, but experimentally determining that something works on version n is no guarantee that it’ll work on version n+1.

Ref: https://www.ni.com/docs/en-US/bundle/roborio-20-umanual/page/umanual.html figure 30.

I thought about using a zener diode in series to drop the ~12 VDC to, say, 4VDC, but when the input to the zener drops, it won’t conduct and the 40K-to-3.3VDC pullup will pull it high; you get a True either way.

A resistive voltage divider should work. Get your breadboard and a 40K resistor, wattage won’t matter because resistors don’t come that small. A pair of new, ordinary 1.5VDC alkaline batteries in series will give you about 3.3VDC (measure it!) and you don’t need a roboRIO at all.

Have your logic line power something like a LM7805 and have the output 5v from it be your signal. It’s better not to take chances.

From experience:

  • It’s likely nothing will be damaged (the RIO is pretty tolerant of 12v being applied to any pin)

  • you’ll see weird behavior on nearby dio channels

It’s been a few years and haven’t tested since but when inputting 12v to a digital input, I would see several other input channels read high for a short period.

The Rio was designed to be bullet proof. Even so don’t temp fate. Optical isolaters are cheap and easy to implement. I could look up all to do one tomorrow if that would be useful

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.