The article presents a new algorithm for embedding digital watermarks in the data of wireless sensor networks. The algorithm is designed to protect against the substitution of the data source in such networks. An important distinguishing feature of the proposed algorithm is the ability to control the level of distortions introduced as a result of embedding. This allows us to recommend this algorithm for use in wireless sensor networks, including sensor nodes of various types, designed to measure physical quantities of different nature. Computing experiments were carried out by means of simulation modeling in the OMNeT++ framework. The results of the experiments showed that the obtained algorithm provides statistical indistinguishability of sensory data samples before embedding digital watermarks into them and after embedding.