In wireless sensor networks (WSN), it is very important for sensor nodes to locate with low energy consumption and high accuracy, especially in a dangerous environment. This paper describes a range-free layered localization scheme using one mobile anchor node which can transmit gradient signals, and whose moving track is a straight-line along the x-axis. And this paper proposes a sleep/wake mechanism called sensor sleep-time forecasting to save energy consumption during localization. The relationship, between the key factors in localization algorithm and the average location error, is analyzed in detail. Simulation results show that the scheme performs better than other range-free mechanisms—the average location error is less than 0.7 m, and it is independent on sensor nodes density or sensor nodes radio range, the accuracy of the algorithm can be adjusted in different occasions, and the algorithm beacon overhand is small and average localization time is short.