Ultrasonic Gap length sensor project

Hi guys, I'm currently interested in a project that detects the width between 2 objects with a ultrasonic sensor such as the HC-SR04. There said, I'm fairly new to Arduino programming. Detecting the distance seems to be fairly easy, but I'm wondering if its possible to detect the distance between 2 objects in front of the sensor?

You mean the objects side by side or one behind another or...?

giovanniguerra:
You mean the objects side by side or one behind another or...?

In either case, the answer is no.

if you mean something like this

o o

V

and you can measure the angle (~) making the V you can use trig. Measure the distance to the target and call it the hypotenuse. The separation would then be 2X h(sin ~)

i think

Procyan:
if you mean something like this

o o

V

and you can measure the angle (~) making the V you can use trig. Measure the distance to the target and call it the hypotenuse. The separation would then be 2X h(sin ~)

i think

A HC-SR04 has a wide beam and isn’t particularly directional, so there’d be no way to accurately measure the angle to a target.

As aarg said, the answer to joeyko10642’s question is “no”.

OldSteve:
A HC-SR04 has a wide beam and isn't particularly directional, so there'd be no way to accurately measure the angle to a target.

As aarg said, the answer to joeyko10642's question is "no".

If that's the case, is there possibly any sensors out there that can do the job?

joeyko10642:
If that's the case, is there possibly any sensors out there that can do the job?

No single sensor that I can think of. It might be possible using IR or laser, but that would depend on a number of factors such as distance, whether it's possible to put a detector behind the objects, whether the IR/laser syatem or the objects could be moved to sweep a beam past them, etc. (Similar to a gap sensor.)

Maybe someone else has some other ideas.
It would be easiest if an ultrasonic sensor could be mounted on one of the objects.

What's the exact setup, and what are the objects?

OldSteve:
No single sensor that I can think of. It might be possible using IR or laser, but that would depend on a number of factors such as distance, whether it’s possible to put a detector behind the objects, whether the IR/laser syatem or the objects could be moved to sweep a beam past them, etc. (Similar to a gap sensor.)

Maybe someone else has some other ideas.
It would be easiest if an ultrasonic sensor could be mounted on one of the objects.

What’s the exact setup, and what are the objects?

To be exact, I’d like to make this to measure the width between 2 objects to see if the object itself with the sensor mounted to it can go through the gap. In a wider picture, you can think of it as a car backup sensor to see if the car can move in between 2 other cars.

joeyko10642:
To be exact, I’d like to make this to measure the width between 2 objects to see if the object itself with the sensor mounted to it can go through the gap. In a wider picture, you can think of it as a car backup sensor to see if the car can move in between 2 other cars.

That’s different to what I was mentally picturing.
My robot car does a similar thing. I mounted an ultrasonic sensor on a servo that swings it side to side, taking measurements in 5 positions. I mounted the servo upside-down, with the ping sensor glued to the body, so I could get it nice and low.
Perhaps you could do similar - mount the servo/ping sensor assembly so that it extends out the front, taking measurements to each side.

My robot car’s ‘head’:-
Robot Car Head.JPG

Edit: For this to work, you need to get the ping sensor right between the two objects, so that it has to swing 90 degrees to each side to measure the distance. Manoevring it into position dead centre right between the two objects might be fun.

OldSteve:
That’s different to what I was mentally picturing.
My robot car does a similar thing. I mounted an ultrasonic sensor on a servo that swings it side to side, taking measurements in 5 positions. I mounted the servo upside-down, with the ping sensor glued to the body, so I could get it nice and low.
Perhaps you could do similar - mount the servo/ping sensor assembly so that it extends out the front, taking measurements to each side.

My robot car’s ‘head’:-
Robot Car Head.JPG

Edit: For this to work, you need to get the ping sensor right between the two objects, so that it has to swing 90 degrees to each side to measure the distance. Manoevring it into position dead centre right between the two objects might be fun.

Will give this a thought. Your information definitely gave me some insight of the direction I should head for. Cheers bro.

joeyko10642:
Will give this a thought. Your information definitely gave me some insight of the direction I should head for. Cheers bro.

what to do if the gap is too small for the sensor to go between two points.