I need to measure distance in the 0-1m range. The sensor is attached to a person's hand and will measure the distance between the hand and body as it is moving to and from the body. I tried the ultrasonic sensor but it seems that that solution only works on flat surfaces that are perpendicular to the sensor.
I am looking into infrared and laser distance measurement sensors, more particularly GY-530 VL53L0X (laser) and GP2Y0A21YK0F (infrared).
Would someone be able to advice me as to which one to use? They all seem to be about the same price. I need accuracy to about (+-)5cm.
You have not said why you are trying to make the measurement.
An alternative strategy might be to attach markers to the person's body and then video the scene as they do when producing CGI. YOu could then analyse the video to get distances speeds etc. An Arduino would not be suitable for the analysis and how easy it would be to do would depend on the complexity of the movements.
It might be worth researching what they do for sport training and medicine, they are bound to be analysing things like golf strokes.
If you put color tags on the person a pixy camera may report back positions and angles (you would need to check the technical spec). The camera takes 50 frames per second so I guess you could get measurements every 20ms.
VL53L0X can handle pretty fast moving things, it can easily take like 10 samples a second. The videos of Adafruit are just simple demos.
They will detect a hand quite well, but of course are highly directional. The hand must be within the beam. Or if the hand is the side that holds the sensor, it's got to point it towards the body. Also those IR sensors are very sensitive to ambient, and won't work well if at all when outdoors.
Another possible solution to this is indeed using cameras, but that's generally out of the realm of Arduinos.
wvmarle:
....
Another possible solution to this is indeed using cameras, but that's generally out of the realm of Arduinos.
I have not used the pixy camera myself but it is doing the image processing and tracking of the targets and interfaces with the Arduino. All the Arduino needs to do is use the information about target position that it gets fed from the camera. So potentially you get positional information 50 times per second. This data rate would need to be confirmed by reading the technical specifications however the camera can track multiple targets of different colors.