Propranolol, a widely used beta-adrenergic receptor antagonist drug with potential toxic effects to organisms and human beings, was not completely removed from environment through traditional wastewater treatments. It is necessary to sensitively and selectively monitor the trace content propranolol in various samples. In this work, a novel photoelectrochemical (PEC) aptasensor based on Au nanoparticles (NPs) modified g-C3N4/BiPO4 hetero-junction was successfully fabricated for detecting (S)-propranolol (S-Pro), an important racemic enantiomer of propranolol. Herein, g-C3N4 was employed as visible light-active semiconductor. The photocatalytic activity of g-C3N4 was enhanced via forming heterojunction with BiPO4 to facilitate the separation and migration of photo-generated carriers. In addition, Au NPs with perfect conductivity and surface plasmon resonance (SPR) effect are not only beneficial to the electron transfer and visible light harvest of g-C3N4/BiPO4 heterojunction, but also the crucial factor on assembling S-Pro-binding DNA aptamer via Au-S bonding. At the same time, as a pi-pi conjugated material, g-C3N4 with large surface area also provides an excellent platform for loading Au NPs. Under the visible light illumination, the PEC aptasensor displayed high PEC performance. On such a sensor, specific captured S-Pro by the aptamer was quickly oxidized by the photogenerated holes to inhibit the recombination of the photo-generated carriers, enhanced the PEC response, and realized the detection of S-Pro. Under optimal conditions, the designed PEC aptasensor exhibited a wide linear range of 10 nM to 1000 nM with a low detection limit (defined as S/N = 3) of 2.55 nM. Moreover, the proposed sensor displayed high selectivity, good reproducibility, and general long-term stability. And the S-Pro in real sample was accurately detected using this proposed sensor.