You mean the objects side by side or one behind another or...?
if you mean something like this o o Vand 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".
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?
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':-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.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16