In wireless data transmissions processes, data loss is an important factor that reduces the robustness of wireless sensor networks (WSNs). In many practical engineering applications, data loss compensation algorithms are then required to maintain the robustness, and such algorithms are typically based on compressive sensing with a large memory of microcontrollers needed. This paper presents an improved algorithm, based on random demodulator, to overcome the difficulty of microcontroller-dependence in the traditional data loss algorithms. The newly developed algorithm demonstrates the following advantages: 1) low space complexity; 2) low floating-point calculations; and 3) low time complexity. Therefore, it is more suitable to be embedded into ordinary nodes, comparing with the traditional algorithms. In this paper, a WSN based on WiFi is also developed for verifying the effectiveness and feasibility of the proposed algorithm. Field experiment on Xinghai Bay Bridge is done. Experimental results show that the WSN works properly and steady. Moreover, the data loss can be compensated effectively and efficiently through the use of the present algorithm.