PNP versus NPN part 2.

I happen to have some 12V PNP prox sensors laying around. Out of curiosity, I hooked them up to the Analog input. I know the input isn’t rated to 12V on the Roborio - but I knew it was short protected to battery voltage so I shouldn’t damage it. I was happy to see the sensor reading up to the Analog limit, and it didn’t seem to trip or reset the rail when I made unmade the switch, but the voltage did vary from zero to max when made and unmade so I knew it was functioning correctly.

So I figured - why not? I hooked the 12V up to the DIO rail as well and it functioned just fine.

So - since we know the Roborio is short protected against 12V, while it’s not recommended to run it that way, will this cause any other unforeseen issues that I’m not seeing now on my bench?

I don’t have a good answer but good on you for trying this.

Maybe there’s a current limiting resistor somewhere getting toasty?

Shouldn’t be a current limiter problem - I verified the output current of the switch is so small that even at 12V the total wattage is well inside what the Rio docs say it can handle.

It’s been a good night - I got the pixy working over I2C in LabView as well.

Now I just need to go back to this stupid Lidar sensor. Sharp IR in a couple days.

What is the range of supply voltage that your sensor can work with? Can it work with a 5 V supply? Is it a digital output type? If you must run the sensor from a 12 V supply, use a resistor divider on the output to limit the voltage applied to the RoboRio to something between 3 V to 4 V. A 10 kOhm connected between the sensor output and the RoboRio input and a 4.7 kOhm connected between the RoboRio input and the 0 V pin should do the job.

The usable input range of the Analog Inputs is 0 V to 5 V so running your sensor gives no useful information after the output voltage goes over 5 V.

The RoboRio specs do not seem to show what the protection level is for the Digital Inputs.

In general, it is bad practice to apply signals beyond the nominal input range (0 V to 5 V). Your sensor output impedance may be high enough to let you get away with it.

The ±16 Overvoltage Protection spec means that NI installed devices that clamp at about ±16 V. Such specs are to show what the device will survive without permanent damage. The device is not meant to work at that operating point.

The spec does not show any Maximum Input Current spec which may mean there is no input current limiting resistor. If your source has a low enough impedance, you can drive sufficient current through the clamping devices and blow them off the board. Your actual input circuitry will blow about a micro-second after.

There are no clamping devices indicated on the Digital Input/Output pins and it is highly unlikely there are any because those pins can be used as outputs. The Digital I/O also has a nominal range of 0 V to 5 V. It is probably the clamping devices built into the I/O chip that is doing the clamping of your 12 V signal. They will be much smaller than any external clamping device and will blow at much lower currents.

The input is 10-30V - it’s a fairly standard SICK IR prox. The voltage divider is the easiest way, but I was curious as to how apply the 12V to the rails would affect them. We’ve accidentally applied 12V to the rails before glares at team members.

I see you’ve discovered that ‘rated for’ doesn’t exactly mean ‘absolute maximum’.

The Analog inputs make use of a controlled buffer within its MUX (driver, 1:1 amp, whatever you want to call it), which then go to an ADC. You’ll find that, like most buffers, it doesn’t really care about input voltages, but since it is 1:1, it will ‘follow’ that voltage when activated. Since the VCC going to that chip is likely 5V on the RIO, it will cap at 5V. The voltage buffer doesn’t really mind if you give it 12V, although it will be pretty useless since you can only read 0-5V.

Digital channels on the RoboRIO are tristate compatible, which means they have a similar controlled buffer on the output, whose output loops back to the input. This allows a pin to act as both an input and output. NI doesn’t specify whether they use a voltage buffer on the input, but it is very common place to do so (whether inside the FPGA or otherwise).

Either way, putting 12V into a 5V sensor line isn’t the best of ideas, but it certainly won’t fry anything, at least in this context.

EDIT: You can find most of this info in the RoboRIO User Manual / Specifications (here and here).

Be cautious with this. My comments may not be universally true but are based on a few decades of designing industrial controls every day.

The positive overvoltage protection on most of the analog inputs I’ve seen or designed includes a diode from the input to the positive power supply rail of the microcontroller, FPGA, whatever. This diode keeps the microcontroller pin from seeing voltages beyond one diode drop above the rail voltage. A possible undesirable side effect of this is injecting current into the power supply downstream from the voltage regulator. Normally this is no big deal.

