An automatic injection device has an insertion needle configured to be inserted into a patient and a drug container which contains a pharmaceutical product. The drug container includes a stopper. The automatic injection device also has a fluid path which fluidly connects the drug container to the insertion needle. The automatic injection device further has a drive system configured to cause parallel linear movement of the stopper to force the pharmaceutical product into the fluid path. The drive system has a driving element and a movable element. The automatic injection device additionally has electronics configured to provide a signal to the drive system to move the stopper and have means for sensing the stopper position. The movable element has an outer magnet at least partially surrounding the drug container and an inner magnet inside the drug container.