The invention relates to a sleep therapy apparatus based on electroencephalogram biofeedback, also called as a good sleep generator. The apparatus comprises an electroencephalogram electrode, an electroencephalogram signal amplifying and filtering circuit, an A/D (analog/digital) sampler, a measuring and controlling system based on a single chip microcomputer, a D/A (digital/analog) output circuit, a stimulating signal drive circuit, a system power supply and the like, wherein an electroencephalogram signal, the electroencephalogram electrode, the amplifying and filtering circuit, the A/D sampler, the measuring and controlling system, the D/A output circuit, the drive circuit and a stimulating electrode are orderly connected, and an analytical algorithm module and a database are connected with the measuring and controlling system. According to invention, the single chip microcomputer system is used as a measuring and controlling platform, and collection, amplification and analysis processing of the electroencephalogram signal are realized in combination with the electroencephalogram signal amplifying and filtering circuit and a stimulating wave signal database which are arranged at the front end and a stimulating signal generating and drive circuit arranged at the rear end; corresponding therapy mode, stimulating wave group and stimulating intensity are selected according to the characteristics of the brain waves; and at last a therapy scheme is input by a post-stage stimulating circuit so as to realize biofeedback type sleep therapy.