Go Down

### Topic: Ultra-Sonic Waves, Human Following Robot (Read 3489 times)previous topic - next topic

#### husein06

##### Nov 22, 2012, 06:59 amLast Edit: Nov 22, 2012, 07:25 am by husein06 Reason: 1
Hello,

I'm using a transmitter to transmit 40k square sound waves to 2 receivers on a robot. I want the robot to know which direction the transmitter is and adjust to it (to later drive to it) .

So I'm in the first stages of figuring this out but confused and need help.(correct me if I'm wrong on anything)

To calculate the direction of the transmitter, I will have to know the phase difference between the waves of receiver 1 and 2, so I will be able to calculate which arrives first(but is it based on direction of which came first or strength?). But how do I calculate this phase difference? through hardware or software and how?

Moreover, how do I output the calculations of the phase difference (through micro-controller hardware or software)?

Please advise me if I'm in the right direction and if you have an idea or different approach.

Thank you

I'm using this kit for transmitter and receiver.

#### johnwasser

#1
##### Nov 22, 2012, 03:30 pm
Send pulses of 40 kHz instead of continuous.  Then you can measure the arrival times.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### oric_dan

#2
##### Nov 22, 2012, 08:12 pmLast Edit: Nov 22, 2012, 09:54 pm by oric_dan(333) Reason: 1
The problem with phase measurements is that the wavelength of 40 Khz sound is very small, so even
small angles off 90-deg [head-on to the target] cannot be determined correctly.

http://en.wikipedia.org/wiki/Wavelength

wavelength = v/f = (1100 ft/sec * 12"/ft)/40000 hz = 0.33", which is why the 40 Khz transducers are
the small size they are.

Quote
Send pulses of 40 kHz instead of continuous.  Then you can measure the arrival times.

John is on to something here, except he means the "difference" of arrival times. The difference will be
zero when the target is head-on. Note also that, measuring difference of arrival times is a digital
measurement, and much easier to do than any sort of analog phase measurements.

#### johnwasser

#3
##### Nov 22, 2012, 08:48 pm
If you want both direction and DISTANCE you need a way to know when the pulses are sent.  You could trigger the pulses with a radio signal.  If you expect line-of-sight you could use an IR sender to trigger the pulse.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### husein06

#4
##### Nov 29, 2012, 12:47 am
Great Idea, can you elaborate more?

So i was thinking.

I understand It's not phase so much as timing. So lets say the Robot sends out a pulse request, then begins timing(how?). The receiver you wear gets the request and sends out a pulse.

The robot will have 2 sonar sensors. (It times which sensor gets the signal first, difference between, and uses this to calculate direction.) How?

My main question is how to do the timing portion and what exactly is the calculation how do you configure that to the robots driving?

#### johnwasser

#5
##### Nov 29, 2012, 02:56 am

My main question is how to do the timing portion and what exactly is the calculation how do you configure that to the robots driving?

To time a signal you would typically use a loop:
Code: [Select]
`    SendPingRequest();    int leftDistanceCount = -1;    noInterrupts();    for (int i=0; i<10000, i++) {        if (digitalInput(leftSensorPin)) {             leftDistanceCount = i;             break;        }    }    SendPingRequest();    int rightDistanceCount = -1;    for (int i=0; i<10000, i++) {        if (digitalInput(rightSensorPin)) {             rightDistanceCount = i;             break;        }    }    interrupts();`

Do some experiments to determine the base count and counts per unit distance.

From there it's simple trig.  You know the distance between the receivers and you know the distance from each to the sender.  That gives you three sides of a triangle from which you can determine all the angles.

Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### husein06

#6
##### Nov 29, 2012, 03:22 am
Thanks for all the help.
I'm deciding to use PING)) sensors for the ultrasonic waves and distance measurements. And xbee for the wireless (To tell the transmitter to send a pulse. Do you think this is a good approach? I have never used them, but im guessing ping is straight forward, i think? and xbee still no clue.

Since the PING)) comes as a transicevier distance measure.. How do I adjust them to turn them into just a receiver and or just a transmitter? Do I physically remove them from the board?

#### johnwasser

#7
##### Nov 29, 2012, 04:31 am

How do I adjust them to turn them into just a receiver and or just a transmitter? Do I physically remove them from the board?

Yes.  That's how Ben Heckendorn did it when he made his robotic luggage.

http://revision3.com/tbhs/robotluggage
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### husein06

#8
##### Nov 29, 2012, 06:36 am
Yes I heard about it! Nice find! Just finished watching it, very similar to what I was thinking!

Do you know how the xbee is being used, I have never used xbee or wireless before, is it simple serial communication? sending a carrier with eight 1, is he sad? how exactly is that done?

#### AWOL

#9
##### Nov 29, 2012, 09:24 am
I don't think you need anything as expensive as an XBee, do you?
A cheap 418MHz (or similar) Tx/Rx should do the trick (watch out for false triggers from door bells!)

Some of the Devantech serial/I2C ultrasonic devices allow a "listen-only" mode, so don't require any surgery.

A problem I think you may encounter is the relatively narrow acceptance angle of some ultrasound receivers - off-axis reception may not be very sensitive.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

#### johnwasser

#10
##### Nov 29, 2012, 04:26 pm
I'd go poking around on the ultrasonic transmitter to see if it provides a TTL (5V) version of the 40 transmit signal.  If so, I'd hook that up to a cheap OOK (On/Off Keying) transmitter to send a 40 kHz burst of RF pulses.  Then the RF receiver and a driver can drive the one ultrasonic transmitter.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### husein06

#11
##### Nov 30, 2012, 02:27 am

I'd go poking around on the ultrasonic transmitter to see if it provides a TTL (5V) version of the 40 transmit signal.  If so, I'd hook that up to a cheap OOK (On/Off Keying) transmitter to send a 40 kHz burst of RF pulses.  Then the RF receiver and a driver can drive the one ultrasonic transmitter.

Thank you for your response, I'm new to a big project like this, I have done very small projects, So hopefully you can bare with my rookie questions. There's a beggining to everything.

I'm not exactly sure what you ment. Researched what a OOK transmitter is and understand it, but in what portion will I include it in? so your suggesting the xbee wireless would send to the xbee wireless on the transmitter and that voltage will trigger the OOK transmitter to send a 40KHz burst becuase its "1"'s?

I don't think you need anything as expensive as an XBee, do you?
A cheap 418MHz (or similar) Tx/Rx should do the trick (watch out for false triggers from door bells!)

Some of the Devantech serial/I2C ultrasonic devices allow a "listen-only" mode, so don't require any surgery.

A problem I think you may encounter is the relatively narrow acceptance angle of some ultrasound receivers - off-axis reception may not be very sensitive.

Now what do you mean I don't need something like an xbee, i researched and seen its a preferred way and easy to use? a cheaper 418MHz would be just cheaper cost wise right? nthn with making the project better or easier?

But If I remove the transmitter portion of the Ping)) it would just act as a receiver(or would I have to modify more?) or is the Devantech ultrasonic better to use because they use I2C ?
Again all I'm using the ultrasonic waves is to know the pulses so I can trigger the time.

Thank you Both very much!

Go Up

Please enter a valid email to subscribe