Which sensor is more accurate for distance measuring ultrasonic or sharp ir sensor?If there is any other better than these two sensors please do tell.
It depends on the range. What range do you want?
Range that I want is from 2cm to 25cm
Consider an optical time of flight sensor like this one.
Why do we have to do your homework?
- you don't specify which exact sensors you have in mind
- you can look up the specifications of these sensors yourself, and see which one is the more accurate for your range.
An IR sensor has the potential to be more accurate, but it depends on the sensor.