Connecting a light barrier (NPN or PNP) to an Arduino

Thanks for your response.
Seems to be a good option.
Need to test.

Thanks to you to take the time to write your response