Use of automated and unobtrusive sensors for physiological monitoring has become popular nowadays, since no devices need to be worn by individuals and it does not require any user interaction. However, when bodily movements occur, movement artifacts are introduced which can interfere with the breathing signal. This paper proposes a method to automatically identify movement onset and offset times when using an unobtrusive bed-based pressure-sensor array. This work makes use of a previously developed method for movement detection based on control levels. The novel contribution of this paper is employing an adaptive window length to calculate a moving average and a moving variance, by measuring the distance between two consecutive peaks in the signal which relates to consecutive movements. We also impose a threshold based on the weight and height of an individual to flag true movements and discard false ones. The proposed method is applicable for different postures and breath patterns of the bed occupant. Our experimental results show that the proposed scheme can lead to an average movement detection offset as low as 1.32 second, with no false-positive events and low false-negatives, and it provides significant improvements compared to a previous method.