A drug delivery system is provided including a drug expelling structure adapted to expel a set dose from a drug-filled cartridge, the expelling structure including a rotational member adapted to rotate relative to a housing and corresponding to a set and/or expelled dose, the system including a sensor adapted to detect a set and/or an expelled dose. The sensor includes a first portion mounted to and rotating with the rotational member, and a second portion including a second rotary sensor part mounted non-rotationally relative to the housing. The first portion includes electronic circuitry, and a first rotary sensor part, and the second portion includes a second rotary sensor part mounted non-rotationally relative to the housing. The first and second rotary sensor parts rotate relative to each other during setting and/or expelling of a dose of drug.