Nowadays, the expansion of desert areas has become one of the main problems in arid areas due to various reasons such as rising temperatures and vegetation fires. Establishment of wireless sensor networks in these areas can accelerate the process of environmental monitoring and integrate temperature and humidity information sending to base stations in order to make basic decisions on desertification. The main problem in this regard is the energy limitation of sensor nodes in wireless sensor networks, which is one of the main challenges in using these nodes due to the lack of a fixed power supply. Because the node consumes the most energy during data transmission, the node that transmits the most data or sends the packets over long distances runs out of energy faster than the others and the network work process is disrupted. Therefore, in this study, a density-based clustering approach is proposed to integrate data collected from the environment in arid areas for desertification. In the proposed method at each step, the node that has the most residual energy and is highly centralized will be selected to transfer information. The results of experiments for evaluating the performance of the proposed method show that the proposed method balances the energy consumption of the nodes and optimizes the lifespan of the nodes in the wireless sensor network installed in the arid area.