A modified AODV Junior routing protocol is adopted as part of the combined routing strategy in the ZigBee networks. However, its routing overhead caused by the routing discovery and the routing table maintenance needs to be further reduced. Considering the deploying environment, the emerging 5G technology tends to be ubiquitous in the near future. Due to its native support to the smart devices and the M2M communication, the 5G terminals may be used as gateways for the ZigBee networks to improve the existing routing method. The ZigBee coordinator and the 5G terminals, which both have the accessibility to the internet, are defined as associated gateways (AG). Aiming to the higher efficiency and the shorter path, an improved ZigBee AODV (Z-AODV) routing protocol using associated gateways for the heterogeneous networks in the 5G environment is proposed in this paper. Besides the regular ZigBee function, by sharing the neighbour and routing information via IP network, the AGs are also responsible for collaboratively finding the optimum path and transmitting the packets to reduce the consumption for ZigBee devices. Moreover, an additional routing information collecting method is developed to further improve the routing performance. The proposed algorithm is evaluated based on simulation results. It is shown that our routing method outperforms the existing ones by higher picketer deliver ratio, shorter path length, lower latency, fewer packets sent per ZigBee node and lower routing overhead.Nonetheless, the described routing mechanism cannot thoroughly address energy consumption issues due to the limitation of the insufficient resources in ZigBee devices [10]. Therefore the routing improvement has been a main research content for the ZigBee networks. The formation and protocol optimizing is a common solution, and it is another way that to resort to the resources in deployed environment. The coming 5G communication is one of the typical environments which will be ubiquitous in the near future.5G technology is a term to indicate the forthcoming most important phase of mobile communication standards beyond the 4G. Considering the extremely higher aggregate data rates and the much lower latencies required, several disruptive technologies have been widely regarded the key challenges in the 5G era. Three of them are the native support for the M2M communication, the smarter devices, and the Millimetre wave [11]. For the native inclusion of M2M communication in 5G networks, there are three fundamentally different requirements associated with different classes of low-data-rate services: support of a massive number of low-rate devices, sustaining a minimal data rate in virtually all circumstances, and very-low-latency data transfer [12]. The smarter devices will allow the 5G terminals have access to different wireless technologies at the same time [13]. Additionally, the instinct of the larger path loss in the propagation for millimetre communication consequentially leads to a higher density infrastructure and relays [14]. Based ...