>Next, I checked the optocoupler circuit. It's a pretty standard circuit >( 220 ohm resistor, diode on the input side. Collecter thru 4.7k >resistor to +5V, and emitter to ground. Correct me if I'm wrong, but shouldn't pin 6 of the CNY-17 be connected to VCC... Have you done this ? The behaviour you describe sounds like the connection is missing. / Niklas