The environment pollution problmes resulting from ammonia-nitrogen have been paid more attentions. Efficient and accurate detection of ammonia–nitrogen in aqueous enivronment including tap water, lake water and sea water is meaningful. In this work, a novel PtAu alloy sensor was designed and fabricated via coelectrodeposition method on Ni foam (NF). In addition, polypyrrole (PPy) was electrochemically grown on NF surface to avoid corrosion of NF during the electrodepositing process of PtAu alloy. Under the optimal condition, the prepared Pt5Au3-PPy-NF-1 showed the great electrocatalytic performance for ammonia oxidation reaction with the current density of 15.55 mA and great detection ability with the high sensitivity of 8.2 µA µM−1, low detection limit of 1.05 µM and three linear ranges from 4 to 50 µM, from 50 to 400 µM and from 400 to 1000 µM. The enhanced performances could be attriubted to: 1) Pt showed the electrochemial catalytic activity for ammonia oxidation reaction and Au showed the lower adsortion energy to N atom, as well as optimized electronic structure of Pt and Au.