Alternative Distance Sensor

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!

Try using an encoder. It tracks rotation of the wheels


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

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.

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.

Here is thread about me using one

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?

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?

Here’s an alternative source for that series of sensors: Pololu - 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


code for VEX sensors should apply.

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


is a more reliable way to make sure they see the post, quoting them also tags them.

@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?

Okay so here is the colors for the neato

Red +5V
Brown LDS_RX
Orange LDS_TX
Black GND

Here is the colors for the Cortex

White TX
Yellow RX
Red 5v
Black GND

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.

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

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.