View Single Post
  #4   Spotlight this post!  
Unread 23-01-2016, 15:19
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 357
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: QS18VN6LP: Wiring Diagram???

That's about as good as the diagrams get. Once you understand what it means, then it makes sense. The device has an NPN transistor output which means that it draws current into itself from a load connected to power and routes that current to ground. One "input" (pin 4) will turn on when the sensor detects a reflection. The other input (pin 2) is on without a reflection and will turn off once a reflection is seen".

The load in industry is usually a device that senses the current. In our case, its usually a pull up resistor. The device can sink maximum of 100 ma, so a resistor around 500 ohms would be good. That would allow it draw around 22 ma. (12-1) / 500 = 0.022 A (ohms law)

In summary, you have a resistor connected to 5V and to pin 4 or 2 of the device.

The voltage at the pin of the device would be measured to detect whether or not an object is present. The measuring is the issue, if you connect that to a logic input on the roboRio, it probably won't go low enough for a good logic low, (which is less than 0.7 volts). You can connect it to an analog input and tell if its less that 2.5 volts, and then consider it on.

We went through this last year and wound up running it through an opto-isolator which not only have us a nice solid logic low, it also separated the sensor from the 5 (or maybe it was 3.3) volts of the logic input. If you are interested in that circuit, let me know by responding or PM me.
__________________
Brian K
Team 1225 Robotics Mentor