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

The safest option is to use an optocoupler.

2 Likes