Du musst die Lichtschranke nur so anordnen, dass an der Oberfläche des Zylinders Totalreflexion auftritt, also z.B. 30° statt senkrecht zur Zylinderoberfläche.