Objectives: To implement an effective spectrum access technique using cognitive radio technology with distance based clustering and routing algorithm with in wireless sensor networks and test this algorithm with different scenarios by varying position of the base station. Methods: Network region is divided into parts for allocating the spectrum and topology control, by distance based multi hop clustering and routing algorithm which decides cluster forming strategy on the basis of distance from the base station and route the data with less hops. Findings: The simulation shows, the proposed algorithm was able to provide a better Network Life time with the same amount of initial energy. Also, election of cluster heads on the basis of distance has helped in increasing the stability. And, with different efficient distance thresholds deciding single hop and multi hop communication. Application/Improvements: The proposed algorithm increases the scalability of the network, in comparison to the existing algorithms, by an average of 29%, when the base station is kept at the corner and, by 42.5%, when it is kept away from the corner.