SummaryThe Internet of Things (IoT) is a paradigm change in networking that aspires to connect almost everything on the globe. Clustering methods have been presented in the context of wireless sensor networks, and their application to the IoT could solve similar problems. However, existing clustering protocols have issues with the clustering structure that affect their performance, and some approaches pose a risk of privacy leakage during the data handling process. Therefore, this article aims to establish a novel secure and energy‐aware clustering model in the IoT, in which cluster head selection is performed via a proposed sandpiper optimization with cycle crossover process (SOCCP) model. Moreover, this cluster head selection includes certain constraints, including distance, energy, security, and cluster radius, respectively. The clustering is done by the optimized fuzzy C‐means algorithm. Here, the determination of the cluster head and cluster radius is tuned optimally via an adopted SOCCP model. Final results of the employed technique are calculated using a variety of metrics, such as alive node analysis, risk analysis, distance analysis, cluster radius analysis, as well as normalized energy analysis, respectively.