The present invention provides an injection device (1, 101, 201) comprising a housing (2, 102, 202), a cartridge (30, 130, 230) holding a medical substance and comprising an outlet and a piston (31, 131, 231), a dose expelling mechanism comprising a piston rod system (10, 50, 110, 150, 210, 250) adapted to be moved relative to the housing (2, 102, 202) during a dose expelling action to thereby advance the piston (31, 131, 231) in the cartridge (30, 130, 230), and a ratchet arm (12) operatively coupled with the piston rod system (10, 50, 110, 150, 210, 250) and configured to undergo a deflecting motion relative to the housing (2, 102, 202) during a particular movement of the piston rod system (10, 50, 110, 150, 210, 250) which corresponds to a predetermined volume of the medical substance being expelled from the cartridge (30, 130, 230), the deflecting motion comprising a first part motion which decelerates the piston rod system (10, 50, 110, 150, 210, 250) followed by a second part motion which accelerates the piston rod system (10, 50, 110, 150, 210, 250), an integrated sensor (76, 176, 276) arranged to detect occurrences of acceleration of the piston rod system (10, 50, 110, 150, 210, 250), and a processor (75, 175, 275) configured to register the occurrences detected by the integrated sensor (76, 176, 276) during the dose expelling action.La présente invention concerne un dispositif d'injection (1, 101, 201) comprenant un boîtier (2, 102, 202), une cartouche (30, 130, 230) contenant une substance médicale et comprenant une sortie et un piston (31, 131, 231), un mécanisme d'expulsion de dose comprenant un système de tige de piston (10, 50, 110, 150, 210, 250) conçu pour être déplacé par rapport au boîtier (2, 102, 202) pendant une action d'expulsion de dose pour faire avancer ainsi le piston (31, 131, 231) dans la cartouche (30, 130, 230), et un bras à cliquet (12) couplé de manière fonctionnelle au système de tige de piston (10, 50, 110, 150, 210, 250) et configu