The topology control in a sensor network balances the load on the sensor nodes and increases the scalability and the duration of the network. Grouping sensor nodes are an effective approach to topology control. We propose a new distributed clustering approach for long-life ad hoc sensor networks. Our proposed approach does not make any assumptions about the presence of infrastructure or node capabilities, other than the availability of multiple levels of power in sensor nodes. A protocol is presented, HEED (Hybrid Energy-Efficient Distributed Clustering), which periodically selects cluster heads according to a hybrid of the residual energy of the node and a secondary parameter, such as the proximity of nodes to their neighbors or node degree. HEED ends in O (1) iterations, incurs low message overhead, and achieves fairly even distribution of the cluster head across the network. We prove that, with adequate limits on node and intra-cluster density and inter-cluster transmission intervals, HEED asymptotically can almost certainly guarantee the connectivity of clustered networks. The simulation results demonstrate that our proposed approach is effective in extending the useful life of the network and in supporting aggregation of scalable data.