Enter the sampling rate in the calculator below and it will give the Nyquist frequency
Fn = FS/2
Fn is the Nyquist Frequency
FS is the Sampling Rate
In order to avoid aliasing, the highest frequency of the input signal should be less than or equal to the Nyquist Frequency.
The Nyquist frequency is often confused with Nyquist rate (equal to twice the highest frequency of a given signal).
In this post we explained that the sampling rate of the Arduino is 15 kSPS. The Nyquist frequency in this case is 7.5 kHz. An input sine wave cannot exceed this frequency if it is to be accurately represented.
If we are trying to sample a square wave with the Arduino, the 11th harmonic cannot be greater than the Nyquist Frequency. As a result the maximum frequency of a square wave input to the Arduino is (7.5/11) kHz = 682 Hz.