Localization algorithm in wireless sensor networks has attracted significant interest in recent years. The RSSI approach is considered as the cheapest solution allowing coarse-grain, yet effective for many applications in outdoor environments. However, when environments change, there exists a big localization error using RSSI without a reconstructing data set. In order to solve the problem of reestablishing the data set when the environments change, a novel one-dimensional localization algorithm based on received signal strength ratio (1-DIM-RSSR) is proposed for the one-dimensional wireless sensor network applications, such as road surveillance and pipeline transmission. While synthetically considering accuracy, power consumption, localization time, and device costs, we can only use coordinate x to locate the nodes by defining y as 0. Our algorithm is based on the theory as follows: the values of Signal Strength vary from one environment to another. When environments change, even the distance between the transmitter and the receiver remains unchanged, but there is still at least 10dBm's difference. On the contrary, the ratio of the received signal strength from two base stations varies little in the condition of the unchanged distance, and thus it avoids reconstructing the dataset when environments change. 1-DIM-RSSR comprises of two phases: the data set construction phase and the localization phase. In the first phase, N reference nodes are uniformly distributed between the two base stations BS1 and BS2. We collect the signal strength RRi1 and RRi1 from BS1 and BS2 respectively and get signal strength ratio Ri = RRi1/RRi2 at each point, where i ϵ [1, N] corresponding to the N references nodes. In the localization phase, we record the signal strength ratio Rʹ of mobile nodes and pick the one that best matches the observed signal strength ratio. Our idea is to compute the distance | Ri - Rʹ| at a fixed set of locations, and then pick the location that minimizes the distance. Simulation and experiment results show that localization precision of the proposed algorithm compared with the RSSI algorithm is improved when the environments change. The proposed method is easy to operate, and need not reconstruct the dataset when the environments change. So this method holds the promise for many applications such as monitoring product lines, road surveillance, and pipeline transmission. Meanwhile, since our algorithm is based on 1-D localization, how to extend this conception to 2-D or even 3-D localization will be our ongoing work.