The invention relates to an improved average filtering algorithm for A/D (Analog to Digital) sampling. Data are collected by use of an MCU (Micro-programmed Control Unit), A/D conversion is carried out on the collected data, the data are stored in an array AD [N], wherein n is greater than or equal to 100. When sampling values stored in the array are full, the number of N is subject to bubble sort according to the sequence from small to big, front and rear N/5 data in the sorted array are removed, the remaining 3*N/5 are summed, an average value is taken to obtain a final sampling value. The algorithm can effectively eliminate an interference signal, especially the value which has great difference with the sampling value so that the final sampling value is very close to a truth value. Therefore, the software filtering method has the characteristics of easy realization, rapid response and high anti-interference and can effectively suppress noise.