The capsule and tablet metal detector system has high precision, sensitivity and stability, and is suitable for detecting and removing magnetic and non-magnetic metal foreign bodies in tablets and capsules. The automatic pharmaceutical metal detector does not affect production efficiency, can quickly detect a large number of drugs, and can effectively eliminate interference from other factors in the pharmaceutical environment to ensure the accuracy of detection.