New guy working with Arduino. help with project?

and give an accurate distance for up to 20 meters away

That is too far for an IR sensor, you also might be pushing an ultrasonic sensor as well. Also how accurate do you need it to be?