The paper introduces a novel method called dynamic fuzzy clustering (DFC) for data aggregation in wireless sensor networks (WSNs), which enhances energy efficiency and network longevity by optimally selecting cluster heads (CHs) using fuzzy decision-making techniques. It combines clustering with a minimum spanning tree structure, reducing energy consumption while improving data handling among sensors. Comparative analyses show that DFC outperforms existing protocols in terms of energy savings and network lifetime.