Ultrasonic Sensors

Hello, sorry if this has been answered before.

Are any other teams using ultrasonic sensors to sense the other robots on the field, and are you having any success?

What sensors work with the Labview VI’s given to us?

Last year I was looking for some ultrasonic range finders for our bot and I through a response on chiefdelphi the LV-MaxSonar was recommended to me. It outputs the range to an object in several ways including serial, analog voltage, and pulse width. Of these methods I would probably choose the analog voltage since you only need to multiply this by a constant to resolve the range. The distance calculation is already done for you!

here is the website for the sensor.

Hope this helps!

ok, and it works with this years labview software VI’s, and easily hooks into the hardware of this years control system? (our team was only in FRC in 2006, when you had to do everything in c++, so we don’t know really what was used last year)

Dear PWHSrobotics,

Yes, the MaxSonar sensors will work. Please see thread below regarding use of MaxBotix Sensors.


If you have any questions, please let me know.

can people tell me how accurate these things are? (inches, feet, cm, etc)

I need to know to finish my proposal to the team and accuracy could help convince some of the people on the team. 100$ a piece is a bit pricey for my team.

Thankyou in advance for your help

You don’t need the $100 waterproof model.
FIRST robotics teams use the $30 models.

They are accurate to inches.

You’re looking at the wrong ultrasonic sensors I think.

Scroll down the page a bit. They go from $100 (some new one that I haven’t seen yet) to $30, the one I have seen.

Also… here’s my experience from them. Being a total newbie programmer, I tried to work on autonomous for IRI this year. If anyone was at IRI and on the field while Team Fusion was out there, I’m sorry for any damage we did.

That should pretty much sum up my experience with them. I did find that the readings were really good though. I just couldn’t get them to work for me properly.

seems that within one inch is good enough, my question is, if our target is at an angle, will it return the distancefrom that angle to the object, or will it just give me the shortest distance , or what?

Also, there are more than 1 at 30bucks, any one do better for FIRST purposes than others?

no, they wont give you and angular info. They will only give you the shortest distance read within the beam pattern. If you want to get angle info you can use two of these sensors (they will need to sound at different times to not get them confused) and by knowing the distance between the two sensors you can use trig to get angle info. We are thinking about using the camera to track the goal and then use the sonar to range. might be more accurate than the camera ranging.

ok, my only worry, is with that beam width, it will cause me to get scewed results if my target is at an angle.

Thanks for all the helf.

Has anyone tried using the camera for ranging information? Is there a canned routine in Labview to do that? Any feedback on how accurate it is? We are using a camera to track the the opposing trailer and need range feedback to feed to our shooting mechanism. We almost have all of the mechanical stuff worked out, time to program and try to make it all work now. Nothing like saving the best for last.

If you look at the tracking example, some of the outputs from the code include blob area and min and max X and Y values. You could correlate the area to distance, but that won’t be very accurate. You could take the difference in Ymax and Ymin which should correlate very well to perceived height, which correlates very well to distance…

Please be aware there are some issues using the Analog output of the Maxbotix sensor.

#1 There is a “bump” if you have a large change in distance. The sensor will overshoot the actual distance and then ramp back down to the correct one. You can filter this using averaging, but it will slow the response.
#2 Don’t expect to be able to use these to track or range other robots. They respond too slowly. Last year, at full speed using these sensors, we had to stop when the sensor hit 48 inches because of the response time. If we did so, it was actually hitting the brakes at about 18 inches, and stopping with 3 or 4 inches to spare.

What you CAN do with these is use them for collision detection. You can also aim them at a continuing obstruction. For instance - aim it a wall that you’re traveling next to. You can keep track of how close you are to it.

I do not know if the other outputs of the Maxbotix will exhibit the same behavior. I’d suggest purchasing one and working with it before you decide it will solve your problems.

For static ranging, however, they are VERY accurate. Consistently within less that an inch.

We got our sensors today, but have a question

  • How are other teams hooking up the sensors to work with the built in Ultrasonic VI’s given to us in labview?

any help or a link to a topic that this was already answered in would be much appreciated :slight_smile:

I’m not a labview programmer, but as I understand the built-in ultrasonics routines are for digital ultrasonic sensors(the system sends out a ping and then waits to hear the returning ping). The maxbotics has a coprocessor that does this, so instead of using digital pulses, it just sends you back an analog value, which you can read the same way you’d read a potentiometer.

We have set up a routine for doing this, it works ok, but we need to do some more work on our shooter system to get consistent shooting speeds (speed sensor so we can command a specific shooter RPM for the detected distance, rather than just sending a PWM value to the shooter speed controller).

We played with an ultrasonic sensor a bit to see if it would work…didn’t really see any advantage to it. Although we did not try aiming it up at the vision target, which might work better. The problem is the beam width requires the shooter to be aimed right at the target before it can get a good range number, whereas the camera routine only needs the target to be in the field of vision, which is much wider.

The maxbotics will send PWM values or analog values. Take your pick.

If you use the analog values, you can simply read the analog channel and divide by a constant to get number of inches.

No idea about the ultrasonics sensor VI - it was easier for me to do it the way I stated since we used them last year.

I’m not sure how to get the sensors working with the labview tutorial, but if you have the ones that output an analog voltage I can imagine you can just read in the value as an analog input and scale that value by a constant by multiplying a constant to it.

I was thinking about using an ultrasonic range finder. It’s very good at detecting walls and other solid objects.

But for robots, which have different sized parts hanging about and holes everywhere that could have echos, I thought it wouldn’t really be accurate because they would all affect the distance. This is my first year so I’m not sure, did this system work for anyone?