The research proposed a clustering formation approach that ensures that the chosen cluster head (CH) in D2D communication consumes minimal energy and that the cluster members (CMs) are offered good quality of service. In addition, the study investigated various factors influencing power consumptions of User Equipment (UE) in Device to Device (D2D) Communication. Network and geographic data of the UE were collected within 200m diameter (100m radius) around the chosen base station (BS). A term Hardware Sensing Factor (a weighting factor) was formulated from the collected network data. The HSF and the distance between the UE and the base station were utilized as input data to Self Organizing Map (SOM), an unsupervised machine learning algorithm, to form clusters of the UE. A UE with highest value of HSF and minimal distance to the BS is chosen as the Cluster Head (CH) for each cluster. It was shown that the power consumption of the UE increases as the signal attenuation (which depends on distance) increases. In addition, for every transmission/reception between the Cluster Member (CM) and the BS through the CH, the CH consumes about 2.5% more than the CM. Also, in addition to the effects of signal attenuation, the power consumption of the CH is largely dependent on the number of CMs associated with the CH. Furthermore, it is more energy efficient for the CMs to communicate with the CH than communicate with the BS, especially for edge cell UE.