Measuring distance of object that is in angle

Hi,

I am using the Ultrasonic sensor HC-SR04 to measure distance to an object.
The object itself may change (book, phone, chair, etc.,)
When the object is in "straight" line to the sensor the distance is acceptable.
If however I put the object in angle the measured distance is totally wrong. I put the object close to the sensor (say 5cm to 30cm) but still it does not pick-up the object.
I put the Ultrasonic sensor on servo and I move the servo back and forth between min to max angles (around 30 degrees to 150 degrees). Still same result.

Only when the object is from a certain angle the sensor picks-up the object correctly. Outside that "angle range" the sensor does not pick-up the object at all or reports totally wrong distance.

I understand a reflection is in play here however, is there a sensor that can give me a better performance so that even if object is in angle it will pick it up correctly? The sensor should pick-up the object from a distance of 20-30 cm away. Longer range is not important for this experiment, the angle however is important (wider is better) and naturally should be affordable for a little project.

Thank you for you advice.

You need a narrow angle LIDAR sensor. The cost will be 50x higher than your HC-SR04.

You have to make sure your object does send back at least some of the sound waves, instead of having it bounce away.

Cloting is another thing they tend to not pick up... regardless of angle.

The ultrasonic sensor beam is about 30 degrees wide.

If you want to pick up objects at wider angles, use several sensors, pointed in different directions, or scan one sensor using a servo.