A sensor type for MOT2002 has been added to the latest release of the Phidget22 library that will automatically filter incoming data and provide a 1 if there is motion or 0 if there is not.
It is actually 3 sensor types (MOT2002_LOW, MED and HIGH), corresponding to low, medium and high sensitivity.
Upon selecting the sensor type, the sensor value will be treated as Out of Range until the sensor has had a 5 second period of no motion to establish a baseline to compare against.
You will need to set your DataInterval on the channel to 200ms for the filtering to work as intended.
I hope this helps!