Announcement

Collapse
No announcement yet.

How to use an optical sensor?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use an optical sensor?

    Hello.
    We found a couple of 42EF-D1 MNAK-A2 optical sensors and we're thinking about using one of them to detect when we've crossed a tape marker (zone boundary). I found a site with lots of information (http://www.ab.com/en/epub/catalogs/1...212/print.html), but I'm new to this type of device and still can't tell exactly how to hook this up. It looks like I might need to connect the output to a DigitalInput so that it will either leave the DIO input high or pull it down to ground, but I'm really not sure. Anyone know? Or have a better idea?
    Thanks.
    Jeff

  • #2
    Re: How to use an optical sensor?

    You're heading down the right track.There are a few caveats to using a sensor like this with the roboRIO:
    1. The sensor requires t least 10.8V to power it. The 12V rail of a VRM could be used for this.
    2. I didn't track down an exact datasheet for this sensor, but it's possible based on the max leakage current listed that you would need an additional resistor to provide a stronger pull-up than the 40k to 3.3V the roboRIO provides. These sensors are the sensors that were provided in the 2011 KOP and some users seem to be reporting success with them in this thread with no additional resistor so it may be worth testing as is to see if the resistor is necessary or not: http://www.chiefdelphi.com/forums/sh...hreadid=133484

    Wiring should be:
    Brown to +12V
    Blue to Ground
    White or Black to roboRIO DIO signal pin

    Then use the DigitalInput class in code to read the value.
    FIRST®
    FRC Robotics Engineer

    Comment


    • #3
      Re: How to use an optical sensor?

      Hi, Kevin. Thanks, as always. Let me make sure I have this...When you mention an additional resistor to provide a stronger pulllup, you mean an additional resistor between the DIO input pin (sensor output pin) and VCC, right? Something in parallel with the internal pullup so as to reduce the effective pullup resistance of the pin (resistors in parallel) and thus pull the pin harder to VCC when it is not being pulled low? For instance, an additional 40k would reduce the pullup resistance to about 20k, not so low as to pull too much current when the pin is pulled low, but low enough to pull the pin hard high when it is supposed to be high?
      Jeff

      Comment


      • #4
        Re: How to use an optical sensor?

        Exactly. It obviously can't draw the max spec of .1mA as .1mA * 40kOhms = 4V drop across the pull-up. Per the roboRIO specifications you should provide at least 2.0V for logic high. That means that 1.3V can drop across the pull-up if you're connecting the additional pull-up to 3.3V. This would make the max combined resistance 1.3V/.1mA = 13kOhm so a 10kOhm would be a good bet. Alternately, you could add a pull-up between the DIO signal line and 5V (the reason you would do this is mostly because it's right there on the same connector).

        However, it sounds like the actual leakage current @ 3.3V may be less than the 30uA required for logic high to be registered when it's off (based on the reported success of using it directly with the roboRIO) so I would check without the resistor first.
        FIRST®
        FRC Robotics Engineer

        Comment


        • #5
          Re: How to use an optical sensor?

          Thanks very much, Kevin.

          Comment

          Working...
          X