Traditional localization techniques are not well-suited for these requirements. Besides, a global positioning system (GPS) receiver on each device is cost and energy prohibitive for many applications, not sufficiently robust to jamming for military applications, and limited to outdoor applications. Local positioning systems (LPS) [2] rely on high-capability base stations being deployed in each coverage area, and is an expensive burden for most low-configuration wireless sensor networks. Hence, automatic localization of the sensors in wireless networks is a key enabling technology. The overwhelming reason is that a sensor's location must be known for its data to be meaningful. As an additional motivation, sensor location information can be extremely useful for scalable, and geographic routing algorithms. In wireless sensor networks, localization is an important task that refers to the ability of determining relative or absolute position of sensor nodes with an acceptable accuracy. Collaboration among nodes is highly essential so that localization can be accomplished by the nodes themselves without any human intervention. In WSNs, normally such collaboration occurs among nodes located in a certain region. In this paper, we propose the localization of sensors through collaboration among nodes to minimize the localization error and to find localization accuracy as much as possible. In our localization algorithms, the normal, beacon and anchor nodes collaborate with each other to calculate the location information of the nodes by considering several aspects like limited energy resource, number and density of nodes and existence of obstacles. A novel localization scheme along with localization error determination and correction methods are also proposed to calculate the relative location of the nodes in a collaborative manner with help of anchor and beacon nodes. The main contributions of our work can be summarized as follows. * We combine the range-free and range-based localization schemes to determine the location of normal nodes distributively by using limited beacon nodes with location information. Due to the use of fewer beacon nodes, our algorithm could be cost effective. * In most of the localization algorithms, a free space model is considered for the propagation of signal, which is an over idealization case. Since noise and obstacle must affect the localization system, we develop localization algorithms that consider the fading and shadowing effect. Hence, our localization model can be useful for both outdoor and indoor environment. * In range-based localization schemes, a node has to depend on the location information of other nodes to determine its own location and all most all localization schemes are probabilistic by nature. Hence, error must be incurred as a node may receive location information from more than one beacon nodes. In this work, analytical methods are developed using probability distribution function to find out the probability of wrongly identifying a transmission arriving from a node with location information. * Analytical methods are developed to reduce the localization error and therefore our localization system can provide more accurate location information of a node. The rest of the paper is organized as follows. An overview of the related work is presented in Section 2. Our proposed localization algorithm, localization error determination and correction methods are described in Section 3. Performance evaluation of our algorithms is presented in Section 4 of the paper and concluding remarks are made in Section 5.