In many wireless sensor network applications, such as warning systems or healthcare services, it is necessary to update the captured data with location information. A promising solution for statically deployed sensors is to benefit from mobile beacon-assisted localization. The main challenge is to design and develop an optimum path planning mechanism for a mobile beacon to decrease the required time for determining location, increase the accuracy of the estimated position, and increase the coverage. In this paper, we propose a novel superior path planning mechanism called Z-curve. Our proposed trajectory can successfully localize all deployed sensors with high precision and the shortest required time for localization. We also introduce critical metrics, including the ineffective position rate for further evaluation of mobile beacon trajectories. In addition, we consider an accurate and reliable channel model, which helps to provide more realistic evaluation. Z-curve is compared with five existing path planning schemes based on three different localization techniques such as weighted centroid localization and trilateration with time priority and accuracy priority. Furthermore, the performance of the Z-curve is evaluated at the presence of obstacles and Z-curve obstacle-handling trajectory is proposed to mitigate the obstacle problem on localization. Simulation results show the advantages of our proposed path planning scheme over the existing schemes.