go_away

Author Topic: Working with a sonar  (Read 873 times)

0 Members and 1 Guest are viewing this topic.

Offline macbookTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Working with a sonar
« on: August 14, 2010, 02:50:42 AM »
Hi,
I wanna use sonar in one of my projects. I wish to use a sonar for obstacle avoidance & path mapping, mainly using it to analyze the surrounding environment i.e., calculating distances from walls and other obstacles.
I've never used a sonar before. What kind of a output does a sonar give? How does it tell the distance of the obstacle to the microcontroller?
I also read somewhere on SoR that sonar can also be used to detect how hard of soft a material is. How does it do that? As in, how does it tell the microcontroller that abt a material's hardness or softness. Again basically the question is what kind of output does it send to the microcontroller?
Reply soon.
Thank you. :)

Offline HyperNerd

  • Robot Overlord
  • ****
  • Posts: 139
  • Helpful? 5
  • N3rd1n80r
Re: Working with a sonar
« Reply #1 on: August 14, 2010, 05:33:28 AM »
I will assume that you have already read this page: http://www.societyofrobots.com/sensors_sonar.shtml

It really depends on which sonar sensor you choose to use in your project - some (the PING))) sensor by Parallax for example) use 1 I/O pin for both triggering the sensor and reading back data. These tend to output a pulse whose length determines the distance detected.

Others such as the MaxSonar range, have multiple output choices such as pulse width (the same as the PING))) sensor), analog voltage output (the same as the analog SharpIR sensors) or digital serial output.

If you already have experience using the SharpIR range, then the MaxSonar range would probably be the easiest integration, as they can use the same type of interface, thus requiring very little code adjustment.

Good luck with your project  :)

 -HyperNerd
There are 10 types of people in the world - those who understand binary, and those who don't.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Working with a sonar
« Reply #2 on: August 14, 2010, 07:01:38 AM »
Quote
I also read somewhere on SoR that sonar can also be used to detect how hard of soft a material is. How does it do that?

Lets say you have two objects, each equal distance away from the sonar. That means the time to travel for the sonar pulse is equal, so the distance is equal.

The difference is the power of the returned pulse - harder objects reflect more energy back, softer objects absorb more energy.

The cheap hobbyist sonar by default only returns the time to travel data . . . so you'll need to poke it with a multi-meter to find a pin that has the original non-processed pulse and hook that up to an ADC.

btw, the MaxSonar returns a value equal to the centimeters distance away.

you might find this educational:
http://en.wikipedia.org/wiki/Sonar

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Working with a sonar
« Reply #3 on: August 14, 2010, 10:33:41 PM »
Hi,

The difference is the power of the returned pulse - harder objects reflect more energy back, softer objects absorb more energy.
Assuming equal distance, two objects, one 20cm wide and some degree of "soft" and the other 10cm wide and "twice as hard" (in the sense of amount of reflection per area) - I don't really see how you're gonna tell softness from area unless you do some very fine calc on the returned pulse (i.e. using analog timing circuits of a similar speed like in LASER TOF circuitry)?
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Working with a sonar
« Reply #4 on: August 15, 2010, 06:52:02 AM »
The difference is the power of the returned pulse - harder objects reflect more energy back, softer objects absorb more energy.
Assuming equal distance, two objects, one 20cm wide and some degree of "soft" and the other 10cm wide and "twice as hard" (in the sense of amount of reflection per area) - I don't really see how you're gonna tell softness from area unless you do some very fine calc on the returned pulse (i.e. using analog timing circuits of a similar speed like in LASER TOF circuitry)?
Well, what I meant to say was, 'all other things remaining the same' :P

Offline macbookTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Working with a sonar
« Reply #5 on: August 15, 2010, 01:53:26 PM »
Thanks a lot for the replies and going by its complexity, I dont think i'll use my sonar as a hardness detector.. :P

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Working with a sonar
« Reply #6 on: August 15, 2010, 07:20:04 PM »
A single DoF robot arm with a force sensor at the end can poke the object to determine stiffness.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Working with a sonar
« Reply #7 on: August 16, 2010, 10:45:04 AM »
I was reading around about sonar for my robot fish, and found this page:
http://www.lowrance.com/Support/Tips-and-Tutorials/Sonar-Tutorial/

This section shows how softness/hardness affects the returned image:
Quote
Mud, sand and vegetation on the bottom absorb and scatter the sonar signal, reducing the strength of the return echo. Rock, shale, coral and other hard objects reflect the sonar signal easily. You can see the difference on your sonar's screen. A soft bottom, such as mud, shows as a thin line across the screen. A hard bottom, such as rock, shows as a wide line on the sonar's screen.


Offline macbookTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Working with a sonar
« Reply #8 on: August 17, 2010, 01:39:34 PM »
Nice article.. thnx for the link.. :)

 


Get Your Ad Here