Analog or digital IR for proximity sensor?

Thanks

I thought about light barrier, the problem is i am gona need one device on each side.

With those digital sensor, can't i send a pulse signal every 200ms and see when it detect something?

I am playing with the calibration right now, it s very impressive how those sensor can detect the signal all the time, even when i make a tube with dark paper around the LED and the reception...