Ultrasonic rangefinder as scanning radar

Ultrasonic rangfinders are a cheap and easy way to gather obstacle avoidance data. When added to a servo motor they form something of a scanning radar for near-proximity objects.

In this implementation, [Rui Cabral] is driving the servo, and collecting data from the sensor using a PIC 18F4520. The servo rotates 180 degreees, taking sensor measurements in increments of nine degrees. If it discovers obstacles, the distance and orientation are recorded. Feedback is displayed on a 20-LED bar graph display which shows a moving LED to track the sensor orientation, with LEDs remaining lit whenever an object is found. Right now the obstacle data is pushed over a serial connection with a PC, but could easily be injected into navigation logic for a robot in order to triangulate a path around the obstruction. You can see [Rui's] project in action after the break.

We looked in on the same concept with a different display technique a couple of years back. That hack used an Arduino and Processing to map sensor data with a traditional green sweep display.

[Thanks Oryx]

Comments

  1. Khordas says:

    Fun way to get some use out of some older tech. I wonder if it would be possible to scan the rangefinder smoothly, and just sample the data at intervals, for a less jerky appearance, or does the rangefinder have to be stationary to read?

    • emevas says:

      it isn’t jerky because of the rangefinder, but because of the servo. you have to send a control signal to the servo and, since there is no feedback signal, you just have to give it enough time to reach the position before you go to the next position. if you instead just had a motor with a feedback signal then you could sweep it like that, since you know the position of the rangefinder for sure when you take a reading without having to wait for the servo to get to its position.

      • Will says:

        No, servos are jerky because they rely on a potentiometer coupled through cheap plastic gears with tons of electrical noise as their position feedback sensor. Combine that with untuned PID control loops and you get the twitch effect that is so common. Finally, the control signal most of them use with the 1-2ms pulse every 20 ms is usually pretty noisy as well so the target position keeps moving around.
        As the quality of the servo goes up from the $5 discount bin ones to the $200+ industrial ones you will find that they have better gears with less backlash, more accurate sensing (I took one apart and found an optical encoder!), better control loops, and different input signals including pure serial commands. Needless to say the high end ones don’t twitch.

        As for the reading while moving, it is possible but usually avoided. Pure time of flight wouldn’t be affected but if you’re looking at Doppler shifts or phase difference on arrival then sweeping the sensor makes the math a lot ickier.

    • emevas says:

      when I said jerky, I was referring to the stop-start of this circuit, not the servo itself. I was saying that this person programmed in a wait time to ensure that the servo was at the specified angle before taking a reading. if you instead just used your own motor with a positional feedback you could eliminate the wait time. the distance reading might be affected by doppler shift, sure, but that is an issue with using a servo like this anyway. besides, since I assume this is mainly for robotic awareness of the immediate surrounding and not for precise range finding, a little error is a fine tradeoff for a faster sweep.

  2. ino says:

    it’s more echo location than RADAR (no electromagnetic waves here)

  3. Tweeks says:

    How many bits of resolution are you getting out of the sonar module, and how accurate (over what range) is it?

    Tweeks

  4. Haku says:

    I saw something very similar in a recent episode of Ghost Adventures, this one scans for distance and temperature and continually re-scans to look for differences. Scroll down to the THERMOSOUND unit:
    http://alexandriaparanormalinvestigations.org/Equip.php

  5. Kalavera says:

    Hey Khordas, it looks like a DFRobot URM Sensor. The choppy movement is probably due to the servo and not the sensor. I think the sensor could be moved smoothly, just not too fast. You could use an IR Senor instead for faster scanning.

  6. Oscar says:
  7. Vt says:

    Um, it’s SONAR not RADAR. look them up.

  8. spiralbrain says:

    I tried this many years ago, used a laser to point the location where distance was measured. It was fairly accurate.

  9. Bogdan says:

    I like this project better:
    http://www.hazmat.com/~mjb/projects/picsonar/

  10. Isotope says:

    a stepper might give better resolution and 360-degree coverage. i might try this some day if i have the free time

  11. Harley says:

    Hey, I think you just hacked your way into the key element blocks of the Lego NXT 2.0 kit!..lol

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,427 other followers