In recent years, sensor technology has attracted the attention of countries all over the world because of its potential huge application value, and it has played an important role in people's daily life and social production activities.This paper mainly studies the location algorithm based on ranging in the location algorithm and analyzes the advantages and disadvantages of the algorithm. In order to optimize the positioning of wireless sensor networks, a fuzzy controller is designed to fuzzify the input information of sensor nodes. Using Matlab network simulation tool, the congestion control algorithm proposed in this paper was simulated and compared with several typical congestion control protocols in wireless sensor networks. Experimental results show that the algorithm can improve network throughput, reduce network packet loss, and have a significant impact on network performance. The network throughput of the congestion control algorithm based on fuzzy logs is stable at 180 packets per second. Compared with CODA, the congestion control algorithm based on fuzzy logarithm increases the packet loss rate by 55-66%, and the SenTCP algorithm increases by 37-40%. It can be seen that congestion control algorithms based on fuzzy logic can play an important role in wireless sensor networks.