Particle swarm optimization objective is spatial neighborhood directly in the search space according to the distance between particles. This paper analyses method of detection and node management in wireless sensor networks. Sensor nodes are randomly placed in the particle swarm optimization method, data acquisition, processing and transmission of the work. The paper presents using particle swarm optimization algorithm to construction detection and node management system in wireless sensor network. Simulation experiments show the validity of this method.