The WSN are used for the collection of the data from the environment in the IOT based smart agriculture systems. The WSN constitute a challenging factor in collection and analysis of the data from the drones, due to the resource scarcity. Clustering can aid in managing the nodes in the sensor networks. The clustering process requires a large amount of energy in determining the most efficient node to be selected as a cluster head. The lifetime of the network is dependent on the energy consumption during the cluster head selection and data transmission process. The chapter proposes a cluster head (CH) selection and routing approach using weight-based cost function for the IOT based smart agriculture system. The nodes in the sensor network are clustered into a number of clusters using the k-medoids clustering. The optimal path for the data transmission towards the base station is obtained using the weighted cost function using the parameters trust value, residual energy and hop count. The performance of the existing approach is validated analytically.