Research Article

Optimized Cluster-Based Dynamic Energy-Aware Routing Protocol for Wireless Sensor Networks in Agriculture Precision

Algorithm 2

Data Transmission and Cluster Head Rotation.
1. do
2. CM sense and transmit sense data to CH
3. if
4.   directly transmit data to in single hope
5. else
6.   use GW node to transmit data to in multi-hop
7. end if
8. while (just before round over)
9. for
10. each CM send residual energy and location to their
11. end for
12. calculate avg energy of cluster
13.
14. calculate energy centroid of cluster
15.    
16.    
17.    
18. for
19. if
20.  current change the status of node(k) =
21.  current withdraw responsibility
22. end if
23. end for
24. transmit joining message as same as Algorithm 1