1. A drug delivery device comprising: a housing; a cylindrical member configured to be rotatably supported inside the housing, wherein an outer surface of the cylindrical member is provided with a single track comprising a sequence of encoded images that are each unique images from adjacent encoded images of the sequence, wherein each encoded image comprises a plurality of adjacent identical code sections, and wherein each encoded image of the sequence of encoded images corresponds to a discrete rotational position of the cylindrical member with respect to the housing; and a sensor directed at the track of the cylindrical member, wherein the sensor is configured to detect portions of two or more of the adjacent identical code sections.