Wireless sensor networks are widely used in various fields and consist of a large number of sensor nodes that are powered by batteries. As a result, energy efficiency is crucial for the effective operation of these networks. With the advancement of cross technology communication (CTC), the presence of heterogeneous wireless nodes, especially mobile nodes, in wireless sensor networks has increased, making traditional routing protocols for homogeneous wireless sensor networks inapplicable. To overcome the above issues, this paper proposes a heterogeneous wireless sensor network routing protocol for a balanced energy consumption, NMSFRA (NGO based mean shift fuzzy clustering routing algorithm). In order to mitigate the impact of uneven cluster distribution and unstable network links due to the mobility of nodes, the proposed protocol first divides the network into balanced clusters using the Mean Shift (MS) method. The Mamdani fuzzy inference system is then used to take node mobility into account. The protocol dynamically selects different parameters as inputs to the fuzzy logic, enabling it to choose cluster heads (CHs) based on the overall location of the clusters. Additionally, to extend the network lifetime, the protocol generates multi-hop forwarding paths using the Northern Goshawk Optimization (NGO) method. Finally, the paper presents experimental simulations carried out on three different network topologies and compares the results with existing protocols such as LEACH, EETPF, E-FUCA, and DE-SEP. The results show that the NMSFRA protocol extends the survival period of nodes by 235 rounds, 240 rounds, 364 rounds, and 190 rounds, on average, compared to the LEACH, EETPF, E-FUCA, and DE-SEP protocols, respectively. The network throughput also increased by 154.92%, 48.74%, 84.77%, and 106.77%, respectively. The NMSFRA protocol also showed better performance in terms of total residual energy, FND, HND, and average speed difference between nodes in the first 5 rounds. Therefore, the proposed NMSFRA protocol demonstrates superior performance in terms of network lifetime, energy utilization, throughput, and network stability.