Announcement

Collapse
No announcement yet.

Connecting Sensors to Rev Expansion Hub

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

  • Connecting Sensors to Rev Expansion Hub

    Hi,
    We are having some trouble with sensors and the new rev expansion hub. Is it possible to connect the modern robotics touch sensor to the hub? If so is there a special cable we need?

    Thanks,
    Member of team 12013

  • #2
    See the REV Hub Expansion Guide - legacy sensor information is in section 4. https://www.revrobotics.com/content/...31-1153-GS.pdf

    The MR touch sensor specifically is on pg. 20 - a custom wiring harness is needed.

    Comment


    • #3
      Yes, we saw that but we were a little confused about what a custom wiring harness was and how we would get one.

      Comment


      • #4
        AFAIK there is no buy, as yet, there is only make.

        Page 2 of the Rev guide has the pin out of the digital ports.

        The MR sensor page tells you the pin out of the touch sensor.
        http://modernroboticsinc.com/touch-sensor-2

        Either buy the parts, wire, and crimp tool at your local hobby shop to make a female connector for the touch sensor (look for servo stuff)
        or cut a servo extension cable in half.

        Probably easiest to cut a 4 pin REV JST PH cable in half.
        Solder power to power, ground to ground, and touch signal to one of the two signal port wires on the REV JST.

        On further research, if you want to be able to use both ports that are available on one connector on the REV hub and use their sensor splitter cable, you'll want to wire to the REV white signal wire.

        http://www.revrobotics.com/REV-31-1386/

        Comment


        • #5

          If you happen to already have the $1 crossover cable from REV, and the Level Shifter used for other MR sensors and NeveRest motor encoders, you can connect the MR touch sensor to the REV Hub. You'll need:

          Logic Level Converter (Level Shifter), $3.00
          https://www.revrobotics.com/rev-31-1389/

          JST PH 4-pin Sensor Cable, 30 cm for $1.00 each
          https://www.revrobotics.com/jst-ph-4...-cable-4-pack/

          Sensor Cable Adapter (Crossover Cable), $1.00
          https://www.revrobotics.com/rev-31-1384/


          1. Plug the REV 4-wire Sensor Cable into an Analog port on the REV Hub.

          2. Plug the other end of that Sensor Cable into the Level Shifter.

          3. FLIP and plug the black connector of the Crossover Cable into the other side of the Level Shifter. Namely, install it backwards, with the white wire in the labeled +5V position.

          4. Plug the MR touch sensor into the other end of Crossover Cable: sensor black to yellow ground, sensor yellow to black signal (Channel A), sensor red to white 5V. The red pin Channel B is exposed/unused.

          Study the connections, and you'll see that each sensor wire reaches its correct pin at the REV Hub. If curious, see the REV Expansion Hub pinout diagram on Page 2 here:
          https://www.revrobotics.com/content/...31-1153-GS.pdf

          5. Configure the higher port number (of 2 shown on Hub) as Analog Input. Yes, the higher port number is Channel A. Do *not* configure as MR Touch Sensor, this will not work. Name the device, such as "MR_touch" or other preferred name.

          (The following steps are for Blocks programming, easily convertible for Java users.)

          6. After saving/activating that Config, open the OpMode. Make a custom Variable named IsPressed, or other preferred name. Initialize/set this variable to (Logic value) false.

          7. Find AnalogInput under Other Devices. Pull out the Voltage block.

          8. Inside the appropriate repeat loop, IF MR_touch.Voltage > 2 DO set IsPressed to (Logic value) true, ELSE set IsPressed to (Logic value) false.

          9. Use Telemetry (text) to display the IsPressed true/false value and ensure it's working OK.

          That's it! Now you can use the IsPressed value as desired, such as to exit the repeat loop or start/end other actions.

          If curious, you can use Telemetry to also display the numeric value of MR_touch.Voltage when the sensor is pressed vs. not pressed. But don't use that value, just use IsPressed.

          All these steps would be avoided by making a custom cable as suggested above by 3805Mentor, or of course by simply buying a REV touch sensor. But some teams can't easily do either, so here's a way to still use that touch sensor.

          Comment


          • #6

            To connect a Modern Robotics touch sensor to a REV Expansion Hub, here's another, easier no-soldering solution that requires only a $1 purchase on eBay.

            This does assume you already have:
            JST PH 4-pin Sensor Cable, 30 cm for $1.00 each
            https://www.revrobotics.com/jst-ph-4...-cable-4-pack/

            Search eBay for: Dupont ribbon cable "male to male". Sort by price, to show many choices under $1.00 including shipping.

            When you receive it, peel off a 3-wire section. Don't worry about the colors.

            At one end of this 3-wire ribbon cable, arrange all three male Dupont pins flat, side by side, to match the standard 0.1-inch spacing. Plug that group into the touch sensor connector. Wrap the connection neatly with tape.

            At the other end, find the two Dupont pins connected to the sensor's red and black wires. Arrange those pins such that the shiny/square openings of the black plastic body are facing each other. This brings the Dupont pins closer together, to match the tighter spacing of the JST connector. Verify you are connecting sensor-red to JST-red, and sensor-black to JST-black. Pinch this pair and insert it into the JST connector; requires some wiggling and a firm push, to install nearly to full depth.

            Insert the third Dupont pin to connect to the blue JST wire. It's further away from the other 2 pins, so there's plenty of space for the black plastic body.

            Wrap the entire connection neatly with tape. Use a Sharpie to place 3 small dots on the tape, each in line with the JST red, black and blue wire. This indicates the 3 live JST wires (of 4).

            That's it! You now have a "Custom Wiring Harness" as required by the REV Expansion Hub Guide, page 20.

            Plug the other end of the JST cable into the 0-1 Analog port of the REV Hub. The blue cable is port 0. (If you use the 2-3 Analog port, the blue cable is port 2.) Configure that port as "MR Touch Sensor" which is a menu choice. Name the device, such as "left_touch" or other preferred name.

            (The following steps are for Blocks programming, easily convertible for Java users.)

            After saving/activating that Config, open the OpMode. The Sensors menu now contains TouchSensor, with just one available Block: "IsPressed". This holds a Boolean value of true or false.

            In a Repeat loop, use Telemetry (text) to display IsPressed and ensure it's working OK.

            Comment

            Working...
            X