Reading from a CT Sensor pin affected by Seven Segment Displays switching on and off

I've been biting my tongue while reading this thread... I suggest the following: First decide how quickly the system has to respond to an input. I suspect, for a dust vacuum, it is not very fast, much much much slower than any interference if it's in the form of a pulse. All you need to do now, is low pass filter the input prior to threshold detection. You don't need any library for that, not even a Kalman filter, just a plain smoothing filter like:

unsigned int smooth(unsigned int newVal) {
  static unsigned int oldVal = 0;
  unsigned long sum;
    //  optimize sum = (oldVal * 3 + newVal) / 4;
    sum = ( (oldVal << 1) + oldVal + newVal) >> 2;
  }
  oldVal = sum;
  return oldVal;
}
...
  // example use
  smoothedValue = smooth( analogRead(A0) );

...

A "slower" filter is:

sum = (oldVal * 7 + newVal) / 8

You don't even need a DC offset on the analog input for this, in fact it just makes it more complicated because then you need to rectify the signal in software. With no DC offset, the input circuit produces a halfwave signal that can be processed directly.

I've tested this software with some very noisy signals on a CT, and it worked flawlessly.