An injection device for injecting a dose of drug, e.g. insulin for diabetes treatment, in which energy is stored in a spring member 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 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.