Recently, there have been great advances in internet of things (IoT) and wireless sensor networks (WSNs) leading to the fourth industrial revolution in power grid, namely, Smart Grid Industry 4.0 (SGI 4.0). In the Smart Grid Industry 4.0 framework, the WSNs have the potential to improve power grid efficiency by cable replacement, deployment flexibility, and cost reduction. However, the smart grid (SG) environment that the WSNs operate in is very challenging because of equipment noise, dust, heat, electromagnetic interference, multipath effects and fading, which make it difficult for current WSNs to provide reliable communication. For SGI 4.0 to come true, a WSN-based highly reliable communication infrastructure is essential for successful operation of the next-generation electricity power grids. To address this need, in this paper a novel dynamic clustering based energy efficient and quality-of-service (QoS)-aware routing protocol (called EQRP), which is inspired by the real behavior of the bird mating optimization (BMO), has been proposed. The proposed distributed scheme improves network reliability significantly and reduces excessive packets retransmissions for WSN-based SG applications. Performance results show that the proposed protocol has successfully reduced the end-to-end delay and has improved packet delivery ratio, memory utilization, residual energy, and throughput. (C) 2017 Elsevier B.V. All rights reserved.