cattledog:
I'm not sure I understand the problem statement. Once aspect of the problem appears to be continuous background "mains hum" at 50 Hz triggering the interrupt Another aspect seems to be pulses coming from pwm motor driver/controllers. Another noise seems to be coming from the motors themselves. Can you help break this down for us?
All of that is going on. Mains hum seems to disappear or be consumed somehow, once the circuit is properly connected to the sensor but worries me about its existence just in case it is slipping through or may do in another environment (that is not my man-cave).
I think (but its a guess) that the motor EMI is worsened by the fact that it is receiving PWM from the controllers. I can see mains hum, spikes and PWM traces when I connect up my 'scope with the same "aerial" as I use with the Arduino.
Using a non PWM, traditional rheostat, controller still has problems.
What sort of "breaking down" do you want? Give me an example please.
The signal you want from the optical sensor should be both of a frequency and duration as the white window goes through the slot.
That's right
Can you detect a rising and falling edge?
Yes, no problems.
One thought I had is that you could only count pulses of a certain duration, which would be a function of rpm, and only count pulses occurring at certain intervals which also would be a function of rpm.
I'll look into the mathematics of this one. My worry is the noisy signals are themselves a function of motor rpm which is effectively what I'm recording so cleaning these out may be quite difficult.
Filtering in software does not sound easy, but if you can't get there with hardware you might have some options.
I'm going to look into using the diff amps as proposed earlier.
Another solution is to move the slot car about 75cm away from the sensor which is doable but hardly a very elegant solution.... and not something that will fit inside my pit-box without making it foldable.