An attachment for a drug injection pen includes a housing shaped to attach to a proximal end of the drug injection pen, and a dosage measurement system disposed at least in part within the housing. The dosage measurement system is coupled to receive a rotational motion, from a dosage injection mechanism disposed within the drug injection pen, when the drug injection pen dispenses a fluid. The dosage measurement system includes one or more magnets to generate a magnetic field, and one or more magnetic field sensors. The one or more magnetic field sensors rotate relative to the one or more magnets when the drug injection pen dispenses a fluid, and output a signal indicative of the magnetic field.