An injection device (1) for injecting a dose of drug, e.g. insulin for diabetestreatment, in which energy is stored in a spring member (9, 24) during dose setting.The stored energy is released and used for driving an injection mechanism duringinjection of a previously set dose. The injection device (1) further comprisesmeans for electronically detecting the amount of a set dose and/or means for electronicallydetecting the amount of an injected dose. The electronic detecting means allowsstorage and/or logging of data relating to injections performed using the injectiondevice (1).