||Wireless sensor network (WSN) has become more and more important. Many applications are base on this technology. Among them, the application in localization has attracted many researchers attention. However, in the localization scheme based on Received Signal Strength (RSS), we have to take into account of fluctuate characteristic of RSS as well as the impact of multipath fading. Actually, the power generated by the transmitter nodes is not stable, which will affect the localization result. In this thesis, we proposed a STD method to give a more precise value of transmit power. The empirical value is used to calculate the distance between the transmitter and the receiver. Furthermore we also apply our STD method to the calculation of the distance. Finally, we use several nodes as anchor nodes and measure the distance between these nodes and the target node by using both range-based and range-free scheme. The localization accuracy is about 1.3m. As a result, we proposed a novel method to calculate the distance between two nodes and use the distance information to achieve localization.