Pages: [1] 2   Go Down
Author Topic: Measure distance between 2 circuits  (Read 1741 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd like 1 circuit to be simple and very light.  I'd like to measure distance up to 10m with 34cm accuracy.  Will this work?

http://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor
But different.  Here is my modification...

My idea is to put the sender in the small airplane or helicopter.  It will simply beep exactly every 0.1 or 1 second.  The receiver will store the milliseconds and a number of milliseconds it's drifting per ping when it's 1m away not moving.  This might be +-0.52ms, for example, which could be determined by waiting for 100 cycles or 100 seconds.  All I need is an accurate clock that's small.  Obviously the 2 clocks do not need to be in sync.  One can even drift by 1%.  As long as they are consistent.  Can I use a 555 for the sender?  Arduino Uno timer for receiver?  Do you think I will get 34cm accuracy?  Can I do better?  Can I share the main helicopter battery?  Or watch battery.

Sound is 343m/sec.  So 1ms is about 34cm.

I realized this will not work for long.  The code will have no way of knowing if it slowly moved away to 10m, or drifted 30ms over time.  It will have to be reset to a known distance every few minutes?

http://www.ti.com/lit/ds/symlink/lm555.pdf
Disregarding voltage and temp changes, it should continue to be accurate within 1%?
How much could it vary from 1sec to the next?  I think much less than 1%.

Any better ideas?  Please.

Update: Can I use the hardware in the first link together with a Nano or Picaxe to receive a ping and send one back after a short constant delay?  Is there a complete piece of hardware that already exists to do this for the consumer market?  Which idea do you like best so far?

Bueller?
« Last Edit: December 27, 2011, 09:16:37 pm by sbright33 » Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25802
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why not ping in response to an optical pulse?
Time of flight of optical pulse is negligible.
Your acoustic time of flight is affected by temperature and air pressure, so may need some compensation.
Logged

"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.

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, you can't measure distance by timing pulses, only speed: http://en.wikipedia.org/wiki/Dopler_effect
But you can use two ping sensors, one on the ground and second on the plane ( if it's small, and can't reflect enough signal from the body). Ping on the plane should be configured for retransmission back whatever pulse it receives. Than ground station calculate overall delay, and subtract known retransmission delay.
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It will be easy to guess the temperature to get within 1-2%.  34cm/10m is about 3%.  34/5m is 6%.  Mostly I want to know if it's moving further away or closer to keep it at a constant distance.

What is the advantage of optical compared to 2-way sound?  The disadvantage is that light is much harder to point in the right direction from a moving rotating object.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Magician - Great idea!  Where have a I heard that?  smiley-wink

You're correct, the timing between pulses will always be 1s for a slow moving object in my example.  But it will be shifted compared to the clocks by 30ms at 10m, at the receiver.  All I have to do is keep the clocks in sync.  Or measure how they drift consistently without any movement/distance.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25802
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The optical pulse is there to trigger the acoustic pulse.
If the base station provides the trigger pulse, and you know the latency of the optical receiver to acoustic pulse generation, you simply time the delay before the base receives the acoustic pulse.
Logged

"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.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4767
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you notice a difference in received frequency then it will be moving closer or farther.

You definitely want to have a 2-way ping instead of an on-time 1-way. Try and get two Arduino's to blink synchronously for half an hour if you don't know why.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25802
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you can measure a difference in received frequency, it will be a minor triumph.
Logged

"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.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4767
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Probably need a DSP and a lot of time finding out how to make it work.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12562
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you actually produce a clear enough sound to detect at that sort of range, bearing in mind that your airborne platform will be making a lot of noise?

If you can hear it, then I'd try using a radio link to trigger the pulse and try averaging the round-trip time over a number of samples. I don't know how many samples you'd need to average to get a consistent result - it might be dozens or hundreds, depending how long a pulse you need to be detectable and how quickly you can detect the start and end of the pulse. That would give you some indication of range. I doubt that it would be practical to detect doppler shift, but you could infer closing speed from the range change..
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4767
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually if you made the ping sound using PWM and a piezo buzzer you could get very precise, sharp clicks as output. Picking them up might or might not be a problem. The higher the frequency the farther they might carry too. If the clicks are in very short bursts you wouldn't need to know the sound frequency, only the burst frequency.



Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It will probably not be reliable because the helicopter makes a lot of noise.  The plane does not.  This interference is why I suggested sending only from the craft using a clock to do it at a defined interval.  It is not so loud at 2m away.  I like the idea of a radio link!  What circuit can I use?  My first thought is XBee, but there is a variable delay in receiving a single byte.  It has to be low mass.  

@goforsmoke
I was thinking of making only 1 short click every 1 second.  Possibly 0.1 second.  You seem to have a different idea.  Please explain.  The distance wouldn't change much at 100hz, from one cycle to the next.  I assume we're talking 1-way transmission now, without a clock?
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4767
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With PWM you can make 1 click at pretty precise interval too. I took a few seconds to think before and wasn't working it all out. But still, relative movement will change the timing of the clicks the same way that doppler shifts frequencies. Clicks is the 'sonar' used by bats, btw, and good for more than 10 meters at flying speed, but they do have good ears and cortex processor.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Let's say 10hz clicks.  100hz?  Which is best?  How would this work?  Pseudocode please?  I'm not convinced.
Anyone else agree?
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4767
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are totally blind people who walk around and even ride bicycles (including down mountain trails) using echo location from clicking their tongues.

As to the doppler, that's science. What you might be able to do with it is real. All I tried to do is make you aware of a possibility, not tell you you what to do.

Here's another possibility. With the radio pulse returned by sound from your vehicle (plane or copter) and 3+ base stations you could be able to get location instead of just distance. But... it would be a lot of work.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Pages: [1] 2   Go Up
Jump to: