book collections email follower instructable user

Step 17: CALCULATION OF DISTANCE MOVED PER STEP OF THE ENCODER

Picture of CALCULATION OF DISTANCE MOVED PER STEP OF THE ENCODER

Number of steps per rotation of the encoder shaft, N = 24 steps

The diameter of the wheel, D = 12.7mm

Circumference of the wheel, C = 2*pi*(D/2) = 2*3.14*6.35 = 39.898 mm

Therefore, distance moved per step = C/N = 39.898/24 = 1.6625 mm

If you guys are using a different diameter wheel or encoder with a different step count, find the distance moved per mm by substituting your values in the above formula and once you find the resolution, enter this value in the formula within the code as shown in the picture.

Compile and upload the code to the Arduino again.

Once the calibration of the encoder is done and the modified program is uploaded, you can desolder and remove the USB to serial TTL converter module from the Arduino Pro Mini.