An on-demand weighed clustering algorithm is proposed against the limitation of wireless sensor network nodes with limited energy. This algorithm obtains more local network information by means of information interaction between nodes, and by comprehensively considering such factors as the current energy value, degree and transmission power, etc. of nodes, it makes different clustering decisions as per different application backgrounds of networks. Simulation results show that this algorithm has a more rational clustering by reducing energy consumption and lengthening network lifetime, compared to Low Energy Adaptive Clustering Hierarchy, a representative clustering algorithm.