If the sensors appear to be unstable, try the following:
- Create a simplified sketch (one sensor) which just switches a led when the sensor is actively detecting something.
- Power the sensor using the 3.3 volt Uno pin.
to see if that helps. Also experiment with the jumpers on the sensor.