An injection device (1) for injecting a dose of drug, e.g. insulin for diabetes treatment, 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 during injection of a previously set dose. The injection device (1) further comprises means for electronically detecting the amount of a set dose and/or means for electronically detecting the amount of an injected dose. The electronic detecting means allows storage and/or logging of data relating to injections performed using the injection device (1).