The wireless sensor network (WSN) as a supporting monitoring system requires stable conditions. The clustering mechanism in wireless sensor networks has been implemented to reduce energy waste. Therefore, maintaining energy in a balanced cluster head is very important. Logically, the distance between the cluster member nodes and the cluster head, and the distance of the head to sink node can affect the stability of the network while it is related to energy resources. To maintain a balanced environment, head cluster energy configuration management is a priority. One effective way to extend network life is to maintain energy balance. The main objective of this paper is to optimize the sensor network by modifying the Distributed Energy Efficient Clustering (DEEC) protocol using the Game Theory algorithm. Here, game theory has been introduced into the solution of problems by finding threshold values. Nash Equilibrium, a concept of game theory is used to have a correlation between energy variables, and non-cooperative behaviour as a character of game theory. In this work, DEEC protocol- A heterogeneous cluster protocol-has been modified in terms of threshold factors to improve the performance of wireless sensor networks. The threshold will filter out nodes that are not suitable to be cluster heads, so the wrong cluster head selection will not occur.