What is an Encoder?

Jump to: navigation, search

What is an encoder?

An encoder can be defined as a sensor in which a light (or IR) sensor is used in conjunction with a slotted disc in order to determine how far a rotational mechanism has turned. The slots in the disc either allow light to pass or block it, allowing the light sensor to send data to the microcontroller which can keep a count of how many 'slots' the encoder has passed.

An encoder works by shining light through a slotted wheel

The BoeBot encoder

The BoeBot encoder works by reflecting IR light off the slotted wheels of the robot. It then detects this light. If it does not read any reflected light, the encoder knows it is looking at a slot in the wheel. If it reads reflected light, then it knows there is no slot present. When the wheels turn, the encoders will form pulses of 'slot detected' and 'no slot detected'. ROBOTC can then add up these 'pulses' to determine how far the wheel has rotated.

The BoeBot Encoder.

Since the wheel has 8 slots and 8 non-slots, we have 16 pulses altogether in a full rotation. We will eventually use this knowledge to move a certain distance.


It is important to note that this encoder is not 'quadrature'. Because it is instead a standard encoder, there is no way to tell if the wheel is spinning forwards or backwards; since we only use one light sensor we don't have enough information to determine direction. Ultimately, this means that the encoder 'ticks' will always count up, even if the robot is going backwards.

This will not impact any of the projects presented here but should be taken into consideration when planning future projects.