You could try and fix it in the software, Make the pic trigger with a known source and then wait a set period of time (eg 8ms) and see if the source is still there. DC spikes are only about 4 ms long and looking for a solid signal could help.
Snap