In order to effectively control high temperatures inside coal gangue hills, gravity heat pipes with specific spacings are vertically installed in coal gangue hills. Heat extracted from these heat pipes can be utilized for power generation through energy conversion. In this study, an equivalent model of gravity heat pipes in coal gangue hills was established and, in a laboratory setting, experimental research and optimization were conducted on power generation per unit area using the temperature difference of gravity heat pipes for electricity generation. To facilitate real-time testing of different heat pipe parameters and to display the experimental results, a multi-parameter measurement system was designed and constructed. This study systematically investigated the effects of various structural parameters such as inclination angle, heating temperature, initial absolute pressure, and working fluid height. Through single-factor experiments, it was determined that the inclination angle had no significant impact. The range of values for heating temperature, initial absolute pressure, and working fluid height were confirmed based on six sets of experiments. To maximize the performance of the thermoelectric generator, a response surface analysis experiment was conducted using the Design-Expert software. The optimal conditions were determined to be a working fluid height of 200.001 mm, an initial absolute pressure of 0.002 MPa, and a heating temperature of 413.15 K. Under these conditions, the power generation per unit area of the thermoelectric generator reached 0.122981 W/(m2·K). The accuracy of the theoretical experiments was verified through on-site industrial experiments. By calculations, it was determined that the maximum temperature difference power generation capacity per gravity heat pipe was 42.39 W. This provides a new solution for the management of coal mine gangue hills and the secondary utilization of waste energy.