An Implementation of Grouping Nodes in Wireless Sensor Network Based on Distance by Using k-Means Clustering

Rizqi Fauzil Azhar, Ahmad Zainudin, Prima Kristalina, Bagas Mardiasyah Prakoso, Niam Tamami


Wireless Sensor Network (WSN) is a network consisting of several sensor nodes that communicate with each other and work together to collect data from the surrounding environment. One of the WSN problems is the limited available power. Therefore, nodes on WSN need to communicate by using a cluster-based routing protocol. To solve this, the researchers propose a node grouping based on distance by using k-means clustering with a hardware implementation. Cluster formation and member node selection are performed based on the nearest device of the sensor node to the cluster head. The k-means algorithm utilizes Euclidean distance as the main grouping nodes parameter obtained from the conversion of the Received Signal Strength Indication (RSSI) into the distance estimation between nodes. RSSI as the parameter of nearest neighbor nodes uses lognormal shadowing channel modeling method that can be used to get the path loss exponent in an observation area. The estimated distance in the observation area has 27.9% error. The average time required for grouping is 58.54 s. Meanwhile, the average time used to retrieve coordinate data on each cluster to the database is 45.54 s. In the system, the most time-consuming process is the PAN ID change process with an average time of 14.20 s for each change of PAN ID. The grouping nodes in WSN using k-means clustering algorithm can improve the power efficiency by 6.5%.


Wireless Sensor Network, Cluster- Based, k-Nearest Neighbour

Full Text:



K. Kaur, R. Sethi, and A. Kaur, “Power efficiency in agriculture using wireless sensor network,” International Journal of Computer Science and Information Technologies, vol. 5, no. 3, pp. 3791–3793, 2014.

N. Pachori and V. Suryawanshi, “Cluster head selection prediction in wireless sensor networks,” International Journal of Computer Science and Information Technologies, vol. 6, no. 2, pp. 1033–1035, 2015.

H. Taheri, P. Neamatollahi, O. M. Younis, S. Naghibzadeh, and M. H. Yaghmaee, “An energy aware distributed clustering protocol in wireless sensor networks using fuzzy logic,” Ad Hoc Networks,

vol. 10, no. 7, pp. 1469–1481, 2012.

W. B. Heinzelman, A. P. Chandrakasan, and H. Balakrishnan, “An application-specific protocol architecture for wireless microsensor networks,” IEEE Transactions on Wireless Communications, vol. 1, no. 4, pp. 660–670, 2002.

M. Razzaq, D. D. Ningombam, and S. Shin, “Energy efficient k-means clustering-based routing protocol for WSN using optimal packet size,” in International Conference on Information Networking (ICOIN). Chiang Mai, Thailand: IEEE, 2018, pp. 632–635.

H. Echoukairi, A. Kada, K. Bouragba, and M. Ouzzif, “A novel centralized clustering approach based on k-means algorithm for wireless sensor network,” in Computing Conference. London,

UK: IEEE, 2017, pp. 1259–1262.

M. Lehsaini and M. B. Benmahdi, “An improved k-means cluster-based routing scheme for wireless sensor networks,” in International Symposium on Programming and Systems (ISPS). Algiers, Algeria: IEEE, 2018, pp. 1–6.

J. Yu, Y. Qi, G. Wang, and X. Gu, “A cluster-based routing protocol for wireless sensor networks with nonuniform node distribution,” AEU – International Journal of Electronics and Communications, vol. 66, no. 1, pp. 54–61, 2012.

R. Patil and V. V. Kohir, “Energy efficient flat and hierarchical routing protocols in wireless sensor networks: A survey,” IOSR Journal of Electronics and Communication Engineering (IOSR–JECE), vol. 11, no. 6, pp. 24–32, 2016.



  • There are currently no refbacks.

Visitor Statistic: web

Public View: click here!


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.