HOWEVER, if you do it with a bunch of inputs you can inject enough current to bring the power supply out of regulation, possibly fatally damaging your expensive gray box.

Experimentation is fun until the magic smoke gets loose.

What in this context will allow 12 V to be applied to the Analog Inputs of the RoboRio? Do you have access to detailed internal schematics of the RoboRio that show what specific chips are used?

Most (over 99%) of the chips on the market are not designed to tolerate having voltages higher than the supply voltage applied to their pins and are easily damaged by such treatment. The voltage range between the maximum nominal input voltage (usually the nominal supply voltage, 5 V here) and the absolute maximum input voltage is not a range that is meant to be used. First of all, proper operation is not guaranteed. With some device designs, pulling the input pins can cause large internal currents to flow, leading to a condition called “latchup” where the device stops working. Proper operation only resumes after all voltages are removed.

The internal protection diodes you are writing about have a pretty low current capacity, usually in the order of milliamps. As described in my first post in this thread, once this current capacity is exceeded, the diode will most likely blow open, leaving the internal circuitry un-protected. The internal circuitry then blows microseconds later.

My comments come from over 30 years of experience designing the circuitry that goes into industrial controls, such as the RoboRio, as well as the circuitry to protect them from harsh conditions such as over-voltage conditions. Working at a chip manufacturer also gives me an insiders view of what goes in such devices.

Voltage buffers usually do have a fairly high tolerance for overvoltage (rather, they aren’t as touchy as other chips), since their input impedance is extremely high, and due to the nature of their application, especially in amplifier configurations.

If you open up a RoboRIO, you’ll find a chip containing a quad op amp nearby the Analog In pins. The traces that connect it are not visible, but it’s a pretty good indication given its locality and 4 op amp channels (= 4 analog ins). The chip is a LM2902k, and according to the datasheet, it has a maximum differential input voltage of +/- 32V (supply voltage ranges from 3V to 30V, 32V absolute max).

Keep in mind the RoboRio is not your typical industrial device. It has been hardened to take abuse of novices. My notes are on another computer so I am speaking from memory. Take this with a grain of salt. (Also I am not replacing you rio is you blow the IO) The IO on Rio was tested with 12 volts. (Actually the overload protection is ± 16V) My understanding is 12 volts will not hurt it. The Digital logic input is actually based on 3.3 volts. Yes I know the supply rail is 5V. (set by Jumper) That is why many 12 volt sensors work erratically with the Rio. Their output will not pull low enough for the Rio’s input to read zero. The analog input is a work around because you can pick your threshold voltage. Of course the OP is using a PNP sensor which will not work on the DI without some other circuitry to invert the signal.

The diodes I’m referring to are added external to the protected device and can tolerate a couple hundred milliamps.

Believe me, I’m in no way suggesting that connecting 12V to a roboRIO analog input is a good idea.

The tolerance of 32 V being applied to the inputs is only valid when the supply is also 32 V. When connected to a single +5 V supply, the maximum input voltage is +5 V.

Having spoken directly with chip designers and applications engineers at many different chip manufacturers, they are all in agreement that the general rule is to never exceed the voltage on the power supply pins. Some manufacturers do a better job of making this point clear on their datasheets than others. I have also seen coworkers prove that the chips will blow up if the input pins are taken beyond the power supply range.

TI recommend the Input Common Mode Voltage, VCM be Vcc - 2 V as a maximum (Vcc = positive supply) in Table 6.3

ST recommends VCM be < Vcc - 2 V or Vcc - 1.5 V, depending on temperature, in Table 2

On Semi recommends VCM be < Vcc - 1.7 V in Note 5 at the bottom of page 3

There are a few devices available that do allow the inputs to be at voltages above or below the supply pins but this ability is very prominent in the part description. The LM2902 makes no such claims.

I would put some combination of resistors and zener diodes to bring that high level down to 5V or less. The last thing you want to do is get your students in the habit of designing for what they can get away with rather than design/rated specs, especially as this doesn’t give up any competitive advantage (and may confer some).