Accurate and low-cost sensor localization is a critical requirement for the deployment of wireless sensor networks in a wide variety of applications. Many applications require the sensor nodes to know their locations with a high degree of precision. Various localization methods based on mobile anchor nodes have been proposed for assisting the sensor nodes to determine their locations. However, none of these methods attempt to optimize the trajectory of the mobile anchor node. Accordingly, this project presents a path planning scheme, which ensures that the trajectory of the mobile anchor node minimizes the localization error and guarantees that all of the sensor nodes can determine their locations. The obstacle-resistant trajectory is also proposed to handle the obstacles in the sensing field. Later this path planning algorithm is adjusted so that it suits most of the effective localization algorithms. The performance of the proposed scheme is to be evaluated through a series of simulations with the ns-2 network simulator.