An injection device for delivering a medicament to the human or animal body. The injection device comprising a housing, a piston rod for driving a bung of a medicament container, a drive mechanism including a motor for providing an output drive to the piston rod for delivering the medicament and controller for controlling operation of the device.