Research Article

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

Algorithm 1

CH Selection Phase.
1. Input: N=Total number of nodes
2. Output: BS divide entire network into Cluster
3. for i=1:N
4. Node transmit their ID, Location and Energy level to BS
5. end for
6.
7.
8. for
9. 
10. for
11.  
12.  if ( very close to )
13.   Select as
14.  end if
15. end for
16. end for
17. BS Broadcast Feedback Message contain Message Type, , Avg Energy
18. for
19. 
20.  if
21.   
22.   Broadcast joining message to neighbor nodes
23.  else
24.   Wait for CH joining message
25.  end if
26. end for
27. Neighbor nodes calculates joining weight
28.   
29. if (neighbor node )
30. Join
31. else
32. Reject CH joining message
33. end if