Barrier coverage of a wireless sensor network (WSN) is a critical issue in military and other security applications, aiming to detect intruders that attempt to cross the deployed region. In order to support better flexibility of deployment location and improved coverage of the sensors, this paper uses mobile sensors to construct the barrier. However, addressing the mobility of mobile sensors in a distributed way is a major challenge of this issue. This paper determines the speed and delay time for each mobile sensor in a way to achieve least mobility of mobile sensors for constructing the barrier. Performance study reveals that the proposed approach of this paper outperforms the existing works in terms of the mobility distance, barrier forming time and network lifetime.