Carefully calibrate the accelerometer, following the six point approach or much better, this advanced approach, then average several hundred readings before calculating the tilt angle.
The accelerometer must be held still for measurements. Any movement violates the assumption that the measured acceleration value points directly towards the Earth's center, and the resulting systematic error cannot be corrected by any filter.