Oder man nimmt einen Fototransistor und eine LED, so wie die Lösung von waste:

https://www.roboternetz.de/phpBB2/viewtopic.php?t=15307

Gruss,
stochri