Hydrogen sulfide (H 2 S) is an important bioactive molecule that plays a significant role in various functions, particularly in the living brain, where it is closely linked to cognition, memory, and several neurological diseases. Consequently, developing effective detection methods for H 2 S is essential for studying brain functions and the underlying mechanisms of these diseases. This study aims to construct a novel photoelectrochemical (PEC) microelectrode Ti/TiO 2 @HSP for the quantitative monitoring of H 2 S levels in the living brain. The PEC microelectrode Ti/TiO 2 @HSP is formed by covalently bonding a specifically designed organic PEC probe HSP, which possesses a Dπ−A structure, to the surface of TiO 2 nanotubes generated via in situ anodic oxidation of titanium wire. The PEC probe HSP can effectively react with H 2 S and generate significant photocurrent response under long-wavelength excitation light (560 nm), thereby achieving quantitative detection of H 2 S. The sensor demonstrates high sensitivity and good selectivity. In vivo experiments utilizing the PEC microelectrode Ti/TiO 2 @HSP enable the monitoring of dynamic changes in H 2 S levels across various regions of the mouse brain. The findings reveal that in normal mice, the concentration of H 2 S in the hippocampus is significantly higher than in the striatum and cerebral cortex. Additionally, following propargylglycine drug stimulation, H 2 S concentrations in different brain regions were observed to decrease, with the most substantial reduction noted in the hippocampus. This suggests that cystathionine γ-lyase (CSE) is the primary enzyme responsible for H 2 S production in this area, while the striatum exhibits a less pronounced decrease in H 2 S concentration, indicating a reliance on alternative enzymatic pathways for H 2 S production. Therefore, this study not only successfully develops a high-performance H 2 S detection sensor but also provides new experimental tools and theoretical foundations for further exploring the roles of H 2 S in neurophysiological and pathological processes.