Detecting outliers/noise from sensor data
Regarding your next question, I will try to give you some long description explainig a general way of transforming filters defined by their transfer function into discrete domain. If you are not interested in the details, you can skip to the bottom, where I wrote a C code (tested).

The transfer function of a first-order low pass filter (with unit gain) is defined as follows:
$$K(s) = \frac{1}{1+sT}$$
And its angular cutoff frequency defined as $$\omega_c = \frac{1}{T}$$
Therefore the cutoff frequency expressed in Hertz becomes 
$$f_c=\frac{1}{2 \pi T}$$
$$T=\frac{1}{2 \pi f_c}$$
Whatever goes above this frequency, will be cut off with gain equal to -3dB/decade for the first order low pass filter.

Either using bilinear transform or by expressing the gain in form of differential equations and then discretizing them with Euler scheme you can obtain a discrete domain equation that expresses the gain. I prefer bilinear transform as it is more straightforward.
In order to apply bilinear transform we perform the following substitution:
$$ s = \frac{1}{T_s} \frac{1-z^{-1}}{1+z^{-1}}$$
Where Ts (not to be mistaken with T) is sampling period, so in your case it is the number of seconds between each sample. I.e. for 44100Hz sampling frequency, Ts becomes 1/44100 seconds.

Now, after performing this substitution and simplifying terms, the discrete time transfer function (Z transform) of your filter becomes:
$$\frac{1+z^{-1}}{(1+2T_s/T) + (1-2T_s/T)z^{-1}}$$
Now lets recall the definition of Z transform. In general form it is expressed as the following:
$$ H(z) = \frac{b_0 + b_1z^{-1}+ b_2z^{-2} + ... + b_Mz^{-M}}{1 + a_1z^{-1}+ a_2z^{-2} + ... + a_Nz^{-N}} = \frac{Y(z)}{X(z)}$$
Where bare numerator coefficients from 1 to M (highest power) and a are denominator coefficients.

Now, a difference equation can be derived in the following way:
$$y(n) = b_0x(n) + b_1x(n-1) + b_2x(n-2) + ... + b_Mx(n-M)  - a_1y(n-1) - a_2y(n-2) - ... - a_Ny(n-N) $$
Where n means n-th sample, y is your output and x is your input. After applying the above, the simplified form of difference equation for your filter becomes:
$$y(n) = (1-\alpha)y(n-1) + \alpha x(n)$$
Where 
$$ \alpha = \frac{T_s}{T + T_s}$$

This means that n-th sample (the current one) in filtered signal, called y(n) here, equals one minus alpha times the previous sample in filtered signal plus alpha times n-th sample in your source (noised) signal. In C language:

double lowpass (double x, double y_prev, double alpha)
{
    return (1.0-alpha)*y_prev + alpha*x;
}

int main()
{
    double x[10] = {1,2,3,4,5,6,7,8,9,10}; //signal with noise
    double y[10]; //filtered signal (will be generated)
    double fc = 500.0; //500Hz cutoff frequency
    double Ts = 1.0/44100.0; //for example
    double T  = 1.0/(2.0*3.1415*fc);
    double alpha = Ts/(T+Ts);

    y[0] = x[0]; //initialize first y sample as equal to first x sample

    printf("Input\tOutput\n");
    int i;
    for(i=1; i&lt;10; ++i)
    {
        y[i] = lowpass(x[i], y[i-1], alpha);
        printf("%.4f\t%.4f\n", x[i], y[i]);
    }
}


Without complicating this code, for higher order filtering, you can swap y with x once it is filtered and repeat what's in the loop. It's slow and naive, but otherwise, you'd have to take a power of the transfer function (i.e. K(s)^2 for second order filter) and derive the discrete equation again. Thankfully with some practice, you will see a pattern in this and (even better!) you can find ready derivations of higher order low pass filters in the Internet :) 

Sources: 
https://en.wikipedia.org/wiki/Low-pass_filter 
https://en.wikipedia.org/wiki/Bilinear_transform 
https://ccrma.stanford.edu/~jos/fp/Z_Transform_Difference_Equations.html