The technology of wireless sensor networks (WSNs) is in constant development and it made great progress in many applications. One of the most popular problems in WSNs is the limited energy storage power at every sensor node. This paper aims to propose and develop a new distributed clustering algorithm for energy harvesting wireless sensor networks denoted by DEH-WSN (Energy Harvesting for Distributed Clustering Wireless Sensor Networks Protocol) that relies on matching between clustering and energy harvesting in a distributed topology. DEH-WSN uses initial and residual energy capacity of the nodes to choose cluster heads. Simulation results prove that the proposed method increases network lifetime and the effective throughput.