Go Down

Topic: Measure distance between 2 circuits (Read 1 time) previous topic - next topic

sbright33

Dec 27, 2011, 09:32 pm Last Edit: Dec 28, 2011, 03:16 am by sbright33 Reason: 1
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?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

AWOL

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

Magician

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.

sbright33

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.
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

sbright33

@Magician - Great idea!  Where have a I heard that?  ;)

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.
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

AWOL

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

GoForSmoke

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.

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

AWOL

If you can measure a difference in received frequency, it will be a minor triumph.
"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.

GoForSmoke

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

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

PeterH

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..
I only provide help via the forum - please do not contact me for private consultancy.

GoForSmoke

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.



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

sbright33

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?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

GoForSmoke

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.

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

sbright33

Let's say 10hz clicks.  100hz?  Which is best?  How would this work?  Pseudocode please?  I'm not convinced.
Anyone else agree?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

GoForSmoke

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.

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

Go Up