Wireless Sensor Networks (WSNs) due to their numerous applications have become a significant research topic in recent years, which include monitoring, tracking/detection, medical, military surveillance, and industrial. Due to the small sensors' difficulty in being easily recharged after random deployment, energy consumption is a challenging research problem for WSNs in general. One popular scenario for reducing energy consumption for WSNs is to use cluster‐based technology to reduce sensor node communication distance. Along with focusing on the Chain Cluster Based routing protocol classes. Initially, the Calinski Harabasz approach is utilized to find the optimum number of clusters. This modification will take place for two stages that pass via improving techniques of enhancing the Improved Energy‐Efficient PEGASIS‐Based (IEEPB) protocol to achieve the main goal of this study. The network lifetime was then extended by using the K‐means algorithm. As a result, rather than using a single long path, data is transferred over shorter parallel lines. The protocol is simulated with the MatlabR2015b simulator, which produces clear and effective simulation results, particularly in terms of energy savings. The outcome of the simulation results shows that the Improved energy‐efficient PEGASIS‐based routing protocol‐ KMeans optimisation (Improved EEPB‐ K‐means Optimisation) protocol outperforms the Low‐energy adaptive clustering hierarchy, Power‐efficient gathering in sensor information systems, IEEPB, and MIEEPB protocols.