Performance of the Wireless Sensor Networks (WSNs) depends significantly on coverage area which is determined via the effective dynamic distribution of sensors. Making mobile sensors' dynamic distributions, which determines their positions within the network effectively, improves performances of WSNs by enabling sensors to form the coverage area more efficiently. In this paper, we initially propose the electromagnetism-like (EM) algorithm as the sensor distribution strategy to increase the coverage area of network after random distribution of sensors. Forming more effective coverage area by using mobile and stationary sensors and probabilistic detection model has been aimed by developing the Optimal Sensor Detection Algorithm that is based on the proposed EM algorithm (OSDA-EM). For this purpose, it has been thought that we would attain to more realistic results, with probabilistic detection model by forming the coverage area more effectively. Additionally, performance of the developed OSDA-EM algorithm has been compared with the Particle Swarm Optimization (PSO) and Artificial Bee Colony (ABC) algorithms which was previously used in the dynamic distribution of WSNs. Simulation results have shown that the developed OSDA-EM can be preferred in dynamic distribution of WSNs that performed with probabilistic detection model. (C) 2015 Elsevier Ltd. All rights reserved.