This paper describes error compensation using least square method in wireless communications networks. The received data use the Gaussian filter to avoid interference，then use least square to compensate the error. ZigBee sensor network is constructed to verify the proposed algorithm. The experiment has been taken to test the accuracy after error compensation. The result shows the method is available for improving accuracy.