Introduction: Aliasing Demonstration Using an Encoder Wheel

The purpose of this project was to demonstrate the concept of sampling rates and the effect they have on aliasing. Aliasing is the over or under sampling of a signal, producing distortion in the signal frequency. In order to observe the characteristics of a signal, we must sample at a rate that is fast enough to capture the necessary data. Therefore, choosing a proper sampling rate is essential in accurately filtering an incoming signal.

Step 1: Setup

For this project, I implemented an Arduino Uno, digital LED, photoresistor, Hall effect sensor, and a rotational servo into the circuit layout displayed in Figure 1. An image of the completed circuit setup can be seen in Image 1. The steps for completing the setup seen in Image 1 are listed below:

1) Connect an encoder wheel to a fully rotational servo.

2) Position a magnet in the encoder wheel.

3) Position the wired Hall effect sensor to be in close contact with the stationary magnet.

4) Position the wired LED below the holes in the encoder wheel.

5) Position the wired photoresistor to be above and facing the LED, with the encoder wheel separating the two.

The Arduino Uno microcontroller is used in this project to supply power to the circuit components and to communicate between the Arduino interface and the circuit. The servo and encoder wheel are used to create an interval between the photoresistor and Hall effect readings. As the encoder wheel makes a rotation, the photoresistor will sense the light of the LED only when a gap is positioned between the two, and the stationary Hall effect sensor will read the passing of the magnet.

Step 2: Step 2: Arduino Programming

The Arduino program shown is used to collect the raw data from the photoresistor and Hall effect sensor, communicate it to the serial monitor, and detect and count peaks in the signal frequencies.

Step 3: Step 3: MATLAB Programming

The MATLAB code shown is used to import, process, and plot the data collected from the Arduino. Descriptions of the code as well as 4 plots displaying the results of varying sampling rates can be seen below. A moving average method was not used to smooth the data.

Step 4: Step 4: Results

Test 1

Delay: 0 ms

Time: 72 sec

Hall Peaks: 55

Photo Peaks: 425

Test 2

Delay: 300 ms

Time: 75 sec

Hall Peaks: 28

Photo Peaks: 49

Test 3

Delay: 550 ms

Time: 61 sec

Hall Peaks: 12

Photo Peaks: 33

Test 4

Delay: 750 ms

Time: 57 sec

Hall Peaks: 7

Photo Peaks: 30