A drug delivery device comprising;a housing;a cylindrical member configured to be rotatably supported inside the housing, wherein the outer surface of the cylindrical member is provided with at least first and second tracks together forming an encoder, each track comprising conductive segments and non-conductive segments; andat least first and second groups of contacts configured to engage the first and second tracks respectively at predetermined intervals along the length of the track.