The invention discloses a method for detecting a photoelectric chemical sensor for mercury ion detection. The construction method of the photoelectric chemical sensor comprises the following steps of: (1) cleaning a glassy carbon electrode, dispensing a photo-anode perylene tetracarboxylic / graphene heterojunction suspension on the surface of the glassy carbon electrode, and drying at room temperature; (2) fixing an aminated T base to the surface of the electrode subjected to EDC-NHS activated treatment; (3) dispensing to-be-detected mercury ions and interfering ions of different concentrations on different electrodes or on the surface of the same electrode in different times respectively; and (4) dispensing a mixed solution of hydroxylamine and chloroauric acid on the surface of the electrodes dispensed with the mercury ions, and forming nanogold on the surface of the electrode by utilizing catalysis of the mercury ions. The photoelectric chemical sensor prepared by the method has the characteristics of high ultra-sensitiveness, high specificity, low cost, simpleness and convenience in operation, easiness in carrying, low detection limit of 2pmolL<-1> and the like.