View Single Post
  #6   Spotlight this post!  
Unread 05-02-2016, 22:55
Donut Donut is offline
The Arizona Mentor
AKA: Andrew
FRC #2662 (RoboKrew)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Goodyear, AZ
Posts: 1,289
Donut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond repute
Re: PNP versus NPN sensors

Quote:
Originally Posted by Kevin Sevcik View Post
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.
Pay particular attention to this as many common PNP sensors output the same voltage they are supplied with, which is typically 12V or more for the sensor to function (5V is not a common supply voltage for industrial environments that are the target market of most sensors).

Another option is to use an interposing relay to convert from PNP to NPN. Get a relay with a coil rated for the output voltage of the sensor, connect the signal wire of the sensor to the positive coil lead and a common wire to the negative coil lead. Then connect the RoboRio input to the NO lead of the relay output and a common wire to the common lead of the relay output (these will be the only leads on a SPST relay, make sure to use NO and common if using a SPDT relay). You can use this same method to convert between different voltage levels also (using a 12V PNP sensor to trigger a 5V sinking input, just have to feed 5V to the common side of the relay output).
__________________
FRC Team 498 (Peoria, AZ), Student: 2004 - 2007
FRC Team 498 (Peoria, AZ), Mentor: 2008 - 2011
FRC Team 167 (Iowa City, IA), Mentor: 2012 - 2014
FRC Team 2662 (Tolleson, AZ), Mentor: 2014 - Present