Now a days Wireless sensor networks are used for number of real time applications such as computation cost, memory utilization, and communication and energy resources. As the network consist of number of nodes, these nodes comprises of batteries. One of the main issue in WSN is that these batteries are not easily recharged or replaced. Moreover decreasing these energy reduction reduce the network lifetime, therefore increasing the network lifetime is an important issue in front of researcher. This paper proposes the clustering based routing protocol, in which sensor nodes are divided into number of clusters. Then a cluster head is selected from each cluster called as super cluster head. Data is sent to base station by super cluster head, which is selected among all cluster heads. For selection of Super cluster head (SCH) a fuzzy logic approach is used, which considers the factors such as the remaining battery power of modem mobility, route of base station etc. In the existing system, researcher does not focus on security of network. Hence in the proposed system we are securing data in the network by using ECC algorithm. Proposed system also detects the attack found in the network. Therefore it improves the network lifetime, providing security to the network.