Alternative Distance Sensor

  1. 10 months ago

    Does anyone know of an alternative distance sensor than the Ultrasonic Range Finder that would work with Vex EDR and RobotC? The Vex Ultrasonic Range Finder has a lot of noise and is almost useless. I've tried three different sensors and they all perform poorly. They have trouble sensing most surfaces and the results bounce around a lot.

    I'm only using the robot for personal use and won't be entering a competition, so I'm not worried about using official sensors.

    Any alternative range or distance sensors? Thanks!

  2. Try using an encoder. It tracks rotation of the wheels

  3. Barin

    11 Nov 2017 Arizona

    @rstar Does anyone know of an alternative distance sensor than the Ultrasonic Range Finder that would work with Vex EDR and RobotC? The Vex Ultrasonic Range Finder has a lot of noise and is almost useless. I've tried three different sensors and they all perform poorly. They have trouble sensing most surfaces and the results bounce around a lot.

    I'm only using the robot for personal use and won't be entering a competition, so I'm not worried about using official sensors.

    Any alternative range or distance sensors? Thanks!

    LIDAR.

    (More seriously, though, you could get something like this .)

  4. Foster

    11 Nov 2017 League Play, Event Partner, V5 Beta Tester Delmarva Chief Roboteer STEM Robotics

    I've used those infrared sensors on VEX Pic and Cortex and they work very, very well. Nice thing is they come in multiple sensing ranges, so you can use a long distance to start and then start reading the short distance one to zero in.

    These sensors have been on my "new feature suggestion list" for years. Maybe the new system will come out with them.

  5. tabor473

    11 Nov 2017 V5 Beta Tester Answer OYES, WPI

    Depending on what you want to do with it this sensor is really good and works easily with cortex and ROBOTC. 80$ and you get 360 distance measurements. Makes for fun hobby projects.

    https://m.ebay.com/itm/Neato-Robotics-XV-Series-Original-LIDAR-Sensor-Module-XV-11-XV-12-XV-14-XV-21/222687787820?_trkparms=aid%3D222007%26algo%3DSIM.MBE%26ao%3D2%26asc%3D20171010182013%26meid%3D8e8e270d72844300b7e2e9b389e88d84%26pid%3D100890%26rk%3D9%26rkt%3D12%26sd%3D191569604714&_trksid=p2056116.c100890.m2460

    Here is thread about me using one

    https://www.vexforum.com/index.php/19737-wpi-lidar-explanation/0

  6. (More seriously, though, you could get something like this .)

    Thanks Barin.

    1. How do I connect the sensor to the Cortex Microcontroller? Do I need a special cable?
    2. How do you get readings from the sensor in RobotC? Could you share any code?
  7. Depending on what you want to do with it this sensor is really good and works easily with cortex and ROBOTC. 80$ and you get 360 distance measurements. Makes for fun hobby projects.

    tabor473: That is a great option.

    1. How do I connect the sensor to the Cortex Microcontroller? Do I need a special cable?
    2. How do you get readings from the sensor in RobotC? Could you share any code?
  8. Barin

    11 Nov 2017 Arizona
    Edited 10 months ago by Barin

    @rstar Thanks Barin.

    1. How do I connect the sensor to the Cortex Microcontroller? Do I need a special cable?
    2. How do you get readings from the sensor in RobotC? Could you share any code?

    Here's an alternative source for that series of sensors: https://www.pololu.com/category/79/sharp-distance-sensors

    For use with the Cortex and measuring distance, you will want one of the analog sensors that works on 5V.

    As for the actual connection, you need to start with this cable for most of the sensors in that series. The most foolproof way to establish a connection to the Cortex would probably be to cut off the end of a VEX 3-wire extension cable and solder the newly exposed ends to the aforementioned cable, matching all 3 colors between both cables (red to red, black to black, and white to white).

    Then plug into an analog port, set the port to type 'Analog' in the Motors and Sensors Setup, and the same SensorValue[] code for VEX sensors should apply.

  9. tabor473

    12 Nov 2017 V5 Beta Tester OYES, WPI

    @rstar tabor473: That is a great option.

    1. How do I connect the sensor to the Cortex Microcontroller? Do I need a special cable?
    2. How do you get readings from the sensor in RobotC? Could you share any code?

    So coming out of the sensor is 2 sets of wires
    4 wire uart
    2 wire motor control

    The 4 wire uart needs to be cut and wired into a 4 wire connector and plugged into a UART port( 1 or 2)
    The 2 wire motor needs to be cut and wired to a motor controller, either directly to ports 1/10 or into ports 2-9 with a motor controller.

    A forum user made this video to show how to do wire repair and it is exactly the same.

    I would also be happy to share some code, just would need to find it and clean it up a little, next couple of days.

    Also for the future tagging someone with @tabor473 is a more reliable way to make sure they see the post, quoting them also tags them.

  10. @tabor473 , Thanks for posting the follow-up details and the tagging note.

    I've purchased the Neato Robotics LIDAR Sensor Module. The four wire uart has red, brown, orange and black wires. The Vex 4 wires have Black, red, yellow, and white. What is the combination to connect the wires? I'm assuming black to black and red to red. How about the brown/orange to yellow/white?
    Thanks

  11. tabor473

    17 Nov 2017 V5 Beta Tester OYES, WPI

    Okay so here is the colors for the neato

    Red +5V
    Brown LDS_RX
    Orange LDS_TX
    Black GND

    https://xv11hacking.wikispaces.com/LIDAR+Sensor

    Here is the colors for the Cortex

    White TX
    Yellow RX
    Red 5v
    Black GND

    https://content.vexrobotics.com/docs/276-2194-Rev1-PINOUT.PDF

    One tricky thing to remember is TX goes into RX and RX goes into TX (they stand for transmit and receive) so final answer is.

    White - Brown
    Yellow - Orange

    Code to follow.

  12. tabor473

    17 Nov 2017 V5 Beta Tester OYES, WPI
    Edited 10 months ago by tabor473

    Okay so I pulled out all the applicable code from when I used the XV_11 lidar with the cortex.

    You can see a function of it being used to detect objects as an example usage
    https://github.com/gftabor/Cortex_XV11/blob/master/XV11_Lib.c#L623

    This is the function you call to get the lidar data.

    getLidarData(UART1, dist);

    If that was put in its own task on loop it would just auto update the dist array.

    short dist[360];

    You probably only need the code in XV11_Lib.c but I uploaded all the code.

 

or Sign Up to reply!