Attached is a picture of my setup. The sensor used is the Sharp GP2Y0A710K0F, which should have a range of 1 to 5 metres.
The readings however are all over the place; straight walls at a 3m distance will show up as being at a ~1m distance, an object directly placed in front of the lens shows up as 90cm away and regularly the sensor simply cannot calculate the distance.
Is there something wrong with my setup, or is the sensor possibly broken? For my project some deviation (±50cm) is tolerated, but the data I'm receiving from the sensor makes it useless.
EDIT: Probably the issue is caused by an insufficient battery voltage of only 3.7v.