Smart farming is becoming the need of the hour nowadays in an effort to boost productivity and protect the crops. This can be done using sensors and internet enabled devices in the farm. The underlying wireless sensor network can sense various environmental parameters and can pass data to the internet enabled devices to support smart farming. The sensor nodes are, however, powered by smaller batteries and have limited lifetime. Therefore, this paper presents a clustering protocol which aims at increasing the lifetime of the sensor nodes. These sensors are considered to be pressure sensors which are deployed in the network and whenever any animal encroaches the farm, a signal can be passed to the internet enabled alarm system which can help the farmer to fend off the animals and protect his crops. The sensor network is considered to have three level of energy heterogeneity among the nodes and the cluster head is selected in such a way that the cluster formed by the head consists of more number of high energy nodes. The proposed protocol has been simulated in MATLAB environment and compared with SEP, DEEC and ISEP based on network lifetime and throughput. The protocol has shown better performance against these existing protocols.