A systemic research about the basic theory and implement technique of the simple genetic algorithm is made in this paper. An index which scales the population diversity is defined, and this index is imported into the genetic operator. For the selection process, it can be more excellent individual and increase the population diversity. In addition, this paper also uses population diversity index to instruct the crossover probability and mutation probability. Finally, the proposed method is applied to a typical room temperature control problem and the result shows that fuzzy controller has better performance than controller based on traditional genetic algorithm and PID controller.