Ultrasonic Sensors - quasics/quasics-frc-sw-2015 GitHub Wiki

An ultrasonic sensor is commonly used to measure distance to an object using high-frequency sound. This is basically a limited version of sonar, but ultrasonics normally measure the distance specifically to the closest object within their “field of view".

There are a number of these available on the market, and they will generally have a distance range over which they're able to function (e.g., ".5-3 meters"). Unlike a visual sensor (color, camera, etc.), they are fairly reliable at detecting transparent surfaces like glass or Lexan.

One possible use for them is getting up close (or into contact) with an object during autonomous mode, though they could also be used as an assist to drivers during the tele-op period.

A MB1043 MaxSonar Sensor, from MaxBotix Inc, was provided in the Kit of Parts some years back, and continues to be provided to rookie teams.

Resources

  • Discussion in FRC Control System docs
    • Note: the sample code at the beginning of this material assumes that you're using ping-response ultrasonics, which are wired to the Digital I/O pins on the Rio. The MaxSonar sensor is an analog sensor, which needs to be wired/coded differently; the MaxBotics support page includes both sample wiring diagrams and basic code.