In this work we reported an optical sensor for the detection of dissolved ammonia through the green synthesis of silver nanoparticles (AgNPs) using aqueous fruit extract of Terminalia chebula. The formation of AgNPs was monitored by visual observation and the detection of Surface Plasmon Resonance (SPR) peak using UV–Vis spectrophotometer. The naked eye visual inspection revealed the rate of formation of AgNPs in control reaction (absence of ammonia) is slower than that of other ammonia contained solutions which was confirmed from the UV–Vis spectroscopic results. The absorbance intensity of AgNPs was linearly (R2 = 0.9850) correlated with the concentration of dissolved ammonia from 0 to 100 ppm. The formation of diamine silver complex and ammonium phenolate ion increases the SPR absorbance intensity of AgNPs. The blue shift of SPR peak, while increasing concentration of ammonia is due to the size decreasing of AgNPs, which was confirmed from the HR-TEM analysis.