A drug delivery device comprising a housing a plurality of contacts (212) and a cylindrical member (406) configured to be rotatably supported inside the housing, wherein the outer surface of the cylindrical member is provided with a plurality of tracks together forming an encoder, each track comprising conductive segments and nonconductive segments, and wherein the cylindrical member is supported in the housing such that each track is engaged by a respective one of the plurality of contacts.Linvention concerne un dispositif de libération de médicament comprenant : une enveloppe, une pluralité de contacts (212) et un élément cylindrique (406) configuré pour être supporté rotatif à lintérieur de lenveloppe, la surface extérieure de lélément cylindrique étant dotée dune pluralité de tracés formant un codeur et comportant chacun des segments conducteurs et des segments non conducteurs, et lélément cylindrique étant supporté dans lenveloppe de sorte que dans chaque tracé sengage un contact respectif de la pluralité de contacts.