Oh, it's short. Probably you don't need caps after all.
I'd investigate this issue you have with a sparks . Definitely something wrong with electrical side. Are computer and PSU connected to the same outlet? Can you measure voltages between cases PC and PSU? Does PSU has 2-wire or 3-wire cable?
Yes, PSU is the same outlet and it shows 0V between cases. But it wasn't once that I got about 50-100V on my fingers from computer case, though theoretically it's grounded. Something definitely wrong there.
Not quite getting that, how do you thing that could happen.
I meant something like this:
There's ground somewhere behind output anyway, so it should draw something. Though a bit later I understood that analog input impedance would render this current practically nonexistent.
After rewiring things the way you suggested:
Everything works great! Noise stays within 3 units even under substantial load on PSU.
What's more, now because I'm not limited to minimal resistance of phototransistor, I get almost full range readings (~23-1023)
Thanks a lot! Connecting other way around seems so simple and logical once try it, but somehow wasn't obvious.
Here's output at 250-500RPMx8